[PATCH 08/23] hw/sd/sdcard: Remove explicit entries for illegal commands

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 08/23] hw/sd/sdcard: Remove explicit entries for illegal commands
Posted by Philippe Mathieu-Daudé 5 months ago
NULL handler is already handled as illegal, no need to
duplicate (that keeps this array simpler to maintain).

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

diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index e9af834a8c..30239b28bc 100644
--- a/hw/sd/sd.c
+++ b/hw/sd/sd.c
@@ -2146,12 +2146,6 @@ static const SDProto sd_proto_spi = {
     .cmd = {
         [0]         = sd_cmd_GO_IDLE_STATE,
         [1]         = spi_cmd_SEND_OP_COND,
-        [2 ... 4]   = sd_cmd_illegal,
-        [5]         = sd_cmd_illegal,
-        [7]         = sd_cmd_illegal,
-        [15]        = sd_cmd_illegal,
-        [26]        = sd_cmd_illegal,
-        [52 ... 54] = sd_cmd_illegal,
     },
     .acmd = {
         [41]        = spi_cmd_SEND_OP_COND,
@@ -2162,15 +2156,10 @@ static const SDProto sd_proto_sd = {
     .name = "SD",
     .cmd = {
         [0]         = sd_cmd_GO_IDLE_STATE,
-        [1]         = sd_cmd_illegal,
         [2]         = sd_cmd_ALL_SEND_CID,
         [3]         = sd_cmd_SEND_RELATIVE_ADDR,
-        [5]         = sd_cmd_illegal,
         [19]        = sd_cmd_SEND_TUNING_BLOCK,
         [23]        = sd_cmd_SET_BLOCK_COUNT,
-        [52 ... 54] = sd_cmd_illegal,
-        [58]        = sd_cmd_illegal,
-        [59]        = sd_cmd_illegal,
     },
 };
 
-- 
2.41.0


Re: [PATCH 08/23] hw/sd/sdcard: Remove explicit entries for illegal commands
Posted by Cédric Le Goater 5 months ago
On 6/21/24 10:05 AM, Philippe Mathieu-Daudé wrote:
> NULL handler is already handled as illegal, no need to
> duplicate (that keeps this array simpler to maintain).
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>


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

Thanks,

C.


> ---
>   hw/sd/sd.c | 11 -----------
>   1 file changed, 11 deletions(-)
> 
> diff --git a/hw/sd/sd.c b/hw/sd/sd.c
> index e9af834a8c..30239b28bc 100644
> --- a/hw/sd/sd.c
> +++ b/hw/sd/sd.c
> @@ -2146,12 +2146,6 @@ static const SDProto sd_proto_spi = {
>       .cmd = {
>           [0]         = sd_cmd_GO_IDLE_STATE,
>           [1]         = spi_cmd_SEND_OP_COND,
> -        [2 ... 4]   = sd_cmd_illegal,
> -        [5]         = sd_cmd_illegal,
> -        [7]         = sd_cmd_illegal,
> -        [15]        = sd_cmd_illegal,
> -        [26]        = sd_cmd_illegal,
> -        [52 ... 54] = sd_cmd_illegal,
>       },
>       .acmd = {
>           [41]        = spi_cmd_SEND_OP_COND,
> @@ -2162,15 +2156,10 @@ static const SDProto sd_proto_sd = {
>       .name = "SD",
>       .cmd = {
>           [0]         = sd_cmd_GO_IDLE_STATE,
> -        [1]         = sd_cmd_illegal,
>           [2]         = sd_cmd_ALL_SEND_CID,
>           [3]         = sd_cmd_SEND_RELATIVE_ADDR,
> -        [5]         = sd_cmd_illegal,
>           [19]        = sd_cmd_SEND_TUNING_BLOCK,
>           [23]        = sd_cmd_SET_BLOCK_COUNT,
> -        [52 ... 54] = sd_cmd_illegal,
> -        [58]        = sd_cmd_illegal,
> -        [59]        = sd_cmd_illegal,
>       },
>   };
>