diff mbox

[1/6] scsi: ufs: make ufshcd_is_{device_present,hba_active}() return bool

Message ID 20170328134929.25599-1-tkusumi@tuxera.com (mailing list archive)
State Accepted, archived
Headers show

Commit Message

Tomohiro Kusumi March 28, 2017, 1:49 p.m. UTC
From: Tomohiro Kusumi <tkusumi@tuxera.com>

ufshcd driver generally uses bool for is_xxx type things instead of int,
so conform to its style.

Signed-off-by: Tomohiro Kusumi <tkusumi@tuxera.com>
---
 drivers/scsi/ufs/ufshcd.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

Comments

subhashj@codeaurora.org March 29, 2017, 4:59 a.m. UTC | #1
On 2017-03-28 06:49, kusumi.tomohiro@gmail.com wrote:
> From: Tomohiro Kusumi <tkusumi@tuxera.com>
> 
> ufshcd driver generally uses bool for is_xxx type things instead of 
> int,
> so conform to its style.
> 
> Signed-off-by: Tomohiro Kusumi <tkusumi@tuxera.com>
> ---
>  drivers/scsi/ufs/ufshcd.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
> index b7e5128..b006f1e 100644
> --- a/drivers/scsi/ufs/ufshcd.c
> +++ b/drivers/scsi/ufs/ufshcd.c
> @@ -585,12 +585,12 @@ static inline u32 ufshcd_get_ufs_version(struct
> ufs_hba *hba)
>   *			      the host controller
>   * @hba: pointer to adapter instance
>   *
> - * Returns 1 if device present, 0 if no device detected
> + * Returns true if device present, false if no device detected
>   */
> -static inline int ufshcd_is_device_present(struct ufs_hba *hba)
> +static inline bool ufshcd_is_device_present(struct ufs_hba *hba)
>  {
>  	return (ufshcd_readl(hba, REG_CONTROLLER_STATUS) &
> -						DEVICE_PRESENT) ? 1 : 0;
> +						DEVICE_PRESENT) ? true : false;
>  }
> 
>  /**
> @@ -832,11 +832,11 @@ static inline void ufshcd_hba_start(struct 
> ufs_hba *hba)
>   * ufshcd_is_hba_active - Get controller state
>   * @hba: per adapter instance
>   *
> - * Returns zero if controller is active, 1 otherwise
> + * Returns false if controller is active, true otherwise
>   */
> -static inline int ufshcd_is_hba_active(struct ufs_hba *hba)
> +static inline bool ufshcd_is_hba_active(struct ufs_hba *hba)
>  {
> -	return (ufshcd_readl(hba, REG_CONTROLLER_ENABLE) & 0x1) ? 0 : 1;
> +	return (ufshcd_readl(hba, REG_CONTROLLER_ENABLE) & 0x1) ? false : 
> true;
>  }
> 
>  static const char *ufschd_uic_link_state_to_string(

Looks good to me.
Reviewed-by: Subhash Jadavani <subhashj@codeaurora.org>
Martin K. Petersen March 30, 2017, 2:44 a.m. UTC | #2
kusumi.tomohiro@gmail.com writes:

> ufshcd driver generally uses bool for is_xxx type things instead of int,
> so conform to its style.

Applied patches 1-6 to 4.12/scsi-queue.

Thanks!
diff mbox

Patch

diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index b7e5128..b006f1e 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -585,12 +585,12 @@  static inline u32 ufshcd_get_ufs_version(struct ufs_hba *hba)
  *			      the host controller
  * @hba: pointer to adapter instance
  *
- * Returns 1 if device present, 0 if no device detected
+ * Returns true if device present, false if no device detected
  */
-static inline int ufshcd_is_device_present(struct ufs_hba *hba)
+static inline bool ufshcd_is_device_present(struct ufs_hba *hba)
 {
 	return (ufshcd_readl(hba, REG_CONTROLLER_STATUS) &
-						DEVICE_PRESENT) ? 1 : 0;
+						DEVICE_PRESENT) ? true : false;
 }
 
 /**
@@ -832,11 +832,11 @@  static inline void ufshcd_hba_start(struct ufs_hba *hba)
  * ufshcd_is_hba_active - Get controller state
  * @hba: per adapter instance
  *
- * Returns zero if controller is active, 1 otherwise
+ * Returns false if controller is active, true otherwise
  */
-static inline int ufshcd_is_hba_active(struct ufs_hba *hba)
+static inline bool ufshcd_is_hba_active(struct ufs_hba *hba)
 {
-	return (ufshcd_readl(hba, REG_CONTROLLER_ENABLE) & 0x1) ? 0 : 1;
+	return (ufshcd_readl(hba, REG_CONTROLLER_ENABLE) & 0x1) ? false : true;
 }
 
 static const char *ufschd_uic_link_state_to_string(