All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bart Van Assche <bvanassche@acm.org>
To: Adrian Hunter <adrian.hunter@intel.com>,
	Kiwoong Kim <kwmad.kim@samsung.com>,
	linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
	alim.akhtar@samsung.com, avri.altman@wdc.com, jejb@linux.ibm.com,
	martin.petersen@oracle.com, beanhuo@micron.com,
	sc.suh@samsung.com, hy50.seo@samsung.com, sh425.lee@samsung.com,
	kwangwon.min@samsung.com, junwoo80.lee@samsung.com,
	wkon.kim@samsung.com
Subject: Re: [RESEND PATCH v3 2/2] ufs: poll HCS.UCRDY before issuing a UIC command
Date: Thu, 17 Aug 2023 08:02:46 -0700	[thread overview]
Message-ID: <b9ade5d5-a160-5ecb-8dc5-777e8a586d51@acm.org> (raw)
In-Reply-To: <f1e154c4-bbb3-18a2-cb7a-41adae292b48@intel.com>

On 8/14/23 04:26, Adrian Hunter wrote:
> And perhaps the following is neater:
> 
> 	u32 val;
> 
> 	return !read_poll_timeout(ufshcd_readl, val, val & UIC_COMMAND_READY,
> 				  500, UIC_CMD_TIMEOUT * 1000, false, hba,
> 				  REG_CONTROLLER_STATUS);

Would the above make readers of that code wonder whether read_poll_timeout()
perhaps returns a boolean? Wouldn't it be better to test the
read_poll_timeout() return value as follows?

  	return read_poll_timeout(ufshcd_readl, val, val & UIC_COMMAND_READY,
  				  500, UIC_CMD_TIMEOUT * 1000, false, hba,
  				  REG_CONTROLLER_STATUS) == 0;

Thanks,

Bart.

  reply	other threads:[~2023-08-17 15:04 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20230802013848epcas2p3a896970d5bdc8e3f3e422c84c282a151@epcas2p3.samsung.com>
2023-08-02  1:28 ` [RESEND PATCH v3 0/2] change UIC command handling Kiwoong Kim
     [not found]   ` <CGME20230802013850epcas2p4a813b26e15c261d180ee3b46651e1534@epcas2p4.samsung.com>
2023-08-02  1:28     ` [RESEND PATCH v3 1/2] ufs: make __ufshcd_send_uic_cmd not wrapped by host_lock Kiwoong Kim
     [not found]   ` <CGME20230802013852epcas2p2334d33036d7d1a0bdbefaf5bb844928e@epcas2p2.samsung.com>
2023-08-02  1:28     ` [RESEND PATCH v3 2/2] ufs: poll HCS.UCRDY before issuing a UIC command Kiwoong Kim
2023-08-14 11:26       ` Adrian Hunter
2023-08-17 15:02         ` Bart Van Assche [this message]
2023-08-17 16:16           ` Adrian Hunter
2023-09-04  1:30 [RESEND PATCH v3 0/2] change UIC command handling Kiwoong Kim
     [not found] ` <CGME20230904014150epcas2p251f19c2220ec8938559bc2873e8e265a@epcas2p2.samsung.com>
2023-09-04  1:30   ` [RESEND PATCH v3 2/2] ufs: poll HCS.UCRDY before issuing a UIC command Kiwoong Kim

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=b9ade5d5-a160-5ecb-8dc5-777e8a586d51@acm.org \
    --to=bvanassche@acm.org \
    --cc=adrian.hunter@intel.com \
    --cc=alim.akhtar@samsung.com \
    --cc=avri.altman@wdc.com \
    --cc=beanhuo@micron.com \
    --cc=hy50.seo@samsung.com \
    --cc=jejb@linux.ibm.com \
    --cc=junwoo80.lee@samsung.com \
    --cc=kwangwon.min@samsung.com \
    --cc=kwmad.kim@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=sc.suh@samsung.com \
    --cc=sh425.lee@samsung.com \
    --cc=wkon.kim@samsung.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.