[PATCH 13/23] hw/sd/sdcard: Have cmd_valid_while_locked() return a boolean value

Philippe Mathieu-Daudé posted 23 patches 5 months ago
Maintainers: "Philippe Mathieu-Daudé" <philmd@linaro.org>, Bin Meng <bmeng.cn@gmail.com>
There is a newer version of this series
[PATCH 13/23] hw/sd/sdcard: Have cmd_valid_while_locked() return a boolean value
Posted by Philippe Mathieu-Daudé 5 months ago
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 hw/sd/sd.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index c6cc1bab11..510784fc82 100644
--- a/hw/sd/sd.c
+++ b/hw/sd/sd.c
@@ -1716,7 +1716,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)
@@ -1730,7 +1730,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;
 }
-- 
2.41.0


Re: [PATCH 13/23] hw/sd/sdcard: Have cmd_valid_while_locked() return a boolean value
Posted by Cédric Le Goater 5 months ago
On 6/21/24 10:05 AM, Philippe Mathieu-Daudé wrote:
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>


Reviewed-by: Cédric Le Goater <clg@redhat.com>

Thanks,

C.


> ---
>   hw/sd/sd.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/hw/sd/sd.c b/hw/sd/sd.c
> index c6cc1bab11..510784fc82 100644
> --- a/hw/sd/sd.c
> +++ b/hw/sd/sd.c
> @@ -1716,7 +1716,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)
> @@ -1730,7 +1730,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;
>   }