mmc: Fix switch..case indention
PATCH v2 1/2 mmc: Fix switch..case indention
Correct the indention level of switch..case statements.
---
Changes in v2: None
drivers/mmc/mmc.c | 140 +++++++++++++++++++++++++++--------------------------- 1 file changed, 70 insertions(+), 70 deletions(-)
drivers/mmc/mmc.c +70 -70
@@ -62,45 +62,45 @@ int mmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, struct mmc_data *data)printf ("\t\tARG\t\t\t 0x%08X\n" , cmd->cmdarg); ret = mmc->cfg->ops->send_cmd (mmc, cmd, data);switch (cmd->resp_type) { -case MMC_RSP_NONE : -printf ("\t\tMMC_RSP_NONE\n" ); -break ; -case MMC_RSP_R1 : -printf ("\t\tMMC_RSP_R1,5,6,7 \t 0x%08X \n" , - cmd->response[0 ]); -break ; -case MMC_RSP_R1b: -printf ("\t\tMMC_RSP_R1b\t\t 0x%08X \n" , - cmd->response[0 ]); -break ; -case MMC_RSP_R2 : -printf ("\t\tMMC_RSP_R2\t\t 0x%08X \n" , - cmd->response[0 ]); -printf ("\t\t \t\t 0x%08X \n" , - cmd->response[1 ]); -printf ("\t\t \t\t 0x%08X \n" , - cmd->response[2 ]); -printf ("\t\t \t\t 0x%08X \n" , - cmd->response[3 ]); +case MMC_RSP_NONE : +printf ("\t\tMMC_RSP_NONE\n" ); +break ; +case MMC_RSP_R1 : +printf ("\t\tMMC_RSP_R1,5,6,7 \t 0x%08X \n" , + cmd->response[0 ]); +break ; +case MMC_RSP_R1b: +printf ("\t\tMMC_RSP_R1b\t\t 0x%08X \n" , + cmd->response[0 ]); +break ; +case MMC_RSP_R2 : +printf ("\t\tMMC_RSP_R2\t\t 0x%08X \n" , + cmd->response[0 ]); +printf ("\t\t \t\t 0x%08X \n" , + cmd->response[1 ]); +printf ("\t\t \t\t 0x%08X \n" , + cmd->response[2 ]); +printf ("\t\t \t\t 0x%08X \n" , + cmd->response[3 ]); +printf ("\n" ); +printf ("\t\t\t\t\tDUMPING DATA\n" ); +for (i =0 ; i <4 ; i++) { +int j; +printf ("\t\t\t\t\t%03d - " , i*4 ); + ptr = (u8 *)&cmd->response[i]; + ptr +=3 ; +for (j =0 ; j <4 ; j++) +printf ("%02X " , *ptr--);printf ("\n" ); -printf ("\t\t\t\t\tDUMPING DATA\n" ); -for (i =0 ; i <4 ; i++) { -int j; -printf ("\t\t\t\t\t%03d - " , i*4 ); - ptr = (u8 *)&cmd->response[i]; - ptr +=3 ; -for (j =0 ; j <4 ; j++) -printf ("%02X " , *ptr--); -printf ("\n" ); - } -break ; -case MMC_RSP_R3 : -printf ("\t\tMMC_RSP_R3,4\t\t 0x%08X \n" , - cmd->response[0 ]); -break ; -default : -printf ("\t\tERROR MMC rsp not supported\n" ); -break ; + } +break ; +case MMC_RSP_R3 : +printf ("\t\tMMC_RSP_R3,4\t\t 0x%08X \n" , + cmd->response[0 ]); +break ; +default : +printf ("\t\tERROR MMC rsp not supported\n" ); +break ; }#else ret = mmc->cfg->ops->send_cmd (mmc, cmd, data);
@@ -906,20 +906,20 @@ retry_scr: mmc->scr[1 ] =__be32_to_cpu (scr[1 ]);switch ((mmc->scr[0 ] >>24 ) &0xf ) { -case 0 : - mmc->version =SD_VERSION_1_0 ; -break ; -case 1 : - mmc->version =SD_VERSION_1_10 ; -break ; -case 2 : - mmc->version =SD_VERSION_2 ; -if ((mmc->scr[0 ] >>15 ) &0x1 ) - mmc->version =SD_VERSION_3 ; -break ; -default : - mmc->version =SD_VERSION_1_0 ; -break ; +case 0 : + mmc->version =SD_VERSION_1_0 ; +break ; +case 1 : + mmc->version =SD_VERSION_1_10 ; +break ; +case 2 : + mmc->version =SD_VERSION_2 ; +if ((mmc->scr[0 ] >>15 ) &0x1 ) + mmc->version =SD_VERSION_3 ; +break ; +default : + mmc->version =SD_VERSION_1_0 ; +break ; }if (mmc->scr[0 ] &SD_DATA_4BIT )
@@ -1102,24 +1102,24 @@ static int mmc_startup(struct mmc *mmc)int version = (cmd.response[0 ] >>26 ) &0xf ;switch (version) { -case 0 : - mmc->version =MMC_VERSION_1_2 ; -break ; -case 1 : - mmc->version =MMC_VERSION_1_4 ; -break ; -case 2 : - mmc->version =MMC_VERSION_2_2 ; -break ; -case 3 : - mmc->version =MMC_VERSION_3 ; -break ; -case 4 : - mmc->version =MMC_VERSION_4 ; -break ; -default : - mmc->version =MMC_VERSION_1_2 ; -break ; +case 0 : + mmc->version =MMC_VERSION_1_2 ; +break ; +case 1 : + mmc->version =MMC_VERSION_1_4 ; +break ; +case 2 : + mmc->version =MMC_VERSION_2_2 ; +break ; +case 3 : + mmc->version =MMC_VERSION_3 ; +break ; +case 4 : + mmc->version =MMC_VERSION_4 ; +break ; +default : + mmc->version =MMC_VERSION_1_2 ; +break ; } }
Signature · 1 line
1.8.2.1
PATCH v2 2/2 mmc: Print send_cmd response only when return value is zero
send_cmd response is valid only when no error happened. If an error occured, let mmc_send_cmd() print the return value to aid debugging.
---
Changes in v2:
- change commit subject: it should be 'return value is zero'
drivers/mmc/mmc.c | 80 +++++++++++++++++++++++++++++-------------------------- 1 file changed, 42 insertions(+), 38 deletions(-)
drivers/mmc/mmc.c +42 -38
@@ -61,46 +61,50 @@ int mmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, struct mmc_data *data)printf ("CMD_SEND:%d\n" , cmd->cmdidx);printf ("\t\tARG\t\t\t 0x%08X\n" , cmd->cmdarg); ret = mmc->cfg->ops->send_cmd (mmc, cmd, data); -switch (cmd->resp_type) { -case MMC_RSP_NONE : -printf ("\t\tMMC_RSP_NONE\n" ); -break ; -case MMC_RSP_R1 : -printf ("\t\tMMC_RSP_R1,5,6,7 \t 0x%08X \n" , - cmd->response[0 ]); -break ; -case MMC_RSP_R1b: -printf ("\t\tMMC_RSP_R1b\t\t 0x%08X \n" , - cmd->response[0 ]); -break ; -case MMC_RSP_R2 : -printf ("\t\tMMC_RSP_R2\t\t 0x%08X \n" , - cmd->response[0 ]); -printf ("\t\t \t\t 0x%08X \n" , - cmd->response[1 ]); -printf ("\t\t \t\t 0x%08X \n" , - cmd->response[2 ]); -printf ("\t\t \t\t 0x%08X \n" , - cmd->response[3 ]); -printf ("\n" ); -printf ("\t\t\t\t\tDUMPING DATA\n" ); -for (i =0 ; i <4 ; i++) { -int j; -printf ("\t\t\t\t\t%03d - " , i*4 ); - ptr = (u8 *)&cmd->response[i]; - ptr +=3 ; -for (j =0 ; j <4 ; j++) -printf ("%02X " , *ptr--); +if (ret) { +printf ("\t\tRET\t\t\t %d\n" , ret); + }else { +switch (cmd->resp_type) { +case MMC_RSP_NONE : +printf ("\t\tMMC_RSP_NONE\n" ); +break ; +case MMC_RSP_R1 : +printf ("\t\tMMC_RSP_R1,5,6,7 \t 0x%08X \n" , + cmd->response[0 ]); +break ; +case MMC_RSP_R1b: +printf ("\t\tMMC_RSP_R1b\t\t 0x%08X \n" , + cmd->response[0 ]); +break ; +case MMC_RSP_R2 : +printf ("\t\tMMC_RSP_R2\t\t 0x%08X \n" , + cmd->response[0 ]); +printf ("\t\t \t\t 0x%08X \n" , + cmd->response[1 ]); +printf ("\t\t \t\t 0x%08X \n" , + cmd->response[2 ]); +printf ("\t\t \t\t 0x%08X \n" , + cmd->response[3 ]);printf ("\n" ); +printf ("\t\t\t\t\tDUMPING DATA\n" ); +for (i =0 ; i <4 ; i++) { +int j; +printf ("\t\t\t\t\t%03d - " , i*4 ); + ptr = (u8 *)&cmd->response[i]; + ptr +=3 ; +for (j =0 ; j <4 ; j++) +printf ("%02X " , *ptr--); +printf ("\n" ); + } +break ; +case MMC_RSP_R3 : +printf ("\t\tMMC_RSP_R3,4\t\t 0x%08X \n" , + cmd->response[0 ]); +break ; +default : +printf ("\t\tERROR MMC rsp not supported\n" ); +break ; } -break ; -case MMC_RSP_R3 : -printf ("\t\tMMC_RSP_R3,4\t\t 0x%08X \n" , - cmd->response[0 ]); -break ; -default : -printf ("\t\tERROR MMC rsp not supported\n" ); -break ; }#else ret = mmc->cfg->ops->send_cmd (mmc, cmd, data);
Signature · 1 line
1.8.2.1
PATCH v2 1/2 mmc: Fix switch..case indention
In reply to Bin MengQuoted 3 lines · Bin Meng
Correct the indention level of switch..case statements.
Signed-off-by Bin Meng <[email protected]>
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160318/bb070449/attachment.sig>
PATCH v2 2/2 mmc: Print send_cmd response only when return value is zero
In reply to Bin MengQuoted 5 lines · Bin Meng
send_cmdresponse is valid only when no error happened. If an error occured, letmmc_send_cmd()print the return value to aid debugging.Signed-off-by Bin Meng <[email protected]>
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160318/7bf26bf1/attachment.sig>
PATCH v2 1/2 mmc: Fix switch..case indention
In reply to Bin MengQuoted 4 lines · Bin Meng
Correct the indention level of switch..case statements.
Signed-off-by Bin Meng <[email protected]>Reviewed-by Tom Rini <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160327/882f6b0a/attachment.sig>
PATCH v2 2/2 mmc: Print send_cmd response only when return value is zero
In reply to Bin MengQuoted 5 lines · Bin Meng
send_cmdresponse is valid only when no error happened. If an error occured, letmmc_send_cmd()print the return value to aid debugging.Signed-off-by Bin Meng <[email protected]>Reviewed-by Tom Rini <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160327/7e810aef/attachment.sig>