staging: rts5208: fix gcc-8 logic error warning
authorArnd Bergmann <arnd@arndb.de>
Tue, 5 Sep 2017 07:33:32 +0000 (09:33 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 8 Dec 2018 12:05:05 +0000 (13:05 +0100)
commit 58930cced012adb01bc78b3687049b17ef44d0a3 upstream.

As gcc-8 points out, the bit mask check makes no sense here:

drivers/staging/rts5208/sd.c: In function 'ext_sd_send_cmd_get_rsp':
drivers/staging/rts5208/sd.c:4130:25: error: bitwise comparison always evaluates to true [-Werror=tautological-compare]

However, the code is even more bogus, as we have already
checked for the SD_RSP_TYPE_R0 case earlier in the function
and returned success. As seen in the mmc/sd driver core,
SD_RSP_TYPE_R0 means "no response" anyway, so checking for
a particular response would not help either.

This just removes the nonsensical code to get rid of the
warning.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rts5208/sd.c

index 9e63bdf2afe7bb1d4fcea8cc323dea82aea76fb2..4e233f3e721592d438c8784a0c9df4e9585b7178 100644 (file)
@@ -4110,12 +4110,6 @@ int ext_sd_send_cmd_get_rsp(struct rtsx_chip *chip, u8 cmd_idx,
                                        rtsx_trace(chip);
                                        return STATUS_FAIL;
                                }
-
-                       } else if (rsp_type == SD_RSP_TYPE_R0) {
-                               if ((ptr[3] & 0x1E) != 0x03) {
-                                       rtsx_trace(chip);
-                                       return STATUS_FAIL;
-                               }
                        }
                }
        }