lkml.org 
[lkml]   [2023]   [Aug]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [RESEND PATCH v3 2/2] ufs: poll HCS.UCRDY before issuing a UIC command
From
On 17/08/23 18:02, Bart Van Assche wrote:
> 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;
>

Either is fine, otherwise:

Reviewed-by: Adrian Hunter <adrian.hunter@intel.com>

\
 
 \ /
  Last update: 2023-08-17 18:23    [W:0.039 / U:0.224 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site