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]
Date:   Fri, 15 Apr 2022 15:16:52 +0900
From:   Benjamin Poirier <benjamin.poirier@...il.com>
To:     Yihao Han <hanyihao@...o.com>, Wen Gong <quic_wgong@...cinc.com>
Cc:     Kalle Valo <kvalo@...nel.org>,
        "David S. Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>,
        Paolo Abeni <pabeni@...hat.com>, ath11k@...ts.infradead.org,
        linux-wireless@...r.kernel.org, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org, kernel@...o.com
Subject: Re: [PATCH] ath11k: simplify if-if to if-else

On 2022-04-14 02:20 -0700, Yihao Han wrote:
> Replace `if (!ab->is_reset)` with `else` for simplification
> and add curly brackets according to the kernel coding style:
> 
> "Do not unnecessarily use braces where a single statement will do."
> 
> ...
> 
> "This does not apply if only one branch of a conditional statement is
> a single statement; in the latter case use braces in both branches"
> 
> Please refer to:
> https://www.kernel.org/doc/html/v5.17-rc8/process/coding-style.html

Same comment about the curly brackets part of the log as for the qlcnic
patch, it doesn't match the changes.

> 
> Signed-off-by: Yihao Han <hanyihao@...o.com>
> ---
>  drivers/net/wireless/ath/ath11k/core.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/net/wireless/ath/ath11k/core.c b/drivers/net/wireless/ath/ath11k/core.c
> index cbac1919867f..80009482165a 100644
> --- a/drivers/net/wireless/ath/ath11k/core.c
> +++ b/drivers/net/wireless/ath/ath11k/core.c
> @@ -1532,8 +1532,7 @@ static void ath11k_core_restart(struct work_struct *work)
>  
>  	if (ab->is_reset)
>  		complete_all(&ab->reconfigure_complete);
> -
> -	if (!ab->is_reset)
> +	else
>  		ath11k_core_post_reconfigure_recovery(ab);
>  }

It seems there is no synchronization around is_reset but is it
guaranteed that it cannot be changed by ath11k_core_reset() between the
two tests? I'm not familiar with the driver.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ