* [PATCH] amd64-agp: remove redundant assignment to variable i
@ 2022-03-18 0:00 Colin Ian King
2022-04-04 18:09 ` Nick Desaulniers
0 siblings, 1 reply; 2+ messages in thread
From: Colin Ian King @ 2022-03-18 0:00 UTC (permalink / raw)
To: David Airlie; +Cc: kernel-janitors, linux-kernel, llvm
Variable i is being assigned a value that is never read, it is being
re-assigned later in a for-loop. The assignment is redundant and can
be removed.
Cleans up clang scan build warning:
drivers/char/agp/amd64-agp.c:336:2: warning: Value stored to 'i' is
never read [deadcode.DeadStores]
Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
drivers/char/agp/amd64-agp.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/char/agp/amd64-agp.c b/drivers/char/agp/amd64-agp.c
index dc78a4fb879e..5f64991c73bf 100644
--- a/drivers/char/agp/amd64-agp.c
+++ b/drivers/char/agp/amd64-agp.c
@@ -333,7 +333,6 @@ static int cache_nbs(struct pci_dev *pdev, u32 cap_ptr)
if (!amd_nb_has_feature(AMD_NB_GART))
return -ENODEV;
- i = 0;
for (i = 0; i < amd_nb_num(); i++) {
struct pci_dev *dev = node_to_amd_nb(i)->misc;
if (fix_northbridge(dev, pdev, cap_ptr) < 0) {
--
2.35.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] amd64-agp: remove redundant assignment to variable i
2022-03-18 0:00 [PATCH] amd64-agp: remove redundant assignment to variable i Colin Ian King
@ 2022-04-04 18:09 ` Nick Desaulniers
0 siblings, 0 replies; 2+ messages in thread
From: Nick Desaulniers @ 2022-04-04 18:09 UTC (permalink / raw)
To: Colin Ian King; +Cc: David Airlie, kernel-janitors, linux-kernel, llvm
On Thu, Mar 17, 2022 at 5:01 PM Colin Ian King <colin.i.king@gmail.com> wrote:
>
> Variable i is being assigned a value that is never read, it is being
> re-assigned later in a for-loop. The assignment is redundant and can
> be removed.
>
> Cleans up clang scan build warning:
> drivers/char/agp/amd64-agp.c:336:2: warning: Value stored to 'i' is
> never read [deadcode.DeadStores]
>
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Thanks for the patch!
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
> ---
> drivers/char/agp/amd64-agp.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/drivers/char/agp/amd64-agp.c b/drivers/char/agp/amd64-agp.c
> index dc78a4fb879e..5f64991c73bf 100644
> --- a/drivers/char/agp/amd64-agp.c
> +++ b/drivers/char/agp/amd64-agp.c
> @@ -333,7 +333,6 @@ static int cache_nbs(struct pci_dev *pdev, u32 cap_ptr)
> if (!amd_nb_has_feature(AMD_NB_GART))
> return -ENODEV;
>
> - i = 0;
> for (i = 0; i < amd_nb_num(); i++) {
> struct pci_dev *dev = node_to_amd_nb(i)->misc;
> if (fix_northbridge(dev, pdev, cap_ptr) < 0) {
> --
> 2.35.1
>
>
--
Thanks,
~Nick Desaulniers
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-04-04 18:09 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-18 0:00 [PATCH] amd64-agp: remove redundant assignment to variable i Colin Ian King
2022-04-04 18:09 ` Nick Desaulniers
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.