lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b9ade5d5-a160-5ecb-8dc5-777e8a586d51@acm.org>
Date:   Thu, 17 Aug 2023 08:02:46 -0700
From:   Bart Van Assche <bvanassche@....org>
To:     Adrian Hunter <adrian.hunter@...el.com>,
        Kiwoong Kim <kwmad.kim@...sung.com>,
        linux-scsi@...r.kernel.org, linux-kernel@...r.kernel.org,
        alim.akhtar@...sung.com, avri.altman@....com, jejb@...ux.ibm.com,
        martin.petersen@...cle.com, beanhuo@...ron.com, sc.suh@...sung.com,
        hy50.seo@...sung.com, sh425.lee@...sung.com,
        kwangwon.min@...sung.com, junwoo80.lee@...sung.com,
        wkon.kim@...sung.com
Subject: Re: [RESEND PATCH v3 2/2] ufs: poll HCS.UCRDY before issuing a UIC
 command

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.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ