* Re: [PATCH net-next] ethtool: remove set but not used variable 'lsettings'
@ 2020-01-03 7:39 ` Michal Kubecek
0 siblings, 0 replies; 10+ messages in thread
From: Michal Kubecek @ 2020-01-03 7:39 UTC (permalink / raw)
To: netdev
Cc: YueHaibing, David S . Miller, Florian Fainelli, kernel-janitors,
Hulk Robot
On Fri, Jan 03, 2020 at 03:48:56AM +0000, YueHaibing wrote:
> 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>
> ---
> net/ethtool/linkmodes.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/net/ethtool/linkmodes.c b/net/ethtool/linkmodes.c
> index 0b99f494ad3b..96f20be64553 100644
> --- a/net/ethtool/linkmodes.c
> +++ b/net/ethtool/linkmodes.c
> @@ -323,7 +323,6 @@ int ethnl_set_linkmodes(struct sk_buff *skb, struct genl_info *info)
> {
> struct nlattr *tb[ETHTOOL_A_LINKMODES_MAX + 1];
> struct ethtool_link_ksettings ksettings = {};
> - struct ethtool_link_settings *lsettings;
> struct ethnl_req_info req_info = {};
> struct net_device *dev;
> bool mod = false;
> @@ -354,7 +353,6 @@ int ethnl_set_linkmodes(struct sk_buff *skb, struct genl_info *info)
> GENL_SET_ERR_MSG(info, "failed to retrieve link settings");
> goto out_ops;
> }
> - lsettings = &ksettings.base;
>
> ret = ethnl_update_linkmodes(info, tb, &ksettings, &mod);
> if (ret < 0)
Reviewed-by: Michal Kubecek <mkubecek@suse.cz>
Thank you. I wonder why my compiler does not complain.
Michal
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: [PATCH net-next] ethtool: remove set but not used variable 'lsettings'
2020-01-03 7:39 ` Michal Kubecek
@ 2020-01-03 8:25 ` Yuehaibing
-1 siblings, 0 replies; 10+ messages in thread
From: Yuehaibing @ 2020-01-03 8:25 UTC (permalink / raw)
To: Michal Kubecek, netdev
Cc: David S . Miller, Florian Fainelli, kernel-janitors, Hulk Robot
On 2020/1/3 15:39, Michal Kubecek wrote:
> On Fri, Jan 03, 2020 at 03:48:56AM +0000, YueHaibing wrote:
>> 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>
>> ---
>> net/ethtool/linkmodes.c | 2 --
>> 1 file changed, 2 deletions(-)
>>
>> diff --git a/net/ethtool/linkmodes.c b/net/ethtool/linkmodes.c
>> index 0b99f494ad3b..96f20be64553 100644
>> --- a/net/ethtool/linkmodes.c
>> +++ b/net/ethtool/linkmodes.c
>> @@ -323,7 +323,6 @@ int ethnl_set_linkmodes(struct sk_buff *skb, struct genl_info *info)
>> {
>> struct nlattr *tb[ETHTOOL_A_LINKMODES_MAX + 1];
>> struct ethtool_link_ksettings ksettings = {};
>> - struct ethtool_link_settings *lsettings;
>> struct ethnl_req_info req_info = {};
>> struct net_device *dev;
>> bool mod = false;
>> @@ -354,7 +353,6 @@ int ethnl_set_linkmodes(struct sk_buff *skb, struct genl_info *info)
>> GENL_SET_ERR_MSG(info, "failed to retrieve link settings");
>> goto out_ops;
>> }
>> - lsettings = &ksettings.base;
>>
>> ret = ethnl_update_linkmodes(info, tb, &ksettings, &mod);
>> if (ret < 0)
>
> Reviewed-by: Michal Kubecek <mkubecek@suse.cz>
>
> Thank you. I wonder why my compiler does not complain.
Using make W=1
>
> Michal
>
> .
>
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: [PATCH net-next] ethtool: remove set but not used variable 'lsettings'
@ 2020-01-03 8:25 ` Yuehaibing
0 siblings, 0 replies; 10+ messages in thread
From: Yuehaibing @ 2020-01-03 8:25 UTC (permalink / raw)
To: Michal Kubecek, netdev
Cc: David S . Miller, Florian Fainelli, kernel-janitors, Hulk Robot
On 2020/1/3 15:39, Michal Kubecek wrote:
> On Fri, Jan 03, 2020 at 03:48:56AM +0000, YueHaibing wrote:
>> 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>
>> ---
>> net/ethtool/linkmodes.c | 2 --
>> 1 file changed, 2 deletions(-)
>>
>> diff --git a/net/ethtool/linkmodes.c b/net/ethtool/linkmodes.c
>> index 0b99f494ad3b..96f20be64553 100644
>> --- a/net/ethtool/linkmodes.c
>> +++ b/net/ethtool/linkmodes.c
>> @@ -323,7 +323,6 @@ int ethnl_set_linkmodes(struct sk_buff *skb, struct genl_info *info)
>> {
>> struct nlattr *tb[ETHTOOL_A_LINKMODES_MAX + 1];
>> struct ethtool_link_ksettings ksettings = {};
>> - struct ethtool_link_settings *lsettings;
>> struct ethnl_req_info req_info = {};
>> struct net_device *dev;
>> bool mod = false;
>> @@ -354,7 +353,6 @@ int ethnl_set_linkmodes(struct sk_buff *skb, struct genl_info *info)
>> GENL_SET_ERR_MSG(info, "failed to retrieve link settings");
>> goto out_ops;
>> }
>> - lsettings = &ksettings.base;
>>
>> ret = ethnl_update_linkmodes(info, tb, &ksettings, &mod);
>> if (ret < 0)
>
> Reviewed-by: Michal Kubecek <mkubecek@suse.cz>
>
> Thank you. I wonder why my compiler does not complain.
Using make W=1
>
> Michal
>
> .
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH net-next] ethtool: remove set but not used variable 'lsettings'
2020-01-03 7:39 ` Michal Kubecek
@ 2020-01-03 20:22 ` David Miller
-1 siblings, 0 replies; 10+ messages in thread
From: David Miller @ 2020-01-03 20:22 UTC (permalink / raw)
To: mkubecek; +Cc: netdev, yuehaibing, f.fainelli, kernel-janitors, hulkci
From: Michal Kubecek <mkubecek@suse.cz>
Date: Fri, 3 Jan 2020 08:39:23 +0100
> On Fri, Jan 03, 2020 at 03:48:56AM +0000, YueHaibing wrote:
>> 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>
>> ---
>> net/ethtool/linkmodes.c | 2 --
>> 1 file changed, 2 deletions(-)
>>
>> diff --git a/net/ethtool/linkmodes.c b/net/ethtool/linkmodes.c
>> index 0b99f494ad3b..96f20be64553 100644
>> --- a/net/ethtool/linkmodes.c
>> +++ b/net/ethtool/linkmodes.c
>> @@ -323,7 +323,6 @@ int ethnl_set_linkmodes(struct sk_buff *skb, struct genl_info *info)
>> {
>> struct nlattr *tb[ETHTOOL_A_LINKMODES_MAX + 1];
>> struct ethtool_link_ksettings ksettings = {};
>> - struct ethtool_link_settings *lsettings;
>> struct ethnl_req_info req_info = {};
>> struct net_device *dev;
>> bool mod = false;
>> @@ -354,7 +353,6 @@ int ethnl_set_linkmodes(struct sk_buff *skb, struct genl_info *info)
>> GENL_SET_ERR_MSG(info, "failed to retrieve link settings");
>> goto out_ops;
>> }
>> - lsettings = &ksettings.base;
>>
>> ret = ethnl_update_linkmodes(info, tb, &ksettings, &mod);
>> if (ret < 0)
>
> Reviewed-by: Michal Kubecek <mkubecek@suse.cz>
Applied, thanks.
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: [PATCH net-next] ethtool: remove set but not used variable 'lsettings'
@ 2020-01-03 20:22 ` David Miller
0 siblings, 0 replies; 10+ messages in thread
From: David Miller @ 2020-01-03 20:22 UTC (permalink / raw)
To: mkubecek; +Cc: netdev, yuehaibing, f.fainelli, kernel-janitors, hulkci
From: Michal Kubecek <mkubecek@suse.cz>
Date: Fri, 3 Jan 2020 08:39:23 +0100
> On Fri, Jan 03, 2020 at 03:48:56AM +0000, YueHaibing wrote:
>> 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>
>> ---
>> net/ethtool/linkmodes.c | 2 --
>> 1 file changed, 2 deletions(-)
>>
>> diff --git a/net/ethtool/linkmodes.c b/net/ethtool/linkmodes.c
>> index 0b99f494ad3b..96f20be64553 100644
>> --- a/net/ethtool/linkmodes.c
>> +++ b/net/ethtool/linkmodes.c
>> @@ -323,7 +323,6 @@ int ethnl_set_linkmodes(struct sk_buff *skb, struct genl_info *info)
>> {
>> struct nlattr *tb[ETHTOOL_A_LINKMODES_MAX + 1];
>> struct ethtool_link_ksettings ksettings = {};
>> - struct ethtool_link_settings *lsettings;
>> struct ethnl_req_info req_info = {};
>> struct net_device *dev;
>> bool mod = false;
>> @@ -354,7 +353,6 @@ int ethnl_set_linkmodes(struct sk_buff *skb, struct genl_info *info)
>> GENL_SET_ERR_MSG(info, "failed to retrieve link settings");
>> goto out_ops;
>> }
>> - lsettings = &ksettings.base;
>>
>> ret = ethnl_update_linkmodes(info, tb, &ksettings, &mod);
>> if (ret < 0)
>
> Reviewed-by: Michal Kubecek <mkubecek@suse.cz>
Applied, thanks.
^ permalink raw reply [flat|nested] 10+ messages in thread