]> Git Repo - linux.git/commitdiff
cdrom: Remove redundant variable and its assignment
authorluo penghao <[email protected]>
Thu, 21 Oct 2021 07:46:21 +0000 (08:46 +0100)
committerJens Axboe <[email protected]>
Thu, 21 Oct 2021 14:23:09 +0000 (08:23 -0600)
Variable is not used in functions, and its assignment is redundant too.
So it should be deleted. Also the inner-most set of parentheses is no
longer needed.

The clang_analyzer complains as follows:

drivers/cdrom/cdrom.c:877: warning:

Although the value stored to 'ret' is used in the enclosing expression,
the value is never actually read from 'ret'.

Reported-by: Zeal Robot <[email protected]>
Signed-off-by: luo penghao <[email protected]>
Link: https://lore.kernel.org/all/[email protected]
Signed-off-by: Phillip Potter <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jens Axboe <[email protected]>
drivers/cdrom/cdrom.c

index 89a68457820ab8b8a093664937dff11348317686..9877e413fce39da5d335d2a9c8678d32f22e4368 100644 (file)
@@ -871,7 +871,7 @@ static void cdrom_mmc3_profile(struct cdrom_device_info *cdi)
 {
        struct packet_command cgc;
        char buffer[32];
-       int ret, mmc3_profile;
+       int mmc3_profile;
 
        init_cdrom_command(&cgc, buffer, sizeof(buffer), CGC_DATA_READ);
 
@@ -881,7 +881,7 @@ static void cdrom_mmc3_profile(struct cdrom_device_info *cdi)
        cgc.cmd[8] = sizeof(buffer);            /* Allocation Length */
        cgc.quiet = 1;
 
-       if ((ret = cdi->ops->generic_packet(cdi, &cgc)))
+       if (cdi->ops->generic_packet(cdi, &cgc))
                mmc3_profile = 0xffff;
        else
                mmc3_profile = (buffer[6] << 8) | buffer[7];
This page took 0.059685 seconds and 4 git commands to generate.