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: <2d4550f1-7097-4b97-94c4-b1c8a50e6946@linuxfoundation.org>
Date: Wed, 2 Oct 2024 16:18:19 -0600
From: Shuah Khan <skhan@...uxfoundation.org>
To: Sayyad Abid <sayyad.abid16@...il.com>, linux-m68k@...ts.linux-m68k.org
Cc: fthain@...ux-m68k.org, linux-kernel@...r.kernel.org,
 Shuah Khan <skhan@...uxfoundation.org>
Subject: Re: [PATCH 2/3] drivers: nubus: Fix use of assignment in if condition
 in nubus_add_board() in nubus.c

On 10/2/24 07:28, Sayyad Abid wrote:
> This change help improve code readabaility by
> shifting the assignment statement just above the if statment,
> which was earlier inside the condition.
> This makes the code clear and easy to read.
> 
> Signed-off-by: Sayyad Abid <sayyad.abid16@...il.com>
> ---
>   drivers/nubus/nubus.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/nubus/nubus.c b/drivers/nubus/nubus.c
> index 08cf585cb471..77da1d14a1db 100644
> --- a/drivers/nubus/nubus.c
> +++ b/drivers/nubus/nubus.c
> @@ -735,7 +735,8 @@ static void __init nubus_add_board(int slot, int bytelanes)
>   	nubus_rewind(&rp, FORMAT_BLOCK_SIZE, bytelanes);
> 
>   	/* Actually we should probably panic if this fails */
> -	if ((board = kzalloc(sizeof(*board), GFP_ATOMIC)) == NULL)
> +	board = kzalloc(sizeof(*board), GFP_ATOMIC)
> +	if (board == NULL)
>   		return;

The code is consistent with coding guidelines. There is no
need to change it.

>   	board->fblock = rp;
> 
> --
> 2.39.5
> 

thanks,
-- Shuah

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ