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

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;
 	board->fblock = rp;

--
2.39.5


  parent reply	other threads:[~2024-10-02 13:28 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 ` Sayyad Abid [this message]
2024-10-02 22:18   ` [PATCH 2/3] drivers: nubus: Fix use of assignment in if condition in nubus_add_board() " Shuah Khan
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=20241002132820.402583-3-sayyad.abid16@gmail.com \
    --to=sayyad.abid16@gmail.com \
    --cc=fthain@linux-m68k.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-m68k@lists.linux-m68k.org \
    --cc=skhan@linuxfoundation.org \
    /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®