staging: rts5208: remove unnecessary parentheses in all files
cover staging: rts5208: remove unnecessary parentheses in all files
This patchset removes all unnecessary parentheses in the rts5208 driver.
Benjamin Philip (8):
staging: rts5208: remove unnecessary parentheses in rtsx_card.c
staging: rts5208: remove unnecessary parentheses in rtsx.c
staging: rts5208: remove unnecessary parentheses in rtsx_chip.c
staging: rts5208: remove unnecessary parentheses in rtsx_transport.c
staging: rts5208: remove unnecessary parentheses in sd.c
staging: rts5208: remove unnecessary parentheses in xd.c
staging: rts5208: remove unnecessary parentheses in rtsx_scsi.c
staging: rts5208: remove parentheses pair in sd.c
drivers/staging/rts5208/rtsx.c | 2 +- drivers/staging/rts5208/rtsx_card.c | 8 +- drivers/staging/rts5208/rtsx_chip.c | 16 ++-- drivers/staging/rts5208/rtsx_scsi.c | 106 +++++++++++------------ drivers/staging/rts5208/rtsx_transport.c | 6 +- drivers/staging/rts5208/sd.c | 68 +++++++-------- drivers/staging/rts5208/xd.c | 48 +++++----- 7 files changed, 127 insertions(+), 127 deletions(-)
Signature · 1 line
2.31.1
PATCH 1/8 staging: rts5208: remove unnecessary parentheses in rtsx_card.c
This commit removes unnecessary parentheses that have been flagged by checkpatch.pl in rtsx_card.c.
--- drivers/staging/rts5208/rtsx_card.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/staging/rts5208/rtsx_card.c +4 -4
@@ -165,7 +165,7 @@ void do_reset_sd_card(struct rtsx_chip *chip) chip->card_fail &= ~SD_CARD ; chip->rw_card[chip->card2lun[SD_CARD ]] = sd_rw; }else { -if (chip->sd_io || (chip->sd_reset_counter >=MAX_RESET_CNT )) { +if (chip->sd_io || chip->sd_reset_counter >=MAX_RESET_CNT ) {clear_bit (SD_NR , &chip->need_reset); chip->sd_reset_counter =0 ; chip->sd_show_cnt =0 ;
@@ -636,7 +636,7 @@ int switch_ssc_clock(struct rtsx_chip *chip, int clk)dev_dbg (rtsx_dev (chip),"Switch SSC clock to %dMHz (cur_clk = %d)\n" , clk, chip->cur_clk); -if ((clk <=2 ) || (n > max_n)) +if (clk <=2 || n > max_n)return STATUS_FAIL ; mcu_cnt = (u8)(125 / clk +3 );
@@ -886,7 +886,7 @@ int card_power_on(struct rtsx_chip *chip, u8 card)int retval;u8 mask, val1, val2; -if (CHECK_LUN_MODE (chip,SD_MS_2LUN ) && (card ==MS_CARD )) { +if (CHECK_LUN_MODE (chip,SD_MS_2LUN ) && card ==MS_CARD ) { mask =MS_POWER_MASK ; val1 =MS_PARTIAL_POWER_ON ; val2 =MS_POWER_ON ;
@@ -920,7 +920,7 @@ int card_power_off(struct rtsx_chip *chip, u8 card)int retval;u8 mask, val; -if (CHECK_LUN_MODE (chip,SD_MS_2LUN ) && (card ==MS_CARD )) { +if (CHECK_LUN_MODE (chip,SD_MS_2LUN ) && card ==MS_CARD ) { mask =MS_POWER_MASK ; val =MS_POWER_OFF ; }else {
Signature · 1 line
2.31.1
PATCH 2/8 staging: rts5208: remove unnecessary parentheses in rtsx.c
In reply to Benjamin PhilipThis commit removes unnecessary parentheses that have been flagged by checkpatch.pl in rtsx.c
--- drivers/staging/rts5208/rtsx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rts5208/rtsx.c +1 -1
@@ -558,7 +558,7 @@ static irqreturn_t rtsx_interrupt(int irq, void *dev_id)complete (dev->done); }else if (status &DATA_DONE_INT ) { dev->trans_result =TRANS_NOT_READY ; -if (dev->done && (dev->trans_state ==STATE_TRANS_SG )) +if (dev->done && dev->trans_state ==STATE_TRANS_SG )complete (dev->done); } }
Signature · 1 line
2.31.1
PATCH 3/8 staging: rts5208: remove unnecessary parentheses in rtsx_chip.c
In reply to Benjamin PhilipThis commit removes unnecessary parentheses, that have been flagged by checkpatch.pl in rtsx_chip.c
--- drivers/staging/rts5208/rtsx_chip.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
drivers/staging/rts5208/rtsx_chip.c +8 -8
@@ -325,7 +325,7 @@ static int rtsx_enable_pcie_intr(struct rtsx_chip *chip)return STATUS_FAIL ; } -if (chip->driver_first_load && (chip->ic_version <IC_VER_C )) +if (chip->driver_first_load && chip->ic_version <IC_VER_C )rtsx_calibration (chip);return STATUS_SUCCESS ;
@@ -496,7 +496,7 @@ int rtsx_reset_chip(struct rtsx_chip *chip) chip->int_reg);if (chip->int_reg &SD_EXIST ) {#ifdef HW_AUTO_SWITCH_SD_BUS -if (CHECK_PID (chip,0x5208 ) && (chip->ic_version <IC_VER_C )) +if (CHECK_PID (chip,0x5208 ) && chip->ic_version <IC_VER_C ) retval =rtsx_pre_handle_sdio_old (chip);else retval =rtsx_pre_handle_sdio_new (chip);
@@ -563,7 +563,7 @@ int rtsx_reset_chip(struct rtsx_chip *chip)return retval; } -if (CHECK_PID (chip,0x5208 ) && (chip->ic_version >=IC_VER_D )) { +if (CHECK_PID (chip,0x5208 ) && chip->ic_version >=IC_VER_D ) { retval =rtsx_write_register (chip,PETXCFG ,0x1C ,0x14 );if (retval)return retval;
@@ -606,7 +606,7 @@ static inline int valid_sd_speed_prior(u32 sd_speed_prior)for (i =0 ; i <4 ; i++) {u8 tmp = (u8)(sd_speed_prior >> (i *8 )); -if ((tmp <0x01 ) || (tmp >0x04 )) { +if (tmp <0x01 || tmp >0x04 ) { valid_para = false;break ; }
@@ -808,10 +808,10 @@ int rtsx_init_chip(struct rtsx_chip *chip)dev_dbg (rtsx_dev (chip),"sd_current_prior = 0x%08x\n" , chip->sd_current_prior); -if ((chip->sd_ddr_tx_phase >31 ) || (chip->sd_ddr_tx_phase <0 )) +if (chip->sd_ddr_tx_phase >31 || chip->sd_ddr_tx_phase <0 ) chip->sd_ddr_tx_phase =0 ; -if ((chip->mmc_ddr_tx_phase >31 ) || (chip->mmc_ddr_tx_phase <0 )) +if (chip->mmc_ddr_tx_phase >31 || chip->mmc_ddr_tx_phase <0 ) chip->mmc_ddr_tx_phase =0 ; retval =rtsx_write_register (chip,FPDCTL ,SSC_POWER_DOWN ,0 );
@@ -1840,7 +1840,7 @@ int rtsx_pre_handle_interrupt(struct rtsx_chip *chip) chip->int_reg =rtsx_readl (chip,RTSX_BIPR );if (((chip->int_reg & int_enable) ==0 ) || - (chip->int_reg ==0xFFFFFFFF )) + chip->int_reg ==0xFFFFFFFF )return STATUS_FAIL ; status = chip->int_reg &= (int_enable |0x7FFFFF );
@@ -1939,7 +1939,7 @@ void rtsx_do_before_power_down(struct rtsx_chip *chip, int pm_stat) }#endif -if (CHECK_PID (chip,0x5208 ) && (chip->ic_version >=IC_VER_D )) { +if (CHECK_PID (chip,0x5208 ) && chip->ic_version >=IC_VER_D ) {/* u_force_clkreq_0 */ rtsx_write_register (chip,PETXCFG ,0x08 ,0x08 ); }
Signature · 1 line
2.31.1
PATCH 4/8 staging: rts5208: remove unnecessary parentheses in rtsx_transport.c
In reply to Benjamin PhilipThis commit removes unnecessary parentheses, that have been flagged by checkpatch.pl in rtsx_transport.c.
--- drivers/staging/rts5208/rtsx_transport.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/rts5208/rtsx_transport.c +3 -3
@@ -326,7 +326,7 @@ static int rtsx_transfer_sglist_adma_partial(struct rtsx_chip *chip, u8 card,struct scatterlist *sg_ptr;u32 val =TRIG_DMA ; -if (!sg || (num_sg <=0 ) || !offset || !index) +if (!sg || num_sg <=0 || !offset || !index)return -EIO ;if (dma_dir ==DMA_TO_DEVICE )
@@ -489,7 +489,7 @@ static int rtsx_transfer_sglist_adma(struct rtsx_chip *chip, u8 card,long timeleft;struct scatterlist *sg_ptr; -if (!sg || (num_sg <=0 )) +if (!sg || num_sg <=0 )return -EIO ;if (dma_dir ==DMA_TO_DEVICE )
@@ -635,7 +635,7 @@ static int rtsx_transfer_buf(struct rtsx_chip *chip, u8 card, void *buf,u32 val =BIT (31 );long timeleft; -if (!buf || (len <=0 )) +if (!buf || len <=0 )return -EIO ;if (dma_dir ==DMA_TO_DEVICE )
Signature · 1 line
2.31.1
PATCH 5/8 staging: rts5208: remove unnecessary parentheses in sd.c
In reply to Benjamin PhilipThis commit removes unnecessary parentheses, that have been flagged by checkpatch.pl in sd.c
--- drivers/staging/rts5208/sd.c | 66 ++++++++++++++++++------------------ 1 file changed, 33 insertions(+), 33 deletions(-)
drivers/staging/rts5208/sd.c +33 -33
@@ -218,9 +218,9 @@ static int sd_send_cmd_get_rsp(struct rtsx_chip *chip, u8 cmd_idx, } } -if ((rsp_type ==SD_RSP_TYPE_R1 ) || (rsp_type == SD_RSP_TYPE_R1b)) { -if ((cmd_idx !=SEND_RELATIVE_ADDR ) && - (cmd_idx !=SEND_IF_COND )) { +if (rsp_type ==SD_RSP_TYPE_R1 || rsp_type == SD_RSP_TYPE_R1b) { +if (cmd_idx !=SEND_RELATIVE_ADDR && + cmd_idx !=SEND_IF_COND ) {if (cmd_idx !=STOP_TRANSMISSION ) {if (ptr[1 ] &0x80 )return STATUS_FAIL ;
@@ -462,7 +462,7 @@ static int sd_check_csd(struct rtsx_chip *chip, char check_wp)if (CHK_MMC_SECTOR_MODE (sd_card)) { sd_card->capacity =0 ; }else { -if ((!CHK_SD_HCXC (sd_card)) || (csd_ver ==0 )) { +if ((!CHK_SD_HCXC (sd_card)) || csd_ver ==0 ) {u8 blk_size, c_size_mult;u16 c_size;
@@ -1077,7 +1077,7 @@ static int sd_query_switch_result(struct rtsx_chip *chip, u8 func_group, }/* Check 'Busy Status' */ -if ((buf[DATA_STRUCTURE_VER_OFFSET ] ==0x01 ) && +if (buf[DATA_STRUCTURE_VER_OFFSET ] ==0x01 && ((buf[check_busy_offset] & switch_busy) == switch_busy)) {return STATUS_FAIL ; }
@@ -1148,7 +1148,7 @@ static int sd_check_switch_mode(struct rtsx_chip *chip, u8 mode, u8 func_group,dev_dbg (rtsx_dev (chip),"Maximum current consumption: %dmA\n" , cc); -if ((cc ==0 ) || (cc >800 )) +if (cc ==0 || cc >800 )return STATUS_FAIL ; retval = sd_query_switch_result(chip, func_group,
@@ -1156,7 +1156,7 @@ static int sd_check_switch_mode(struct rtsx_chip *chip, u8 mode, u8 func_group,if (retval !=STATUS_SUCCESS )return STATUS_FAIL ; -if ((cc >400 ) || (func_to_switch >CURRENT_LIMIT_400 )) { +if (cc >400 || func_to_switch >CURRENT_LIMIT_400 ) { retval =rtsx_write_register (chip,OCPPARA2 ,SD_OCP_THD_MASK , chip->sd_800mA_ocp_thd);
@@ -1292,7 +1292,7 @@ static int sd_switch_function(struct rtsx_chip *chip, u8 bus_width)#ifdef SUPPORT_SD_LOCK if ((sd_card->sd_lock_status &SD_SDR_RST ) && - (func_to_switch ==DDR50_SUPPORT ) && + func_to_switch ==DDR50_SUPPORT && (sd_card->func_group1_mask &SDR50_SUPPORT_MASK )) { func_to_switch =SDR50_SUPPORT ;dev_dbg (rtsx_dev (chip),"Using SDR50 instead of DDR50 for SD Lock\n" );
@@ -1664,8 +1664,8 @@ static u8 sd_search_final_phase(struct rtsx_chip *chip, u32 phase_map, path[idx].mid = path[idx].start + path[idx].len /2 ; } -if ((path[0 ].start ==0 ) && - (path[cont_path_cnt -1 ].end ==MAX_PHASE )) { +if (path[0 ].start ==0 && + path[cont_path_cnt -1 ].end ==MAX_PHASE ) { path[0 ].start = path[cont_path_cnt -1 ].start -MAX_PHASE -1 ; path[0 ].len += path[cont_path_cnt -1 ].len; path[0 ].mid = path[0 ].start + path[0 ].len /2 ;
@@ -1811,7 +1811,7 @@ static int sd_ddr_pre_tuning_tx(struct rtsx_chip *chip) retval =sd_send_cmd_get_rsp (chip,SEND_STATUS , sd_card->sd_addr,SD_RSP_TYPE_R1 ,NULL ,0 ); -if ((retval ==STATUS_SUCCESS ) || +if (retval ==STATUS_SUCCESS || !sd_check_err_code (chip,SD_RSP_TIMEOUT )) phase_map |=1 << i; }
@@ -2269,7 +2269,7 @@ static int sd_check_wp_state(struct rtsx_chip *chip) sd_card_type = ((u16 )buf[2 ] <<8 ) | buf[3 ];dev_dbg (rtsx_dev (chip),"sd_card_type = 0x%04x\n" , sd_card_type); -if ((sd_card_type ==0x0001 ) || (sd_card_type ==0x0002 )) { +if (sd_card_type ==0x0001 || sd_card_type ==0x0002 ) {/* ROM card or OTP */ chip->card_wp |=SD_CARD ; }
@@ -2361,7 +2361,7 @@ static int reset_sd(struct rtsx_chip *chip) retval =sd_send_cmd_get_rsp (chip,SEND_IF_COND ,0x000001AA ,SD_RSP_TYPE_R7 , rsp,5 );if (retval ==STATUS_SUCCESS ) { -if ((rsp[4 ] ==0xAA ) && ((rsp[3 ] &0x0f ) ==0x01 )) { +if (rsp[4 ] ==0xAA && ((rsp[3 ] &0x0f ) ==0x01 )) { hi_cap_flow = true; voltage =SUPPORT_VOLTAGE |0x40000000 ; }
@@ -2713,7 +2713,7 @@ static int mmc_test_switch_bus(struct rtsx_chip *chip, u8 width)if (width ==MMC_8BIT_BUS ) {dev_dbg (rtsx_dev (chip),"BUSTEST_R [8bits]: 0x%02x 0x%02x\n" , ptr[0 ], ptr[1 ]); -if ((ptr[0 ] ==0xAA ) && (ptr[1 ] ==0x55 )) { +if (ptr[0 ] ==0xAA && ptr[1 ] ==0x55 ) {u8 rsp[5 ];u32 arg;
@@ -2724,7 +2724,7 @@ static int mmc_test_switch_bus(struct rtsx_chip *chip, u8 width) retval =sd_send_cmd_get_rsp (chip,SWITCH , arg, SD_RSP_TYPE_R1b, rsp,5 ); -if ((retval ==STATUS_SUCCESS ) && +if (retval ==STATUS_SUCCESS && !(rsp[4 ] &MMC_SWITCH_ERR ))return SWITCH_SUCCESS ; }
@@ -2741,7 +2741,7 @@ static int mmc_test_switch_bus(struct rtsx_chip *chip, u8 width) retval =sd_send_cmd_get_rsp (chip,SWITCH , arg, SD_RSP_TYPE_R1b, rsp,5 ); -if ((retval ==STATUS_SUCCESS ) && +if (retval ==STATUS_SUCCESS && !(rsp[4 ] &MMC_SWITCH_ERR ))return SWITCH_SUCCESS ; }
@@ -2830,7 +2830,7 @@ static int mmc_switch_timing_bus(struct rtsx_chip *chip, bool switch_ddr) retval =sd_send_cmd_get_rsp (chip,SWITCH ,0x03B90100 , SD_RSP_TYPE_R1b, rsp,5 ); -if ((retval !=STATUS_SUCCESS ) || (rsp[4 ] &MMC_SWITCH_ERR )) +if (retval !=STATUS_SUCCESS || (rsp[4 ] &MMC_SWITCH_ERR ))CLR_MMC_HS (sd_card); }
@@ -2989,7 +2989,7 @@ static int reset_mmc(struct rtsx_chip *chip) } } -if (CHK_MMC_SECTOR_MODE (sd_card) && (sd_card->capacity ==0 )) +if (CHK_MMC_SECTOR_MODE (sd_card) && sd_card->capacity ==0 )return STATUS_FAIL ;if (switch_ddr &&CHK_MMC_DDR52 (sd_card)) {
@@ -3333,11 +3333,11 @@ int sd_rw(struct scsi_cmnd *srb, struct rtsx_chip *chip, u32 start_sector, }if (sd_card->seq_mode && - ((sd_card->pre_dir != srb->sc_data_direction) || + (sd_card->pre_dir != srb->sc_data_direction || ((sd_card->pre_sec_addr + sd_card->pre_sec_cnt) != start_sector))) { -if ((sd_card->pre_sec_cnt <0x80 ) && - (sd_card->pre_dir ==DMA_FROM_DEVICE ) && +if (sd_card->pre_sec_cnt <0x80 && + sd_card->pre_dir ==DMA_FROM_DEVICE && !CHK_SD30_SPEED (sd_card) && !CHK_SD_HS (sd_card) && !CHK_MMC_HS (sd_card)) {
@@ -3361,7 +3361,7 @@ int sd_rw(struct scsi_cmnd *srb, struct rtsx_chip *chip, u32 start_sector, goto RW_FAIL; } -if ((sd_card->pre_sec_cnt <0x80 ) && +if (sd_card->pre_sec_cnt <0x80 && !CHK_SD30_SPEED (sd_card) && !CHK_SD_HS (sd_card) && !CHK_MMC_HS (sd_card)) {
@@ -3666,9 +3666,9 @@ int ext_sd_send_cmd_get_rsp(struct rtsx_chip *chip, u8 cmd_idx, u32 arg, } } -if ((cmd_idx ==SELECT_CARD ) || (cmd_idx ==APP_CMD ) || - (cmd_idx ==SEND_STATUS ) || (cmd_idx ==STOP_TRANSMISSION )) { -if ((cmd_idx !=STOP_TRANSMISSION ) && !special_check) { +if (cmd_idx ==SELECT_CARD || cmd_idx ==APP_CMD || + cmd_idx ==SEND_STATUS || cmd_idx ==STOP_TRANSMISSION ) { +if (cmd_idx !=STOP_TRANSMISSION && !special_check) {if (ptr[1 ] &0x80 )return STATUS_FAIL ; }
@@ -3772,10 +3772,10 @@ int sd_pass_thru_mode(struct scsi_cmnd *srb, struct rtsx_chip *chip)return TRANSPORT_FAILED ; } -if ((srb->cmnd[2 ] !=0x53 ) || (srb->cmnd[3 ] !=0x44 ) || - (srb->cmnd[4 ] !=0x20 ) || (srb->cmnd[5 ] !=0x43 ) || - (srb->cmnd[6 ] !=0x61 ) || (srb->cmnd[7 ] !=0x72 ) || - (srb->cmnd[8 ] !=0x64 )) { +if (srb->cmnd[2 ] !=0x53 || srb->cmnd[3 ] !=0x44 || + srb->cmnd[4 ] !=0x20 || srb->cmnd[5 ] !=0x43 || + srb->cmnd[6 ] !=0x61 || srb->cmnd[7 ] !=0x72 || + srb->cmnd[8 ] !=0x64 ) {set_sense_type (chip, lun,SENSE_TYPE_MEDIA_INVALID_CMD_FIELD );return TRANSPORT_FAILED ; }
@@ -4596,10 +4596,10 @@ int sd_hw_rst(struct scsi_cmnd *srb, struct rtsx_chip *chip)return TRANSPORT_FAILED ; } -if ((srb->cmnd[2 ] !=0x53 ) || (srb->cmnd[3 ] !=0x44 ) || - (srb->cmnd[4 ] !=0x20 ) || (srb->cmnd[5 ] !=0x43 ) || - (srb->cmnd[6 ] !=0x61 ) || (srb->cmnd[7 ] !=0x72 ) || - (srb->cmnd[8 ] !=0x64 )) { +if (srb->cmnd[2 ] !=0x53 || srb->cmnd[3 ] !=0x44 || + srb->cmnd[4 ] !=0x20 || srb->cmnd[5 ] !=0x43 || + srb->cmnd[6 ] !=0x61 || srb->cmnd[7 ] !=0x72 || + srb->cmnd[8 ] !=0x64 ) {set_sense_type (chip, lun,SENSE_TYPE_MEDIA_INVALID_CMD_FIELD );return TRANSPORT_FAILED ; }
Signature · 1 line
2.31.1
PATCH 6/8 staging: rts5208: remove unnecessary parentheses in xd.c
In reply to Benjamin PhilipThis commit removes unnecessary parentheses, that have been flagged by checkpatch.pl in xd.c
--- drivers/staging/rts5208/xd.c | 48 ++++++++++++++++++------------------ 1 file changed, 24 insertions(+), 24 deletions(-)
drivers/staging/rts5208/xd.c +24 -24
@@ -177,7 +177,7 @@ static int xd_read_data_from_ppb(struct rtsx_chip *chip, int offset, {int retval, i; -if (!buf || (buf_len <0 )) +if (!buf || buf_len <0 )return STATUS_FAIL ;rtsx_init_cmd (chip);
@@ -203,7 +203,7 @@ static int xd_read_cis(struct rtsx_chip *chip, u32 page_addr, u8 *buf,int retval;u8 reg; -if (!buf || (buf_len <10 )) +if (!buf || buf_len <10 )return STATUS_FAIL ;rtsx_init_cmd (chip);
@@ -713,7 +713,7 @@ static int reset_xd(struct rtsx_chip *chip) }/* Check CIS data */ -if ((redunt[BLOCK_STATUS ] ==XD_GBLK ) && +if (redunt[BLOCK_STATUS ] ==XD_GBLK && (redunt[PARITY ] &XD_BA1_ALL0 )) {u8 buf[10 ];
@@ -723,12 +723,12 @@ static int reset_xd(struct rtsx_chip *chip)if (retval !=STATUS_SUCCESS )return STATUS_FAIL ; -if ((buf[0 ] ==0x01 ) && (buf[1 ] ==0x03 ) && - (buf[2 ] ==0xD9 ) && - (buf[3 ] ==0x01 ) && (buf[4 ] ==0xFF ) && - (buf[5 ] ==0x18 ) && (buf[6 ] ==0x02 ) && - (buf[7 ] ==0xDF ) && (buf[8 ] ==0x01 ) && - (buf[9 ] ==0x20 )) { +if (buf[0 ] ==0x01 && buf[1 ] ==0x03 && + buf[2 ] ==0xD9 && + buf[3 ] ==0x01 && buf[4 ] ==0xFF && + buf[5 ] ==0x18 && buf[6 ] ==0x02 && + buf[7 ] ==0xDF && buf[8 ] ==0x01 && + buf[9 ] ==0x20 ) { xd_card->cis_block = (u16 )i; } }
@@ -847,8 +847,8 @@ static void xd_set_unused_block(struct rtsx_chip *chip, u32 phy_blk)return ; } -if ((zone->set_index >=XD_FREE_TABLE_CNT ) || - (zone->set_index <0 )) { +if (zone->set_index >=XD_FREE_TABLE_CNT || + zone->set_index <0 ) {free_zone (zone);dev_dbg (rtsx_dev (chip),"Set unused block fail, invalid set_index\n" );return ;
@@ -876,13 +876,13 @@ static u32 xd_get_unused_block(struct rtsx_chip *chip, int zone_no) } zone = &xd_card->zone[zone_no]; -if ((zone->unused_blk_cnt ==0 ) || - (zone->set_index == zone->get_index)) { +if (zone->unused_blk_cnt ==0 || + zone->set_index == zone->get_index) {free_zone (zone);dev_dbg (rtsx_dev (chip),"Get unused block fail, no unused block available\n" );return BLK_NOT_FOUND ; } -if ((zone->get_index >=XD_FREE_TABLE_CNT ) || (zone->get_index <0 )) { +if (zone->get_index >=XD_FREE_TABLE_CNT || zone->get_index <0 ) {free_zone (zone);dev_dbg (rtsx_dev (chip),"Get unused block fail, invalid get_index\n" );return BLK_NOT_FOUND ;
@@ -1109,7 +1109,7 @@ static int xd_copy_page(struct rtsx_chip *chip, u32 old_blk, u32 new_blk,if (start_page > end_page)return STATUS_FAIL ; -if ((old_blk ==BLK_NOT_FOUND ) || (new_blk ==BLK_NOT_FOUND )) +if (old_blk ==BLK_NOT_FOUND || new_blk ==BLK_NOT_FOUND )return STATUS_FAIL ; old_page = (old_blk << xd_card->block_shift) + start_page;
@@ -1375,16 +1375,16 @@ static int xd_build_l2p_tbl(struct rtsx_chip *chip, int zone_no) } cur_fst_page_logoff =xd_load_log_block_addr (redunt); -if ((cur_fst_page_logoff ==0xFFFF ) || - (cur_fst_page_logoff > max_logoff)) { +if (cur_fst_page_logoff ==0xFFFF || + cur_fst_page_logoff > max_logoff) { retval =xd_erase_block (chip, i);if (retval ==STATUS_SUCCESS )xd_set_unused_block (chip, i);continue ; } -if ((zone_no ==0 ) && (cur_fst_page_logoff ==0 ) && - (redunt[PAGE_STATUS ] !=XD_GPG )) +if (zone_no ==0 && cur_fst_page_logoff ==0 && + redunt[PAGE_STATUS ] !=XD_GPG )XD_SET_MBR_FAIL (xd_card);if (zone->l2p_table[cur_fst_page_logoff] ==0xFFFF ) {
@@ -1874,8 +1874,8 @@ int xd_rw(struct scsi_cmnd *srb, struct rtsx_chip *chip,if (srb->sc_data_direction ==DMA_TO_DEVICE ) {#ifdef XD_DELAY_WRITE if (delay_write->delay_write_flag && - (delay_write->logblock == log_blk) && - (start_page > delay_write->pageoff)) { + delay_write->logblock == log_blk && + start_page > delay_write->pageoff) { delay_write->delay_write_flag =0 ;if (delay_write->old_phyblock !=BLK_NOT_FOUND ) { retval = xd_copy_page(chip,
@@ -1907,8 +1907,8 @@ int xd_rw(struct scsi_cmnd *srb, struct rtsx_chip *chip,#endif old_blk =xd_get_l2p_tbl (chip, zone_no, log_off); new_blk =xd_get_unused_block (chip, zone_no); -if ((old_blk ==BLK_NOT_FOUND ) || - (new_blk ==BLK_NOT_FOUND )) { +if (old_blk ==BLK_NOT_FOUND || + new_blk ==BLK_NOT_FOUND ) {set_sense_type (chip, lun,SENSE_TYPE_MEDIA_WRITE_ERR );return STATUS_FAIL ;
@@ -2034,7 +2034,7 @@ int xd_rw(struct scsi_cmnd *srb, struct rtsx_chip *chip, start_page =0 ; } -if ((srb->sc_data_direction ==DMA_TO_DEVICE ) && +if (srb->sc_data_direction ==DMA_TO_DEVICE && (end_page != (xd_card->page_off +1 ))) {#ifdef XD_DELAY_WRITE delay_write->delay_write_flag =1 ;
Signature · 1 line
2.31.1
PATCH 7/8 staging: rts5208: remove unnecessary parentheses in rtsx_scsi.c
In reply to Benjamin PhilipThis commit removes unnecessary parentheses, that have been flagged by checkpatch.pl in rtsx_scsi.c.
--- drivers/staging/rts5208/rtsx_scsi.c | 106 ++++++++++++++-------------- 1 file changed, 53 insertions(+), 53 deletions(-)
drivers/staging/rts5208/rtsx_scsi.c +53 -53
@@ -500,12 +500,12 @@ static int inquiry(struct scsi_cmnd *srb, struct rtsx_chip *chip)return TRANSPORT_ERROR ;#ifdef SUPPORT_MAGIC_GATE -if ((chip->mspro_formatter_enable) && +if (chip->mspro_formatter_enable && (chip->lun2card[lun] &MS_CARD )) #else if (chip->mspro_formatter_enable)#endif -if (!card || (card ==MS_CARD )) +if (!card || card ==MS_CARD ) pro_formatter_flag = true;if (pro_formatter_flag) {
@@ -754,7 +754,7 @@ static int mode_sense(struct scsi_cmnd *srb, struct rtsx_chip *chip) data_size =8 ;#ifdef SUPPORT_MAGIC_GATE if ((chip->lun2card[lun] &MS_CARD )) { -if (!card || (card ==MS_CARD )) { +if (!card || card ==MS_CARD ) { data_size =108 ;if (chip->mspro_formatter_enable) pro_formatter_flag = true;
@@ -775,11 +775,11 @@ static int mode_sense(struct scsi_cmnd *srb, struct rtsx_chip *chip) page_code = srb->cmnd[2 ] &0x3f ; -if ((page_code ==0x3F ) || (page_code ==0x1C ) || - (page_code ==0x00 ) || - (pro_formatter_flag && (page_code ==0x20 ))) { +if (page_code ==0x3F || page_code ==0x1C || + page_code ==0x00 || + (pro_formatter_flag && page_code ==0x20 )) {if (srb->cmnd[0 ] ==MODE_SENSE ) { -if ((page_code ==0x3F ) || (page_code ==0x20 )) { +if (page_code ==0x3F || page_code ==0x20 ) {ms_mode_sense (chip, srb->cmnd[0 ], lun, buf, data_size); }else {
@@ -794,7 +794,7 @@ static int mode_sense(struct scsi_cmnd *srb, struct rtsx_chip *chip) buf[3 ] =0x00 ; } }else { -if ((page_code ==0x3F ) || (page_code ==0x20 )) { +if (page_code ==0x3F || page_code ==0x20 ) {ms_mode_sense (chip, srb->cmnd[0 ], lun, buf, data_size); }else {
@@ -879,7 +879,7 @@ static int read_write(struct scsi_cmnd *srb, struct rtsx_chip *chip) }#endif -if ((srb->cmnd[0 ] ==READ_10 ) || (srb->cmnd[0 ] ==WRITE_10 )) { +if (srb->cmnd[0 ] ==READ_10 || srb->cmnd[0 ] ==WRITE_10 ) { start_sec = ((u32 )srb->cmnd[2 ] <<24 ) | ((u32 )srb->cmnd[3 ] <<16 ) | ((u32 )srb->cmnd[4 ] <<8 ) | ((u32 )srb->cmnd[5 ]);
@@ -906,7 +906,7 @@ static int read_write(struct scsi_cmnd *srb, struct rtsx_chip *chip)* In this situation, start_sec + sec_cnt will overflow, so we * need to judge start_sec at first */ -if ((start_sec >get_card_size (chip, lun)) || +if (start_sec >get_card_size (chip, lun) || ((start_sec + sec_cnt) >get_card_size (chip, lun))) {set_sense_type (chip, lun,SENSE_TYPE_MEDIA_LBA_OVER_RANGE );return TRANSPORT_FAILED ;
@@ -993,9 +993,9 @@ static int read_format_capacity(struct scsi_cmnd *srb, struct rtsx_chip *chip) buf[i++] =0 ;/* Capacity List Length */ -if ((buf_len >12 ) && chip->mspro_formatter_enable && +if (buf_len >12 && chip->mspro_formatter_enable && (chip->lun2card[lun] &MS_CARD ) && - (!card || (card ==MS_CARD ))) { + (!card || card ==MS_CARD )) { buf[i++] =0x10 ; desc_cnt =2 ; }else {
@@ -1569,7 +1569,7 @@ static int get_dev_status(struct scsi_cmnd *srb, struct rtsx_chip *chip)#ifdef SUPPORT_OCP status[8 ] =0 ;if (CHECK_LUN_MODE (chip,SD_MS_2LUN ) && - (chip->lun2card[lun] ==MS_CARD )) { + chip->lun2card[lun] ==MS_CARD ) { oc_now_mask =MS_OC_NOW ; oc_ever_mask =MS_OC_EVER ; }else {
@@ -2544,7 +2544,7 @@ static int get_card_bus_width(struct scsi_cmnd *srb, struct rtsx_chip *chip) } card =get_lun_card (chip, lun); -if ((card ==SD_CARD ) || (card ==MS_CARD )) { +if (card ==SD_CARD || card ==MS_CARD ) { bus_width = chip->card_bus_width[lun]; }else {set_sense_type (chip, lun,SENSE_TYPE_MEDIA_UNRECOVER_READ_ERR );
@@ -2685,7 +2685,7 @@ void led_shine(struct scsi_cmnd *srb, struct rtsx_chip *chip)unsigned int lun =SCSI_LUN (srb);u16 sec_cnt; -if ((srb->cmnd[0 ] ==READ_10 ) || (srb->cmnd[0 ] ==WRITE_10 )) { +if (srb->cmnd[0 ] ==READ_10 || srb->cmnd[0 ] ==WRITE_10 ) { sec_cnt = ((u16)(srb->cmnd[7 ]) <<8 ) | srb->cmnd[8 ]; }else if ((srb->cmnd[0 ] ==READ_6 ) || (srb->cmnd[0 ] ==WRITE_6 )) { sec_cnt = srb->cmnd[4 ];
@@ -2716,9 +2716,9 @@ static int ms_format_cmnd(struct scsi_cmnd *srb, struct rtsx_chip *chip)return TRANSPORT_FAILED ; } -if ((srb->cmnd[3 ] !=0x4D ) || (srb->cmnd[4 ] !=0x47 ) || - (srb->cmnd[5 ] !=0x66 ) || (srb->cmnd[6 ] !=0x6D ) || - (srb->cmnd[7 ] !=0x74 )) { +if (srb->cmnd[3 ] !=0x4D || srb->cmnd[4 ] !=0x47 || + srb->cmnd[5 ] !=0x66 || srb->cmnd[6 ] !=0x6D || + srb->cmnd[7 ] !=0x74 ) {set_sense_type (chip, lun,SENSE_TYPE_MEDIA_INVALID_CMD_FIELD );return TRANSPORT_FAILED ; }
@@ -2786,16 +2786,16 @@ static int get_ms_information(struct scsi_cmnd *srb, struct rtsx_chip *chip)return TRANSPORT_FAILED ; } -if ((srb->cmnd[2 ] !=0xB0 ) || (srb->cmnd[4 ] !=0x4D ) || - (srb->cmnd[5 ] !=0x53 ) || (srb->cmnd[6 ] !=0x49 ) || - (srb->cmnd[7 ] !=0x44 )) { +if (srb->cmnd[2 ] !=0xB0 || srb->cmnd[4 ] !=0x4D || + srb->cmnd[5 ] !=0x53 || srb->cmnd[6 ] !=0x49 || + srb->cmnd[7 ] !=0x44 ) {set_sense_type (chip, lun,SENSE_TYPE_MEDIA_INVALID_CMD_FIELD );return TRANSPORT_FAILED ; } dev_info_id = srb->cmnd[3 ]; -if ((CHK_MSXC (ms_card) && (dev_info_id ==0x10 )) || - (!CHK_MSXC (ms_card) && (dev_info_id ==0x13 )) || +if ((CHK_MSXC (ms_card) && dev_info_id ==0x10 ) || + (!CHK_MSXC (ms_card) && dev_info_id ==0x13 ) || !CHK_MSPRO (ms_card)) {set_sense_type (chip, lun,SENSE_TYPE_MEDIA_INVALID_CMD_FIELD );return TRANSPORT_FAILED ;
@@ -2846,7 +2846,7 @@ static int get_ms_information(struct scsi_cmnd *srb, struct rtsx_chip *chip) buf[i++] = data_len;/* Data length LSB */ /* Valid Bit */ buf[i++] =0x80 ; -if ((dev_info_id ==0x10 ) || (dev_info_id ==0x13 )) { +if (dev_info_id ==0x10 || dev_info_id ==0x13 ) {/* System Information */ memcpy (buf + i, ms_card->raw_sys_info,96 ); }else {
@@ -2978,8 +2978,8 @@ static int mg_report_key(struct scsi_cmnd *srb, struct rtsx_chip *chip)switch (key_format) {case KF_GET_LOC_EKB :if ((scsi_bufflen (srb) ==0x41C ) && - (srb->cmnd[8 ] ==0x04 ) && - (srb->cmnd[9 ] ==0x1C )) { + srb->cmnd[8 ] ==0x04 && + srb->cmnd[9 ] ==0x1C ) { retval =mg_get_local_EKB (srb, chip);if (retval !=STATUS_SUCCESS )return TRANSPORT_FAILED ;
@@ -2993,8 +2993,8 @@ static int mg_report_key(struct scsi_cmnd *srb, struct rtsx_chip *chip)case KF_RSP_CHG :if ((scsi_bufflen (srb) ==0x24 ) && - (srb->cmnd[8 ] ==0x00 ) && - (srb->cmnd[9 ] ==0x24 )) { + srb->cmnd[8 ] ==0x00 && + srb->cmnd[9 ] ==0x24 ) { retval =mg_get_rsp_chg (srb, chip);if (retval !=STATUS_SUCCESS )return TRANSPORT_FAILED ;
@@ -3009,12 +3009,12 @@ static int mg_report_key(struct scsi_cmnd *srb, struct rtsx_chip *chip)case KF_GET_ICV : ms_card->mg_entry_num = srb->cmnd[5 ];if ((scsi_bufflen (srb) ==0x404 ) && - (srb->cmnd[8 ] ==0x04 ) && - (srb->cmnd[9 ] ==0x04 ) && - (srb->cmnd[2 ] ==0x00 ) && - (srb->cmnd[3 ] ==0x00 ) && - (srb->cmnd[4 ] ==0x00 ) && - (srb->cmnd[5 ] <32 )) { + srb->cmnd[8 ] ==0x04 && + srb->cmnd[9 ] ==0x04 && + srb->cmnd[2 ] ==0x00 && + srb->cmnd[3 ] ==0x00 && + srb->cmnd[4 ] ==0x00 && + srb->cmnd[5 ] <32 ) { retval =mg_get_ICV (srb, chip);if (retval !=STATUS_SUCCESS )return TRANSPORT_FAILED ;
@@ -3081,8 +3081,8 @@ static int mg_send_key(struct scsi_cmnd *srb, struct rtsx_chip *chip)switch (key_format) {case KF_SET_LEAF_ID :if ((scsi_bufflen (srb) ==0x0C ) && - (srb->cmnd[8 ] ==0x00 ) && - (srb->cmnd[9 ] ==0x0C )) { + srb->cmnd[8 ] ==0x00 && + srb->cmnd[9 ] ==0x0C ) { retval =mg_set_leaf_id (srb, chip);if (retval !=STATUS_SUCCESS )return TRANSPORT_FAILED ;
@@ -3096,8 +3096,8 @@ static int mg_send_key(struct scsi_cmnd *srb, struct rtsx_chip *chip)case KF_CHG_HOST :if ((scsi_bufflen (srb) ==0x0C ) && - (srb->cmnd[8 ] ==0x00 ) && - (srb->cmnd[9 ] ==0x0C )) { + srb->cmnd[8 ] ==0x00 && + srb->cmnd[9 ] ==0x0C ) { retval =mg_chg (srb, chip);if (retval !=STATUS_SUCCESS )return TRANSPORT_FAILED ;
@@ -3111,8 +3111,8 @@ static int mg_send_key(struct scsi_cmnd *srb, struct rtsx_chip *chip)case KF_RSP_HOST :if ((scsi_bufflen (srb) ==0x0C ) && - (srb->cmnd[8 ] ==0x00 ) && - (srb->cmnd[9 ] ==0x0C )) { + srb->cmnd[8 ] ==0x00 && + srb->cmnd[9 ] ==0x0C ) { retval =mg_rsp (srb, chip);if (retval !=STATUS_SUCCESS )return TRANSPORT_FAILED ;
@@ -3127,12 +3127,12 @@ static int mg_send_key(struct scsi_cmnd *srb, struct rtsx_chip *chip)case KF_SET_ICV : ms_card->mg_entry_num = srb->cmnd[5 ];if ((scsi_bufflen (srb) ==0x404 ) && - (srb->cmnd[8 ] ==0x04 ) && - (srb->cmnd[9 ] ==0x04 ) && - (srb->cmnd[2 ] ==0x00 ) && - (srb->cmnd[3 ] ==0x00 ) && - (srb->cmnd[4 ] ==0x00 ) && - (srb->cmnd[5 ] <32 )) { + srb->cmnd[8 ] ==0x04 && + srb->cmnd[9 ] ==0x04 && + srb->cmnd[2 ] ==0x00 && + srb->cmnd[3 ] ==0x00 && + srb->cmnd[4 ] ==0x00 && + srb->cmnd[5 ] <32 ) { retval =mg_set_ICV (srb, chip);if (retval !=STATUS_SUCCESS )return TRANSPORT_FAILED ;
@@ -3168,10 +3168,10 @@ int rtsx_scsi_handler(struct scsi_cmnd *srb, struct rtsx_chip *chip)/* Block all SCSI command except for * REQUEST_SENSE and rs_ppstatus */ -if (!((srb->cmnd[0 ] ==VENDOR_CMND ) && - (srb->cmnd[1 ] ==SCSI_APP_CMD ) && - (srb->cmnd[2 ] ==GET_DEV_STATUS )) && - (srb->cmnd[0 ] !=REQUEST_SENSE )) { +if (!(srb->cmnd[0 ] ==VENDOR_CMND && + srb->cmnd[1 ] ==SCSI_APP_CMD && + srb->cmnd[2 ] ==GET_DEV_STATUS ) && + srb->cmnd[0 ] !=REQUEST_SENSE ) {/* Logical Unit Not Ready Format in Progress */ set_sense_data (chip, lun,CUR_ERR ,0x02 ,0 ,0x04 ,0x04 ,0 ,0 );
@@ -3181,9 +3181,9 @@ int rtsx_scsi_handler(struct scsi_cmnd *srb, struct rtsx_chip *chip)#endif if ((get_lun_card (chip, lun) ==MS_CARD ) && - (ms_card->format_status ==FORMAT_IN_PROGRESS )) { -if ((srb->cmnd[0 ] !=REQUEST_SENSE ) && - (srb->cmnd[0 ] !=INQUIRY )) { + ms_card->format_status ==FORMAT_IN_PROGRESS ) { +if (srb->cmnd[0 ] !=REQUEST_SENSE && + srb->cmnd[0 ] !=INQUIRY ) {/* Logical Unit Not Ready Format in Progress */ set_sense_data (chip, lun,CUR_ERR ,0x02 ,0 ,0x04 ,0x04 ,0 , (u16)(ms_card->progress));
Signature · 1 line
2.31.1
PATCH 8/8 staging: rts5208: remove parentheses pair in sd.c
In reply to Benjamin PhilipI had missed a single parentheses pair in the commit for sd.c. This commit removes the pair I missed.
--- drivers/staging/rts5208/sd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rts5208/sd.c +1 -1
@@ -1335,7 +1335,7 @@ static int sd_switch_function(struct rtsx_chip *chip, u8 bus_width)return STATUS_FAIL ; } -if (!func_to_switch || (func_to_switch ==HS_SUPPORT )) { +if (!func_to_switch || func_to_switch ==HS_SUPPORT ) {/* Do not try to switch current limit if the card doesn't * support UHS mode or we don't want it to support UHS mode */
Signature · 1 line
2.31.1