mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Shuah Khan <skhan@linuxfoundation.org>
To: Sayyad Abid <sayyad.abid16@gmail.com>, linux-m68k@lists.linux-m68k.org
Cc: fthain@linux-m68k.org, linux-kernel@vger.kernel.org,
	Shuah Khan <skhan@linuxfoundation.org>
Subject: Re: [PATCH 2/3] drivers: nubus: Fix use of assignment in if condition in nubus_add_board() in nubus.c
Date: Wed, 2 Oct 2024 16:18:19 -0600	[thread overview]
Message-ID: <2d4550f1-7097-4b97-94c4-b1c8a50e6946@linuxfoundation.org> (raw)
In-Reply-To: <20241002132820.402583-3-sayyad.abid16@gmail.com>

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@gmail.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

  reply	other threads:[~2024-10-02 22:18 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-02 13:28 [PATCH 0/3] drivers: nubus: Fix coding style issues " Sayyad Abid
2024-10-02 13:28 ` [PATCH 1/3] drivers: nubus: Fix use of tabs in nubus_get_vendorinfo and nubus_add_board " Sayyad Abid
2024-10-02 13:28 ` [PATCH 2/3] drivers: nubus: Fix use of assignment in if condition in nubus_add_board() " Sayyad Abid
2024-10-02 22:18   ` Shuah Khan [this message]
2024-10-03 10:53   ` kernel test robot
2024-10-02 13:28 ` [PATCH 3/3] drivers: nubus: Fix use of * in comment block " Sayyad Abid
2024-10-02 22:20 ` [PATCH 0/3] drivers: nubus: Fix coding style issues " Shuah Khan
2024-10-02 22:55 ` Finn Thain
2024-10-03  3:31   ` Sayyad Abid

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2d4550f1-7097-4b97-94c4-b1c8a50e6946@linuxfoundation.org \
    --to=skhan@linuxfoundation.org \
    --cc=fthain@linux-m68k.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-m68k@lists.linux-m68k.org \
    --cc=sayyad.abid16@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®