From: Jiri Pirko Date: Fri, 26 Aug 2022 11:04:11 +0000 (+0200) Subject: funeth: remove pointless check of devlink pointer in create/destroy_netdev() flows X-Git-Tag: v6.1-rc5~319^2~308 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4f99de7b181f926a3f8d71fec74fd80e2ee8d9c2;p=platform%2Fkernel%2Flinux-starfive.git funeth: remove pointless check of devlink pointer in create/destroy_netdev() flows Once devlink port is successfully registered, the devlink pointer is not NULL. Therefore, the check is going to be always true and therefore pointless. Remove it. Signed-off-by: Jiri Pirko Acked-by: Dimitris Michailidis Link: https://lore.kernel.org/r/20220826110411.1409446-1-jiri@resnulli.us Signed-off-by: Jakub Kicinski --- diff --git a/drivers/net/ethernet/fungible/funeth/funeth_main.c b/drivers/net/ethernet/fungible/funeth/funeth_main.c index f247b7ad3a88..b6de2ad82a32 100644 --- a/drivers/net/ethernet/fungible/funeth/funeth_main.c +++ b/drivers/net/ethernet/fungible/funeth/funeth_main.c @@ -1802,16 +1802,14 @@ static int fun_create_netdev(struct fun_ethdev *ed, unsigned int portid) if (rc) goto unreg_devlink; - if (fp->dl_port.devlink) - devlink_port_type_eth_set(&fp->dl_port, netdev); + devlink_port_type_eth_set(&fp->dl_port, netdev); return 0; unreg_devlink: ed->netdevs[portid] = NULL; fun_ktls_cleanup(fp); - if (fp->dl_port.devlink) - devlink_port_unregister(&fp->dl_port); + devlink_port_unregister(&fp->dl_port); free_stats: fun_free_stats_area(fp); free_rss: @@ -1830,10 +1828,8 @@ static void fun_destroy_netdev(struct net_device *netdev) struct funeth_priv *fp; fp = netdev_priv(netdev); - if (fp->dl_port.devlink) { - devlink_port_type_clear(&fp->dl_port); - devlink_port_unregister(&fp->dl_port); - } + devlink_port_type_clear(&fp->dl_port); + devlink_port_unregister(&fp->dl_port); unregister_netdev(netdev); fun_ktls_cleanup(fp); fun_free_stats_area(fp);