* [PATCH net-next v2] net: ethernet: lantiq_etop: remove redundant device name setup @ 2024-07-13 17:09 Aleksander Jan Bajkowski 2024-07-13 18:02 ` Andrew Lunn 2024-07-15 14:10 ` patchwork-bot+netdevbpf 0 siblings, 2 replies; 5+ messages in thread From: Aleksander Jan Bajkowski @ 2024-07-13 17:09 UTC (permalink / raw) To: davem, edumazet, kuba, pabeni, olek2, jacob.e.keller, horms, u.kleine-koenig, netdev, linux-kernel 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 <olek2@wp.pl> --- drivers/net/ethernet/lantiq_etop.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/net/ethernet/lantiq_etop.c b/drivers/net/ethernet/lantiq_etop.c index 0b9982804370..9e6984815386 100644 --- a/drivers/net/ethernet/lantiq_etop.c +++ b/drivers/net/ethernet/lantiq_etop.c @@ -675,7 +675,6 @@ ltq_etop_probe(struct platform_device *pdev) err = -ENOMEM; goto err_out; } - strcpy(dev->name, "eth%d"); dev->netdev_ops = <q_eth_netdev_ops; dev->ethtool_ops = <q_etop_ethtool_ops; priv = netdev_priv(dev); -- 2.39.2 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH net-next v2] net: ethernet: lantiq_etop: remove redundant device name setup 2024-07-13 17:09 [PATCH net-next v2] net: ethernet: lantiq_etop: remove redundant device name setup Aleksander Jan Bajkowski @ 2024-07-13 18:02 ` Andrew Lunn 2024-07-15 14:03 ` Jakub Kicinski 2024-07-15 16:55 ` Aleksander Jan Bajkowski 2024-07-15 14:10 ` patchwork-bot+netdevbpf 1 sibling, 2 replies; 5+ messages in thread From: Andrew Lunn @ 2024-07-13 18:02 UTC (permalink / raw) To: Aleksander Jan Bajkowski Cc: davem, edumazet, kuba, pabeni, jacob.e.keller, horms, u.kleine-koenig, netdev, linux-kernel On Sat, Jul 13, 2024 at 07:09:20PM +0200, Aleksander Jan Bajkowski wrote: > 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. If this one is not needed: grep -r "eth%d" * 3com/3c515.c: sprintf(dev->name, "eth%d", unit); 8390/smc-ultra.c: sprintf(dev->name, "eth%d", unit); 8390/wd.c: sprintf(dev->name, "eth%d", unit); 8390/ne.c: sprintf(dev->name, "eth%d", unit); amd/lance.c: sprintf(dev->name, "eth%d", unit); atheros/atlx/atl2.c: strcpy(netdev->name, "eth%d"); /* ?? */ cirrus/cs89x0.c: sprintf(dev->name, "eth%d", unit); dec/tulip/tulip_core.c: strcpy(dev->name, "eth%d"); /* un-hack */ intel/ixgbe/ixgbe_main.c: strcpy(netdev->name, "eth%d"); intel/ixgbevf/ixgbevf_main.c: strcpy(netdev->name, "eth%d"); intel/e100.c: strcpy(netdev->name, "eth%d"); intel/igbvf/netdev.c: strcpy(netdev->name, "eth%d"); intel/e1000e/netdev.c: strscpy(netdev->name, "eth%d", sizeof(netdev->name)); intel/igb/igb_main.c: strcpy(netdev->name, "eth%d"); intel/igc/igc_main.c: strscpy(netdev->name, "eth%d", sizeof(netdev->name)); intel/e1000/e1000_main.c: strcpy(netdev->name, "eth%d"); lantiq_etop.c: strcpy(dev->name, "eth%d"); micrel/ks8842.c: strcpy(netdev->name, "eth%d"); smsc/smc9194.c: sprintf(dev->name, "eth%d", unit); maybe you can remove all these as well? Andrew ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH net-next v2] net: ethernet: lantiq_etop: remove redundant device name setup 2024-07-13 18:02 ` Andrew Lunn @ 2024-07-15 14:03 ` Jakub Kicinski 2024-07-15 16:55 ` Aleksander Jan Bajkowski 1 sibling, 0 replies; 5+ messages in thread From: Jakub Kicinski @ 2024-07-15 14:03 UTC (permalink / raw) To: Aleksander Jan Bajkowski Cc: Andrew Lunn, davem, edumazet, pabeni, jacob.e.keller, horms, u.kleine-koenig, netdev, linux-kernel On Sat, 13 Jul 2024 20:02:49 +0200 Andrew Lunn wrote: > maybe you can remove all these as well? +1 seems like a good cleanup (after the merge window is over) ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH net-next v2] net: ethernet: lantiq_etop: remove redundant device name setup 2024-07-13 18:02 ` Andrew Lunn 2024-07-15 14:03 ` Jakub Kicinski @ 2024-07-15 16:55 ` Aleksander Jan Bajkowski 1 sibling, 0 replies; 5+ messages in thread From: Aleksander Jan Bajkowski @ 2024-07-15 16:55 UTC (permalink / raw) To: Andrew Lunn Cc: davem, edumazet, kuba, pabeni, jacob.e.keller, horms, u.kleine-koenig, netdev, linux-kernel On 13.07.2024 20:02, Andrew Lunn wrote: > On Sat, Jul 13, 2024 at 07:09:20PM +0200, Aleksander Jan Bajkowski wrote: >> 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. > If this one is not needed: > > grep -r "eth%d" * > 3com/3c515.c: sprintf(dev->name, "eth%d", unit); > 8390/smc-ultra.c: sprintf(dev->name, "eth%d", unit); > 8390/wd.c: sprintf(dev->name, "eth%d", unit); > 8390/ne.c: sprintf(dev->name, "eth%d", unit); > amd/lance.c: sprintf(dev->name, "eth%d", unit); > atheros/atlx/atl2.c: strcpy(netdev->name, "eth%d"); /* ?? */ > cirrus/cs89x0.c: sprintf(dev->name, "eth%d", unit); > dec/tulip/tulip_core.c: strcpy(dev->name, "eth%d"); /* un-hack */ > intel/ixgbe/ixgbe_main.c: strcpy(netdev->name, "eth%d"); > intel/ixgbevf/ixgbevf_main.c: strcpy(netdev->name, "eth%d"); > intel/e100.c: strcpy(netdev->name, "eth%d"); > intel/igbvf/netdev.c: strcpy(netdev->name, "eth%d"); > intel/e1000e/netdev.c: strscpy(netdev->name, "eth%d", sizeof(netdev->name)); > intel/igb/igb_main.c: strcpy(netdev->name, "eth%d"); > intel/igc/igc_main.c: strscpy(netdev->name, "eth%d", sizeof(netdev->name)); > intel/e1000/e1000_main.c: strcpy(netdev->name, "eth%d"); > lantiq_etop.c: strcpy(dev->name, "eth%d"); > micrel/ks8842.c: strcpy(netdev->name, "eth%d"); > smsc/smc9194.c: sprintf(dev->name, "eth%d", unit); > > maybe you can remove all these as well? Added to my todo list. > Andrew ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH net-next v2] net: ethernet: lantiq_etop: remove redundant device name setup 2024-07-13 17:09 [PATCH net-next v2] net: ethernet: lantiq_etop: remove redundant device name setup Aleksander Jan Bajkowski 2024-07-13 18:02 ` Andrew Lunn @ 2024-07-15 14:10 ` patchwork-bot+netdevbpf 1 sibling, 0 replies; 5+ messages in thread From: patchwork-bot+netdevbpf @ 2024-07-15 14:10 UTC (permalink / raw) To: Aleksander Jan Bajkowski Cc: davem, edumazet, kuba, pabeni, jacob.e.keller, horms, u.kleine-koenig, netdev, linux-kernel Hello: This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <kuba@kernel.org>: On Sat, 13 Jul 2024 19:09:20 +0200 you wrote: > 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"); > > [...] Here is the summary with links: - [net-next,v2] net: ethernet: lantiq_etop: remove redundant device name setup https://git.kernel.org/netdev/net-next/c/9283477e2891 You are awesome, thank you! -- Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2024-07-15 16:55 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2024-07-13 17:09 [PATCH net-next v2] net: ethernet: lantiq_etop: remove redundant device name setup Aleksander Jan Bajkowski 2024-07-13 18:02 ` Andrew Lunn 2024-07-15 14:03 ` Jakub Kicinski 2024-07-15 16:55 ` Aleksander Jan Bajkowski 2024-07-15 14:10 ` patchwork-bot+netdevbpf
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.