@@ -2406,7 +2406,7 @@ static inline bool ufshcd_ready_for_uic_cmd(struct ufs_hba *hba)
24062406 int ret = read_poll_timeout (ufshcd_readl , val , val & UIC_COMMAND_READY ,
24072407 500 , UIC_CMD_TIMEOUT * 1000 , false, hba ,
24082408 REG_CONTROLLER_STATUS );
2409- return ret == 0 ? true : false ;
2409+ return ret == 0 ;
24102410}
24112411
24122412/**
@@ -3728,7 +3728,7 @@ int ufshcd_read_string_desc(struct ufs_hba *hba, u8 desc_index,
37283728 */
37293729 ret = utf16s_to_utf8s (uc_str -> uc ,
37303730 uc_str -> len - QUERY_DESC_HDR_SIZE ,
3731- UTF16_BIG_ENDIAN , str , ascii_len );
3731+ UTF16_BIG_ENDIAN , str , ascii_len - 1 );
37323732
37333733 /* replace non-printable or non-ASCII characters with spaces */
37343734 for (i = 0 ; i < ret ; i ++ )
@@ -5615,13 +5615,13 @@ static void ufshcd_mcq_compl_pending_transfer(struct ufs_hba *hba,
56155615 * For those cmds of which the cqes are not present
56165616 * in the cq, complete them explicitly.
56175617 */
5618+ spin_lock_irqsave (& hwq -> cq_lock , flags );
56185619 if (cmd && !test_bit (SCMD_STATE_COMPLETE , & cmd -> state )) {
5619- spin_lock_irqsave (& hwq -> cq_lock , flags );
56205620 set_host_byte (cmd , DID_REQUEUE );
56215621 ufshcd_release_scsi_cmd (hba , lrbp );
56225622 scsi_done (cmd );
5623- spin_unlock_irqrestore (& hwq -> cq_lock , flags );
56245623 }
5624+ spin_unlock_irqrestore (& hwq -> cq_lock , flags );
56255625 } else {
56265626 ufshcd_mcq_poll_cqe_lock (hba , hwq );
56275627 }
0 commit comments