Skip to content

Commit

Permalink
lantiq: fix checkpatch warnings in etop driver
Browse files Browse the repository at this point in the history
This commit fixes all errors reported by the checkpatch script. This
should make it easier to accept upstream this patch.

There should be no functional changes.

Signed-off-by: Aleksander Jan Bajkowski <[email protected]>
Link: openwrt#15939
Signed-off-by: Hauke Mehrtens <[email protected]>
  • Loading branch information
abajk authored and hauke committed Jul 21, 2024
1 parent c5a4436 commit ccfc454
Show file tree
Hide file tree
Showing 4 changed files with 87 additions and 56 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
From 9283477e28913c1e7625c0a8d6959745e2431533 Mon Sep 17 00:00:00 2001
From: Aleksander Jan Bajkowski <[email protected]>
Date: Sat, 13 Jul 2024 19:09:20 +0200
Subject: [PATCH] net: ethernet: lantiq_etop: remove redundant device name
setup

The same name is set when allocating the netdevice structure in the
alloc_etherdev_mq()->alloc_etherrdev_mqs() function. Therefore, there
is no need to manually set it.

This fixes CheckPatch warnings:
WARNING: Prefer strscpy over strcpy - see: https://github.com/KSPP/linux/issues/88
strcpy(dev->name, "eth%d");

Signed-off-by: Aleksander Jan Bajkowski <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
---
drivers/net/ethernet/lantiq_etop.c | 1 -
1 file changed, 1 deletion(-)

--- a/drivers/net/ethernet/lantiq_etop.c
+++ b/drivers/net/ethernet/lantiq_etop.c
@@ -675,7 +675,6 @@ ltq_etop_probe(struct platform_device *p
err = -ENOMEM;
goto err_out;
}
- strcpy(dev->name, "eth%d");
dev->netdev_ops = &ltq_eth_netdev_ops;
dev->ethtool_ops = &ltq_etop_ethtool_ops;
priv = netdev_priv(dev);
Loading

0 comments on commit ccfc454

Please sign in to comment.