linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Subhash Jadavani <subhashj@codeaurora.org>
To: kusumi.tomohiro@gmail.com
Cc: martin.petersen@oracle.com, vinholikatti@gmail.com,
	linux-scsi@vger.kernel.org, Tomohiro Kusumi <tkusumi@tuxera.com>,
	linux-scsi-owner@vger.kernel.org
Subject: Re: [PATCH 1/6] scsi: ufs: make ufshcd_is_{device_present,hba_active}() return bool
Date: Tue, 28 Mar 2017 21:59:55 -0700	[thread overview]
Message-ID: <42401dd05e12b83079f642fd32556be1@codeaurora.org> (raw)
In-Reply-To: <20170328134929.25599-1-tkusumi@tuxera.com>

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>

-- 
The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

  parent reply	other threads:[~2017-03-29  4:59 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-28 13:49 [PATCH 1/6] scsi: ufs: make ufshcd_is_{device_present,hba_active}() return bool kusumi.tomohiro
2017-03-28 13:49 ` [PATCH 2/6] scsi: ufs: use existing macro CONTROLLER_ENABLE to test register bit kusumi.tomohiro
2017-03-29  5:02   ` Subhash Jadavani
2017-03-28 13:49 ` [PATCH 3/6] scsi: ufs: non functional macro fix kusumi.tomohiro
2017-03-29  5:03   ` Subhash Jadavani
2017-03-28 13:49 ` [PATCH 4/6] scsi: ufs: add missing macros for register bits from UFSHCI spec kusumi.tomohiro
2017-03-29  5:04   ` Subhash Jadavani
2017-03-28 13:49 ` [PATCH 5/6] scsi: ufs: remove deprecated enum for hw interrupt kusumi.tomohiro
2017-03-29  5:07   ` Subhash Jadavani
2017-03-28 13:49 ` [PATCH 6/6] scsi: ufs: just use sizeof() for snprintf() kusumi.tomohiro
2017-03-29  5:08   ` Subhash Jadavani
2017-03-29  4:59 ` Subhash Jadavani [this message]
2017-03-30  2:44 ` [PATCH 1/6] scsi: ufs: make ufshcd_is_{device_present,hba_active}() return bool Martin K. Petersen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=42401dd05e12b83079f642fd32556be1@codeaurora.org \
    --to=subhashj@codeaurora.org \
    --cc=kusumi.tomohiro@gmail.com \
    --cc=linux-scsi-owner@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=tkusumi@tuxera.com \
    --cc=vinholikatti@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).