Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ethtool: remove set but not used variable 'lsettings'

Fixes gcc '-Wunused-but-set-variable' warning:

net/ethtool/linkmodes.c: In function 'ethnl_set_linkmodes':
net/ethtool/linkmodes.c:326:32: warning:
variable 'lsettings' set but not used [-Wunused-but-set-variable]
struct ethtool_link_settings *lsettings;
^
It is never used, so remove it.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Reviewed-by: Michal Kubecek <mkubecek@suse.cz>
Reviewed-by: Simon Horman <simon.horman@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

YueHaibing and committed by
David S. Miller
4a883ccf d0e8bcaf

-2
-2
net/ethtool/linkmodes.c
··· 323 323 { 324 324 struct nlattr *tb[ETHTOOL_A_LINKMODES_MAX + 1]; 325 325 struct ethtool_link_ksettings ksettings = {}; 326 - struct ethtool_link_settings *lsettings; 327 326 struct ethnl_req_info req_info = {}; 328 327 struct net_device *dev; 329 328 bool mod = false; ··· 353 354 GENL_SET_ERR_MSG(info, "failed to retrieve link settings"); 354 355 goto out_ops; 355 356 } 356 - lsettings = &ksettings.base; 357 357 358 358 ret = ethnl_update_linkmodes(info, tb, &ksettings, &mod); 359 359 if (ret < 0)