* [PATCH] cdrom: remove unused variable
@ 2022-04-01 21:18 Phillip Potter
2022-04-01 23:56 ` Jens Axboe
0 siblings, 1 reply; 4+ messages in thread
From: Phillip Potter @ 2022-04-01 21:18 UTC (permalink / raw)
To: axboe; +Cc: linux-block
From: Enze Li <lienze@kylinos.cn>
The clang static analyzer reports the following warning,
File: drivers/cdrom/cdrom.c
Warning: line 1380, column 7
Although the value stored to 'status' is used in enclosing
expression, the value is never actually read from 'status'
Remove the unused variable to eliminate the warning.
Signed-off-by: Enze Li <lienze@kylinos.cn>
Link: https://lore.kernel.org/all/20220401032623.293666-1-lienze@kylinos.cn
Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
---
drivers/cdrom/cdrom.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/cdrom/cdrom.c b/drivers/cdrom/cdrom.c
index 7bd10d63ddbe..2dc9da683a13 100644
--- a/drivers/cdrom/cdrom.c
+++ b/drivers/cdrom/cdrom.c
@@ -1365,7 +1365,6 @@ static int cdrom_slot_status(struct cdrom_device_info *cdi, int slot)
*/
int cdrom_number_of_slots(struct cdrom_device_info *cdi)
{
- int status;
int nslots = 1;
struct cdrom_changer_info *info;
@@ -1377,7 +1376,7 @@ int cdrom_number_of_slots(struct cdrom_device_info *cdi)
if (!info)
return -ENOMEM;
- if ((status = cdrom_read_mech_status(cdi, info)) == 0)
+ if (cdrom_read_mech_status(cdi, info) == 0)
nslots = info->hdr.nslots;
kfree(info);
--
2.35.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] cdrom: remove unused variable
2022-04-01 21:18 [PATCH] cdrom: remove unused variable Phillip Potter
@ 2022-04-01 23:56 ` Jens Axboe
0 siblings, 0 replies; 4+ messages in thread
From: Jens Axboe @ 2022-04-01 23:56 UTC (permalink / raw)
To: Phillip Potter; +Cc: linux-block
On Fri, 1 Apr 2022 22:18:42 +0100, Phillip Potter wrote:
> From: Enze Li <lienze@kylinos.cn>
>
> The clang static analyzer reports the following warning,
>
> File: drivers/cdrom/cdrom.c
> Warning: line 1380, column 7
> Although the value stored to 'status' is used in enclosing
> expression, the value is never actually read from 'status'
>
> [...]
Applied, thanks!
[1/1] cdrom: remove unused variable
commit: e9c1e280f2e18845d078a65378b897915d74d401
Best regards,
--
Jens Axboe
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] cdrom: remove unused variable
2022-04-01 3:26 Enze Li
@ 2022-04-01 21:00 ` Phillip Potter
0 siblings, 0 replies; 4+ messages in thread
From: Phillip Potter @ 2022-04-01 21:00 UTC (permalink / raw)
To: lienze; +Cc: nathan, ndesaulniers, linux-kernel, llvm, linux-block
> The clang static analyzer reports the following warning,
>
> File: drivers/cdrom/cdrom.c
> Warning: line 1380, column 7
> Although the value stored to 'status' is used in enclosing
> expression, the value is never actually read from 'status'
>
> Remove the unused variable to eliminate the warning.
>
> Signed-off-by: Enze Li <lienze@kylinos.cn>
> ---
> drivers/cdrom/cdrom.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
Looks good to me, thanks for the patch, will send on for inclusion in
5.18.
Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Regards,
Phil
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] cdrom: remove unused variable
@ 2022-04-01 3:26 Enze Li
2022-04-01 21:00 ` Phillip Potter
0 siblings, 1 reply; 4+ messages in thread
From: Enze Li @ 2022-04-01 3:26 UTC (permalink / raw)
To: phil, nathan, ndesaulniers; +Cc: linux-kernel, llvm
The clang static analyzer reports the following warning,
File: drivers/cdrom/cdrom.c
Warning: line 1380, column 7
Although the value stored to 'status' is used in enclosing
expression, the value is never actually read from 'status'
Remove the unused variable to eliminate the warning.
Signed-off-by: Enze Li <lienze@kylinos.cn>
---
drivers/cdrom/cdrom.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/cdrom/cdrom.c b/drivers/cdrom/cdrom.c
index 7bd10d63ddbe..2dc9da683a13 100644
--- a/drivers/cdrom/cdrom.c
+++ b/drivers/cdrom/cdrom.c
@@ -1365,7 +1365,6 @@ static int cdrom_slot_status(struct cdrom_device_info *cdi, int slot)
*/
int cdrom_number_of_slots(struct cdrom_device_info *cdi)
{
- int status;
int nslots = 1;
struct cdrom_changer_info *info;
@@ -1377,7 +1376,7 @@ int cdrom_number_of_slots(struct cdrom_device_info *cdi)
if (!info)
return -ENOMEM;
- if ((status = cdrom_read_mech_status(cdi, info)) == 0)
+ if (cdrom_read_mech_status(cdi, info) == 0)
nslots = info->hdr.nslots;
kfree(info);
--
2.25.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-04-01 23:56 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-01 21:18 [PATCH] cdrom: remove unused variable Phillip Potter
2022-04-01 23:56 ` Jens Axboe
-- strict thread matches above, loose matches on Subject: below --
2022-04-01 3:26 Enze Li
2022-04-01 21:00 ` Phillip Potter
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.