From: walter harms <wharms@bfs.de>
To: Colin King <colin.king@canonical.com>
Cc: Krzysztof Halasa <khc@pm.waw.pl>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] wan: wanxl: remove redundant assignment to stat
Date: Wed, 01 Nov 2017 10:50:21 +0000 [thread overview]
Message-ID: <59F9A6ED.7060301@bfs.de> (raw)
In-Reply-To: <20171101084945.14653-1-colin.king@canonical.com>
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
WARNING: multiple messages have this Message-ID (diff)
From: walter harms <wharms@bfs.de>
To: Colin King <colin.king@canonical.com>
Cc: Krzysztof Halasa <khc@pm.waw.pl>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] wan: wanxl: remove redundant assignment to stat
Date: Wed, 01 Nov 2017 11:50:21 +0100 [thread overview]
Message-ID: <59F9A6ED.7060301@bfs.de> (raw)
In-Reply-To: <20171101084945.14653-1-colin.king@canonical.com>
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
next prev parent reply other threads:[~2017-11-01 10:50 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-01 8:49 [PATCH] wan: wanxl: remove redundant assignment to stat Colin King
2017-11-01 8:49 ` Colin King
2017-11-01 10:50 ` walter harms [this message]
2017-11-01 10:50 ` walter harms
2017-11-02 6:49 ` David Miller
2017-11-02 6:49 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=59F9A6ED.7060301@bfs.de \
--to=wharms@bfs.de \
--cc=colin.king@canonical.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=khc@pm.waw.pl \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.