* [PATCH] wan: wanxl: remove redundant assignment to stat
@ 2017-11-01 8:49 Colin King
2017-11-01 10:50 ` walter harms
2017-11-02 6:49 ` David Miller
0 siblings, 2 replies; 3+ messages in thread
From: Colin King @ 2017-11-01 8:49 UTC (permalink / raw)
To: Krzysztof Halasa, netdev, linux-kernel; +Cc: kernel-janitors
From: Colin Ian King <colin.king@canonical.com>
stat set to zero and the value is never read, instead stat is
set again in the do-loop. Hence the setting to zero is redundant
and can be removed. Cleans up clang warning:
drivers/net/wan/wanxl.c:737:2: warning: Value stored to 'stat'
is never read
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
drivers/net/wan/wanxl.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/net/wan/wanxl.c b/drivers/net/wan/wanxl.c
index 0c7317520ed3..d573a57bc301 100644
--- a/drivers/net/wan/wanxl.c
+++ b/drivers/net/wan/wanxl.c
@@ -734,7 +734,6 @@ static int wanxl_pci_init_one(struct pci_dev *pdev,
return -ENODEV;
}
- stat = 0;
timeout = jiffies + 5 * HZ;
do {
if ((stat = readl(card->plx + PLX_MAILBOX_5)) != 0)
--
2.14.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] wan: wanxl: remove redundant assignment to stat
2017-11-01 8:49 [PATCH] wan: wanxl: remove redundant assignment to stat Colin King
@ 2017-11-01 10:50 ` walter harms
2017-11-02 6:49 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: walter harms @ 2017-11-01 10:50 UTC (permalink / raw)
To: Colin King; +Cc: Krzysztof Halasa, netdev, linux-kernel, kernel-janitors
Am 01.11.2017 09:49, schrieb Colin King:
> From: Colin Ian King <colin.king@canonical.com>
>
> stat set to zero and the value is never read, instead stat is
> set again in the do-loop. Hence the setting to zero is redundant
> and can be removed. Cleans up clang warning:
>
> drivers/net/wan/wanxl.c:737:2: warning: Value stored to 'stat'
> is never read
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
> drivers/net/wan/wanxl.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/drivers/net/wan/wanxl.c b/drivers/net/wan/wanxl.c
> index 0c7317520ed3..d573a57bc301 100644
> --- a/drivers/net/wan/wanxl.c
> +++ b/drivers/net/wan/wanxl.c
> @@ -734,7 +734,6 @@ static int wanxl_pci_init_one(struct pci_dev *pdev,
> return -ENODEV;
> }
>
> - stat = 0;
> timeout = jiffies + 5 * HZ;
> do {
> if ((stat = readl(card->plx + PLX_MAILBOX_5)) != 0)
it is std. practice to have the pattern:
a=b;
if (a == c) ...
maybe that can be done also here.
stat = readl(card->plx + PLX_MAILBOX_5);
if ( stat != 0)
just a hint.
re,
wh
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] wan: wanxl: remove redundant assignment to stat
2017-11-01 8:49 [PATCH] wan: wanxl: remove redundant assignment to stat Colin King
2017-11-01 10:50 ` walter harms
@ 2017-11-02 6:49 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2017-11-02 6:49 UTC (permalink / raw)
To: colin.king; +Cc: khc, netdev, linux-kernel, kernel-janitors
From: Colin King <colin.king@canonical.com>
Date: Wed, 1 Nov 2017 08:49:45 +0000
> From: Colin Ian King <colin.king@canonical.com>
>
> stat set to zero and the value is never read, instead stat is
> set again in the do-loop. Hence the setting to zero is redundant
> and can be removed. Cleans up clang warning:
>
> drivers/net/wan/wanxl.c:737:2: warning: Value stored to 'stat'
> is never read
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
Applied.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-11-02 6:49 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-01 8:49 [PATCH] wan: wanxl: remove redundant assignment to stat Colin King
2017-11-01 10:50 ` walter harms
2017-11-02 6:49 ` David Miller
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).