* [PATCH] ssb: Remove redundant assignment to err
@ 2021-04-29 10:47 Yang Li
2021-04-29 17:21 ` Michael Büsch
2021-06-15 10:10 ` Kalle Valo
0 siblings, 2 replies; 3+ messages in thread
From: Yang Li @ 2021-04-29 10:47 UTC (permalink / raw)
To: m
Cc: nathan, ndesaulniers, linux-wireless, linux-kernel,
clang-built-linux, Yang Li
Variable 'err' is set to zero but this value is never read as it is
overwritten with a new value later on, hence it is a redundant
assignment and can be removed.
Clean up the following clang-analyzer warning:
drivers/ssb/main.c:1306:3: warning: Value stored to 'err' is never read
[clang-analyzer-deadcode.DeadStores]
drivers/ssb/main.c:1312:3: warning: Value stored to 'err' is never read
[clang-analyzer-deadcode.DeadStores]
Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
---
drivers/ssb/main.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/ssb/main.c b/drivers/ssb/main.c
index 0a26984..ab23554 100644
--- a/drivers/ssb/main.c
+++ b/drivers/ssb/main.c
@@ -1303,13 +1303,11 @@ static int __init ssb_modinit(void)
if (err) {
pr_err("Broadcom 43xx PCI-SSB-bridge initialization failed\n");
/* don't fail SSB init because of this */
- err = 0;
}
err = ssb_host_pcmcia_init();
if (err) {
pr_err("PCMCIA host initialization failed\n");
/* don't fail SSB init because of this */
- err = 0;
}
err = ssb_gige_init();
if (err) {
--
1.8.3.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] ssb: Remove redundant assignment to err
2021-04-29 10:47 [PATCH] ssb: Remove redundant assignment to err Yang Li
@ 2021-04-29 17:21 ` Michael Büsch
2021-06-15 10:10 ` Kalle Valo
1 sibling, 0 replies; 3+ messages in thread
From: Michael Büsch @ 2021-04-29 17:21 UTC (permalink / raw)
To: Yang Li
Cc: nathan, ndesaulniers, linux-wireless, linux-kernel, clang-built-linux
[-- Attachment #1: Type: text/plain, Size: 1537 bytes --]
On Thu, 29 Apr 2021 18:47:10 +0800
Yang Li <yang.lee@linux.alibaba.com> wrote:
> Variable 'err' is set to zero but this value is never read as it is
> overwritten with a new value later on, hence it is a redundant
> assignment and can be removed.
>
> Clean up the following clang-analyzer warning:
>
> drivers/ssb/main.c:1306:3: warning: Value stored to 'err' is never read
> [clang-analyzer-deadcode.DeadStores]
> drivers/ssb/main.c:1312:3: warning: Value stored to 'err' is never read
> [clang-analyzer-deadcode.DeadStores]
>
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
> ---
> drivers/ssb/main.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/drivers/ssb/main.c b/drivers/ssb/main.c
> index 0a26984..ab23554 100644
> --- a/drivers/ssb/main.c
> +++ b/drivers/ssb/main.c
> @@ -1303,13 +1303,11 @@ static int __init ssb_modinit(void)
> if (err) {
> pr_err("Broadcom 43xx PCI-SSB-bridge initialization failed\n");
> /* don't fail SSB init because of this */
> - err = 0;
> }
> err = ssb_host_pcmcia_init();
> if (err) {
> pr_err("PCMCIA host initialization failed\n");
> /* don't fail SSB init because of this */
> - err = 0;
> }
> err = ssb_gige_init();
> if (err) {
The assignment is there just as a visual guide to tell the reader that
we ignore the error.
However, there's also a comment that says the same thing. Therefore:
Acked-by: Michael Büsch <m@bues.ch>
--
Michael
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] ssb: Remove redundant assignment to err
2021-04-29 10:47 [PATCH] ssb: Remove redundant assignment to err Yang Li
2021-04-29 17:21 ` Michael Büsch
@ 2021-06-15 10:10 ` Kalle Valo
1 sibling, 0 replies; 3+ messages in thread
From: Kalle Valo @ 2021-06-15 10:10 UTC (permalink / raw)
To: Yang Li
Cc: m, nathan, ndesaulniers, linux-wireless, linux-kernel,
clang-built-linux, Yang Li
Yang Li <yang.lee@linux.alibaba.com> wrote:
> Variable 'err' is set to zero but this value is never read as it is
> overwritten with a new value later on, hence it is a redundant
> assignment and can be removed.
>
> Clean up the following clang-analyzer warning:
>
> drivers/ssb/main.c:1306:3: warning: Value stored to 'err' is never read
> [clang-analyzer-deadcode.DeadStores]
> drivers/ssb/main.c:1312:3: warning: Value stored to 'err' is never read
> [clang-analyzer-deadcode.DeadStores]
>
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
> Acked-by: Michael Büsch <m@bues.ch>
Patch applied to wireless-drivers-next.git, thanks.
7557dfde1bd1 ssb: Remove redundant assignment to err
--
https://patchwork.kernel.org/project/linux-wireless/patch/1619693230-108804-1-git-send-email-yang.lee@linux.alibaba.com/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-06-15 10:10 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-29 10:47 [PATCH] ssb: Remove redundant assignment to err Yang Li
2021-04-29 17:21 ` Michael Büsch
2021-06-15 10:10 ` Kalle Valo
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.