2018-01-05 15:31:12

by Colin King

[permalink] [raw]
Subject: [PATCH][scsi-next] scsi: aacraid: remove redundant setting of variable c

From: Colin Ian King <[email protected]>

A previous commit no longer stores the contents of c, so we now have
a situation where c is being updated but the value is never read. Clean
up the code by removing the now redundant setting of variable c.

Cleans up clang warning:
drivers/scsi/aacraid/aachba.c:943:3: warning: Value stored to 'c' is
never read

Fixes: f4e8708d3104 ("scsi: aacraid: Fix udev inquiry race condition")
Signed-off-by: Colin Ian King <[email protected]>
---
drivers/scsi/aacraid/aachba.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/scsi/aacraid/aachba.c b/drivers/scsi/aacraid/aachba.c
index a2bdd7931cf1..525d72fcbf3e 100644
--- a/drivers/scsi/aacraid/aachba.c
+++ b/drivers/scsi/aacraid/aachba.c
@@ -940,11 +940,8 @@ static void setinqstr(struct aac_dev *dev, void *data, int tindex)
while (*cp == ' ')
++cp;
/* last six chars reserved for vol type */
- c = 0;
- if (strlen(cp) > sizeof(str->pid)) {
- c = cp[sizeof(str->pid)];
+ if (strlen(cp) > sizeof(str->pid))
cp[sizeof(str->pid)] = '\0';
- }
inqstrcpy (cp, str->pid);

kfree(cname);
--
2.15.1


2018-01-05 16:42:39

by Raghava Aditya Renukunta

[permalink] [raw]
Subject: RE: [PATCH][scsi-next] scsi: aacraid: remove redundant setting of variable c


> -----Original Message-----
> From: Colin King [mailto:[email protected]]
> Sent: Friday, January 5, 2018 7:31 AM
> To: dl-esc-Aacraid Linux Driver <[email protected]>; James E . J .
> Bottomley <[email protected]>; Martin K . Petersen
> <[email protected]>; [email protected]
> Cc: [email protected]; [email protected]
> Subject: [PATCH][scsi-next] scsi: aacraid: remove redundant setting of
> variable c
>
> EXTERNAL EMAIL
>
>
> From: Colin Ian King <[email protected]>
>
> A previous commit no longer stores the contents of c, so we now have
> a situation where c is being updated but the value is never read. Clean
> up the code by removing the now redundant setting of variable c.
>
> Cleans up clang warning:
> drivers/scsi/aacraid/aachba.c:943:3: warning: Value stored to 'c' is
> never read
>
> Fixes: f4e8708d3104 ("scsi: aacraid: Fix udev inquiry race condition")
> Signed-off-by: Colin Ian King <[email protected]>
> ---
Reviewed-by :Raghava Aditya Renukunta <[email protected]>

2018-01-09 02:51:11

by Martin K. Petersen

[permalink] [raw]
Subject: Re: [PATCH][scsi-next] scsi: aacraid: remove redundant setting of variable c


Colin,

> A previous commit no longer stores the contents of c, so we now have a
> situation where c is being updated but the value is never read. Clean
> up the code by removing the now redundant setting of variable c.

Applied to 4.16/scsi-queue. Thanks!

--
Martin K. Petersen Oracle Linux Engineering