hw/sd/sdcard: Have cmd_valid_while_locked() return a boolean value
authorPhilippe Mathieu-Daudé <philmd@linaro.org>
Mon, 17 Jun 2024 03:28:51 +0000 (05:28 +0200)
committerPhilippe Mathieu-Daudé <philmd@linaro.org>
Mon, 24 Jun 2024 08:41:42 +0000 (10:41 +0200)
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Tested-by: Cédric Le Goater <clg@redhat.com>
Message-Id: <20240621080554.18986-14-philmd@linaro.org>

hw/sd/sd.c

index 44225bae9bfd8a404e56767c59aca1bb7809c175..04b141784b97a8eb2079e09f124bbe4a54275452 100644 (file)
@@ -1717,7 +1717,7 @@ static sd_rsp_type_t sd_app_command(SDState *sd,
     return sd_illegal;
 }
 
-static int cmd_valid_while_locked(SDState *sd, const uint8_t cmd)
+static bool cmd_valid_while_locked(SDState *sd, unsigned cmd)
 {
     /* Valid commands in locked state:
      * basic class (0)
@@ -1731,7 +1731,7 @@ static int cmd_valid_while_locked(SDState *sd, const uint8_t cmd)
         return cmd == 41 || cmd == 42;
     }
     if (cmd == 16 || cmd == 55) {
-        return 1;
+        return true;
     }
     return sd_cmd_class[cmd] == 0 || sd_cmd_class[cmd] == 7;
 }