staging: rts5208: Fixed 80 char & indent warnings
PATCH 1/1 staging: rts5208: Fixed 80 char & indent warnings
This patch fixes the 80 char length warnings and an indent suspect warning identified by the checkpath.pl script for the entire ms.c file leaving with no more warnings or errors left to be fixed for it.
--- drivers/staging/rts5208/ms.c | 43 +++++++++++++++++++++++++----------------- 1 file changed, 26 insertions(+), 17 deletions(-)
drivers/staging/rts5208/ms.c +26 -17
@@ -916,7 +916,7 @@ static int ms_read_attribute_info(struct rtsx_chip *chip)#else if (buf[cur_addr_off +8 ] ==0x10 ) #endif - { + { sys_info_addr = ((u32 )buf[cur_addr_off +0 ] <<24 ) | ((u32 )buf[cur_addr_off +1 ] <<16 ) | ((u32)buf[cur_addr_off + 2] << 8) |
@@ -2382,7 +2382,7 @@ static int ms_build_l2p_tbl(struct rtsx_chip *chip, int seg_no) phy_blk =ms_get_unused_block (chip,0 ); retval =ms_copy_page (chip, tmp_blk, phy_blk, - log_blk,0 , ms_card->page_off +1 ); + log_blk,0 , ms_card->page_off +1 );if (retval !=STATUS_SUCCESS )TRACE_RET (chip,STATUS_FAIL );
@@ -2582,11 +2582,11 @@ static int mspro_rw_multi_sector(struct scsi_cmnd *srb,if (ms_card->seq_mode) {if ((ms_card->pre_dir != srb->sc_data_direction) - || ((ms_card->pre_sec_addr + ms_card->pre_sec_cnt) != start_sector) - || (mode_2k && (ms_card->seq_mode &MODE_512_SEQ )) - || (!mode_2k && (ms_card->seq_mode &MODE_2K_SEQ )) - || !(val &MS_INT_BREQ ) - || ((ms_card->total_sec_cnt + sector_cnt) >0xFE00 )) { + || ((ms_card->pre_sec_addr + ms_card->pre_sec_cnt) != start_sector) + || (mode_2k && (ms_card->seq_mode &MODE_512_SEQ )) + || (!mode_2k && (ms_card->seq_mode &MODE_2K_SEQ )) + || !(val &MS_INT_BREQ ) + || ((ms_card->total_sec_cnt + sector_cnt) >0xFE00 )) { ms_card->seq_mode =0 ; ms_card->total_sec_cnt =0 ;if (val &MS_INT_BREQ ) {
@@ -2594,7 +2594,7 @@ static int mspro_rw_multi_sector(struct scsi_cmnd *srb,if (retval !=STATUS_SUCCESS )TRACE_RET (chip,STATUS_FAIL ); -rtsx_write_register (chip,RBCTL ,RB_FLUSH ,RB_FLUSH ); +rtsx_write_register (chip,RBCTL ,RB_FLUSH ,RB_FLUSH ); } } }
@@ -2684,7 +2684,8 @@ static int mspro_read_format_progress(struct rtsx_chip *chip, }if (!(tmp &MS_INT_BREQ )) { -if ((tmp & (MS_INT_CED |MS_INT_BREQ |MS_INT_CMDNK |MS_INT_ERR )) ==MS_INT_CED ) { +if ((tmp & (MS_INT_CED |MS_INT_BREQ |MS_INT_CMDNK + |MS_INT_ERR )) ==MS_INT_CED ) { ms_card->format_status =FORMAT_SUCCESS ;return STATUS_SUCCESS ; }
@@ -2938,11 +2939,15 @@ static int ms_read_multiple_pages(struct rtsx_chip *chip, u16 phy_blk,if (retval !=STATUS_SUCCESS ) {if (!(chip->card_wp &MS_CARD )) {reset_ms (chip); -ms_set_page_status (log_blk, setPS_NG, extra,MS_EXTRA_SIZE ); -ms_write_extra_data (chip, phy_blk, - page_addr, extra,MS_EXTRA_SIZE ); +ms_set_page_status (log_blk, + setPS_NG, + extra,MS_EXTRA_SIZE ); +ms_write_extra_data (chip, + phy_blk, page_addr, + extra,MS_EXTRA_SIZE ); } -ms_set_err_code (chip,MS_FLASH_READ_ERROR ); +ms_set_err_code (chip, +MS_FLASH_READ_ERROR );TRACE_RET (chip,STATUS_FAIL ); } }else {
@@ -3382,7 +3387,8 @@ static int ms_rw_multi_sector(struct scsi_cmnd *srb, struct rtsx_chip *chip, retval =ms_prepare_write (chip, old_blk, new_blk, log_blk, start_page);if (retval !=STATUS_SUCCESS ) { -if (detect_card_cd (chip,MS_CARD ) !=STATUS_SUCCESS ) { +if (detect_card_cd (chip, +MS_CARD ) !=STATUS_SUCCESS ) {set_sense_type (chip, lun,SENSE_TYPE_MEDIA_NOT_PRESENT );TRACE_RET (chip,STATUS_FAIL );
@@ -3522,7 +3528,8 @@ static int ms_rw_multi_sector(struct scsi_cmnd *srb, struct rtsx_chip *chip, retval =ms_finish_write (chip, old_blk, new_blk, log_blk, end_page);if (retval !=STATUS_SUCCESS ) { -if (detect_card_cd (chip,MS_CARD ) !=STATUS_SUCCESS ) { +if (detect_card_cd (chip, +MS_CARD ) !=STATUS_SUCCESS ) {set_sense_type (chip, lun,SENSE_TYPE_MEDIA_NOT_PRESENT );TRACE_RET (chip,STATUS_FAIL );
@@ -4085,7 +4092,8 @@ int mg_set_ICV(struct scsi_cmnd *srb, struct rtsx_chip *chip)rtsx_clear_ms_error (chip);if (ms_card->mg_auth ==0 ) {if ((buf[5 ] &0xC0 ) !=0 ) -set_sense_type (chip, lun,SENSE_TYPE_MG_KEY_FAIL_NOT_ESTAB ); +set_sense_type (chip, lun, +SENSE_TYPE_MG_KEY_FAIL_NOT_ESTAB );else set_sense_type (chip, lun,SENSE_TYPE_MG_WRITE_ERR );
@@ -4139,7 +4147,8 @@ void ms_cleanup_work(struct rtsx_chip *chip) } }#ifdef MS_DELAY_WRITE - else if ((!CHK_MSPRO(ms_card)) && ms_card->delay_write.delay_write_flag) { + else if ((!CHK_MSPRO(ms_card)) && + ms_card->delay_write.delay_write_flag) {dev_dbg (rtsx_dev (chip),"MS: delay write\n" );ms_delay_write (chip); ms_card->cleanup_counter =0 ;
Signature · 1 line
1.7.10.4
None of these are correct. :(
regards,
dan carpenter
Quoted 1 line · Dan Carpenter
None of these are correct. :(
True. Please run your proposed patches through checkpatch before sending them.
I think it would be an improvement to rework the flow-hiding TRACE_RET and TRACE_GOTO macros into two separate lines.
It would also reduce the code size quite a bit if the TRACE portion of TRACE_RET/TRACE_GOTO was a separate function and not an inline.
A message that is not in the archive (sent off-list or not yet received): CAHjTdYdtPby6TzVzKdFerao421CKe5OaEib4mmTwGi6fFKw=pA@mail.gmail.com
A message that is not in the archive (sent off-list or not yet received): CAPBgb4nKUjUvHiJU0uJEo0r780bn9A=FQh5Y7h0tSusYLwCzOg@mail.gmail.com
Hi,
Please refer :
http://lxr.linux.no/#linux+v3.19.1/Documentation/CodingStyle
for reference on kernel coding conventions. These are also the basis for various checkpatch.pl errors.
You can also refer to :
http://kernelnewbies.org/CheckpatchTips
for reference on things to look out for while resolving checkpatch errors.
Thanks :)