linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: toshiba: remove a redundant local variable 'index_specified'
@ 2018-09-20  1:56 zhong jiang
  2018-09-20  6:09 ` David Miller
  2018-09-20 10:23 ` Sergei Shtylyov
  0 siblings, 2 replies; 4+ messages in thread
From: zhong jiang @ 2018-09-20  1:56 UTC (permalink / raw)
  To: davem; +Cc: benh, paulus, mpe, netdev, linux-kernel

The local variable 'index_specified' is never used after being assigned.
hence it should be redundant adn can be removed.

Signed-off-by: zhong jiang <zhongjiang@huawei.com>
---
 drivers/net/ethernet/toshiba/ps3_gelic_wireless.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/net/ethernet/toshiba/ps3_gelic_wireless.c b/drivers/net/ethernet/toshiba/ps3_gelic_wireless.c
index 302079e..00ab417 100644
--- a/drivers/net/ethernet/toshiba/ps3_gelic_wireless.c
+++ b/drivers/net/ethernet/toshiba/ps3_gelic_wireless.c
@@ -1094,7 +1094,7 @@ static int gelic_wl_get_encode(struct net_device *netdev,
 	struct gelic_wl_info *wl = port_wl(netdev_priv(netdev));
 	struct iw_point *enc = &data->encoding;
 	unsigned long irqflag;
-	unsigned int key_index, index_specified;
+	unsigned int key_index;
 	int ret = 0;
 
 	pr_debug("%s: <-\n", __func__);
@@ -1105,13 +1105,10 @@ static int gelic_wl_get_encode(struct net_device *netdev,
 		return -EINVAL;
 
 	spin_lock_irqsave(&wl->lock, irqflag);
-	if (key_index) {
-		index_specified = 1;
+	if (key_index)
 		key_index--;
-	} else {
-		index_specified = 0;
+	else
 		key_index = wl->current_key;
-	}
 
 	if (wl->group_cipher_method == GELIC_WL_CIPHER_WEP) {
 		switch (wl->auth_method) {
-- 
1.7.12.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] net: toshiba: remove a redundant local variable 'index_specified'
  2018-09-20  1:56 [PATCH] net: toshiba: remove a redundant local variable 'index_specified' zhong jiang
@ 2018-09-20  6:09 ` David Miller
  2018-09-20 10:23 ` Sergei Shtylyov
  1 sibling, 0 replies; 4+ messages in thread
From: David Miller @ 2018-09-20  6:09 UTC (permalink / raw)
  To: zhongjiang; +Cc: benh, paulus, mpe, netdev, linux-kernel

From: zhong jiang <zhongjiang@huawei.com>
Date: Thu, 20 Sep 2018 09:56:05 +0800

> The local variable 'index_specified' is never used after being assigned.
> hence it should be redundant adn can be removed.
> 
> Signed-off-by: zhong jiang <zhongjiang@huawei.com>

Applied.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] net: toshiba: remove a redundant local variable 'index_specified'
  2018-09-20  1:56 [PATCH] net: toshiba: remove a redundant local variable 'index_specified' zhong jiang
  2018-09-20  6:09 ` David Miller
@ 2018-09-20 10:23 ` Sergei Shtylyov
  2018-09-20 11:34   ` zhong jiang
  1 sibling, 1 reply; 4+ messages in thread
From: Sergei Shtylyov @ 2018-09-20 10:23 UTC (permalink / raw)
  To: zhong jiang, davem; +Cc: benh, paulus, mpe, netdev, linux-kernel

On 9/20/2018 4:56 AM, zhong jiang wrote:

> The local variable 'index_specified' is never used after being assigned.
> hence it should be redundant adn can be removed.

    s/adn/and/.

> Signed-off-by: zhong jiang <zhongjiang@huawei.com>
[...]

MBR, Sergei


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] net: toshiba: remove a redundant local variable 'index_specified'
  2018-09-20 10:23 ` Sergei Shtylyov
@ 2018-09-20 11:34   ` zhong jiang
  0 siblings, 0 replies; 4+ messages in thread
From: zhong jiang @ 2018-09-20 11:34 UTC (permalink / raw)
  To: Sergei Shtylyov; +Cc: davem, benh, paulus, mpe, netdev, linux-kernel

On 2018/9/20 18:23, Sergei Shtylyov wrote:
> On 9/20/2018 4:56 AM, zhong jiang wrote:
>
>> The local variable 'index_specified' is never used after being assigned.
>> hence it should be redundant adn can be removed.
>
>    s/adn/and/.
>
Spelling mistake.  Thanks, checkpatch.pl can not find this. :-[ . I will be appreaciated
that David help me correct that.

Sincerely,
zhong jiang
>> Signed-off-by: zhong jiang <zhongjiang@huawei.com>
> [...]
>
> MBR, Sergei
>
>
>



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-09-20 11:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-20  1:56 [PATCH] net: toshiba: remove a redundant local variable 'index_specified' zhong jiang
2018-09-20  6:09 ` David Miller
2018-09-20 10:23 ` Sergei Shtylyov
2018-09-20 11:34   ` zhong jiang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).