diff options
author | Tomohiro Kusumi <tkusumi@tuxera.com> | 2017-04-26 20:28:58 +0300 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2017-04-26 18:14:18 -0400 |
commit | 6cf161150d815da0ee8cff158b185bc33dca3a34 (patch) | |
tree | 7ab1da4010eb1cc547601718135daea85f63f9be /drivers/scsi/ufs | |
parent | d7e2ddd5e502c93dc29114cf6de5fba339b28e4d (diff) | |
download | linux-6cf161150d815da0ee8cff158b185bc33dca3a34.tar.bz2 |
scsi: ufs: make ufshcd_get_lists_status() register operation obvious
It could be just cmp 0xe instead of >>1 and cmp 0x7, with readable code.
Signed-off-by: Tomohiro Kusumi <tkusumi@tuxera.com>
Reviewed-by: Subhash Jadavani <subhashj@codeaurora.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/ufs')
-rw-r--r-- | drivers/scsi/ufs/ufshcd.c | 11 | ||||
-rw-r--r-- | drivers/scsi/ufs/ufshci.h | 4 |
2 files changed, 5 insertions, 10 deletions
diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index 68d7d6fc9458..5793cd7ad371 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -673,16 +673,7 @@ static inline void ufshcd_outstanding_req_clear(struct ufs_hba *hba, int tag) */ static inline int ufshcd_get_lists_status(u32 reg) { - /* - * The mask 0xFF is for the following HCS register bits - * Bit Description - * 0 Device Present - * 1 UTRLRDY - * 2 UTMRLRDY - * 3 UCRDY - * 4-7 reserved - */ - return ((reg & 0xFF) >> 1) ^ 0x07; + return !((reg & UFSHCD_STATUS_READY) == UFSHCD_STATUS_READY); } /** diff --git a/drivers/scsi/ufs/ufshci.h b/drivers/scsi/ufs/ufshci.h index 88acfd3e21af..f60145d4a66e 100644 --- a/drivers/scsi/ufs/ufshci.h +++ b/drivers/scsi/ufs/ufshci.h @@ -160,6 +160,10 @@ enum { #define DEVICE_ERROR_INDICATOR UFS_BIT(5) #define UIC_POWER_MODE_CHANGE_REQ_STATUS_MASK UFS_MASK(0x7, 8) +#define UFSHCD_STATUS_READY (UTP_TRANSFER_REQ_LIST_READY |\ + UTP_TASK_REQ_LIST_READY |\ + UIC_COMMAND_READY) + enum { PWR_OK = 0x0, PWR_LOCAL = 0x01, |