[PATCH v42 76/98] hw/sd/sdcard: Remove noise from sd_acmd_name()

Philippe Mathieu-Daudé posted 98 patches 6 months ago
There is a newer version of this series
[PATCH v42 76/98] hw/sd/sdcard: Remove noise from sd_acmd_name()
Posted by Philippe Mathieu-Daudé 6 months ago
These ACMD names weren't really useful, "UNKNOWN_ACMD" is simpler.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 hw/sd/sd.c | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)

diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index 7f93d363c7..19322c558f 100644
--- a/hw/sd/sd.c
+++ b/hw/sd/sd.c
@@ -259,23 +259,13 @@ static const char *sd_cmd_name(SDState *sd, uint8_t cmd)
 
 static const char *sd_acmd_name(SDState *sd, uint8_t cmd)
 {
-    static const char *acmd_abbrev[SDMMC_CMD_MAX] = {
-        [14] = "DPS_spec",                  [15] = "DPS_spec",
-        [16] = "DPS_spec",
-        [18] = "SECU_spec",
-        [52] = "SECU_spec",                 [53] = "SECU_spec",
-        [54] = "SECU_spec",
-        [56] = "SECU_spec",                 [57] = "SECU_spec",
-        [58] = "SECU_spec",                 [59] = "SECU_spec",
-    };
     const SDProto *sdp = sd->proto;
 
     if (sdp->acmd[cmd].handler) {
-        assert(!acmd_abbrev[cmd]);
         return sdp->acmd[cmd].name;
     }
 
-    return acmd_abbrev[cmd] ? acmd_abbrev[cmd] : "UNKNOWN_ACMD";
+    return "UNKNOWN_ACMD";
 }
 
 static uint8_t sd_get_dat_lines(SDState *sd)
-- 
2.41.0


Re: [SPAM] [PATCH v42 76/98] hw/sd/sdcard: Remove noise from sd_acmd_name()
Posted by Cédric Le Goater 6 months ago
On 6/28/24 9:01 AM, Philippe Mathieu-Daudé wrote:
> These ACMD names weren't really useful, "UNKNOWN_ACMD" is simpler.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>


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

Thanks,

C.


> ---
>   hw/sd/sd.c | 12 +-----------
>   1 file changed, 1 insertion(+), 11 deletions(-)
> 
> diff --git a/hw/sd/sd.c b/hw/sd/sd.c
> index 7f93d363c7..19322c558f 100644
> --- a/hw/sd/sd.c
> +++ b/hw/sd/sd.c
> @@ -259,23 +259,13 @@ static const char *sd_cmd_name(SDState *sd, uint8_t cmd)
>   
>   static const char *sd_acmd_name(SDState *sd, uint8_t cmd)
>   {
> -    static const char *acmd_abbrev[SDMMC_CMD_MAX] = {
> -        [14] = "DPS_spec",                  [15] = "DPS_spec",
> -        [16] = "DPS_spec",
> -        [18] = "SECU_spec",
> -        [52] = "SECU_spec",                 [53] = "SECU_spec",
> -        [54] = "SECU_spec",
> -        [56] = "SECU_spec",                 [57] = "SECU_spec",
> -        [58] = "SECU_spec",                 [59] = "SECU_spec",
> -    };
>       const SDProto *sdp = sd->proto;
>   
>       if (sdp->acmd[cmd].handler) {
> -        assert(!acmd_abbrev[cmd]);
>           return sdp->acmd[cmd].name;
>       }
>   
> -    return acmd_abbrev[cmd] ? acmd_abbrev[cmd] : "UNKNOWN_ACMD";
> +    return "UNKNOWN_ACMD";
>   }
>   
>   static uint8_t sd_get_dat_lines(SDState *sd)