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: <64aededf-7879-4246-8c1c-bc38ea47e05c@acm.org>
Date:   Tue, 24 Oct 2023 11:59:35 -0700
From:   Bart Van Assche <bvanassche@....org>
To:     Bragatheswaran Manickavel <bragathemanick0908@...il.com>,
        alim.akhtar@...sung.com, avri.altman@....com, jejb@...ux.ibm.com,
        martin.petersen@...cle.com, stanley.chu@...iatek.com,
        mani@...nel.org, quic_cang@...cinc.com, quic_asutoshd@...cinc.com,
        peter.wang@...iatek.com, beanhuo@...ron.com,
        quic_nguyenb@...cinc.com, Arthur.Simchaev@....com
Cc:     linux-scsi@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] ufs/core: ufshcd: Conversion to bool not necessary

On 10/24/23 11:34, Bragatheswaran Manickavel wrote:
> A logical evaluation already results in bool. There is no need for using
> a ternary operator based evaluation and bool conversion of the outcome.
> 
> Issue identified using boolconv.cocci Coccinelle semantic patch.
> 
> Signed-off-by: Bragatheswaran Manickavel <bragathemanick0908@...il.com>
> ---
>   drivers/ufs/core/ufshcd.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
> index 406885671665..bbd8e83be6c6 100644
> --- a/drivers/ufs/core/ufshcd.c
> +++ b/drivers/ufs/core/ufshcd.c
> @@ -2406,7 +2406,7 @@ static inline bool ufshcd_ready_for_uic_cmd(struct ufs_hba *hba)
>   	int ret = read_poll_timeout(ufshcd_readl, val, val & UIC_COMMAND_READY,
>   				    500, UIC_CMD_TIMEOUT * 1000, false, hba,
>   				    REG_CONTROLLER_STATUS);
> -	return ret == 0 ? true : false;
> +	return ret == 0;
>   }

Reviewed-by: Bart Van Assche <bvanassche@....org>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ