mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: darshanrathod475@gmail.com
To: bp@alien8.de, tony.luck@intel.com
Cc: james.morse@arm.com, mchehab@kernel.org, rric@kernel.org,
	linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org,
	Darshan Rathod <darshanrathod475@gmail.com>
Subject: [PATCH] edac/amd76x: Remove assignment from if condition in amd76x_remove_one()
Date: Tue, 12 Aug 2025 18:31:54 +0530	[thread overview]
Message-ID: <20250812130154.2220684-1-darshanrathod475@gmail.com> (raw)

From: Darshan Rathod <darshanrathod475@gmail.com>

The code was performing an assignment inside the if condition:

    if ((mci = edac_mc_del_mc(&pdev->dev)) == NULL)

This triggers a checkpatch.pl warning. Split the assignment and the
check into separate statements to improve readability and comply with
kernel coding style.

Signed-off-by: Darshan Rathod <darshanrathod475@gmail.com>
---
 drivers/edac/amd76x_edac.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/edac/amd76x_edac.c b/drivers/edac/amd76x_edac.c
index 2a49f68a7cf9..4937d8728cf0 100644
--- a/drivers/edac/amd76x_edac.c
+++ b/drivers/edac/amd76x_edac.c
@@ -324,7 +324,8 @@ static void amd76x_remove_one(struct pci_dev *pdev)
 	if (amd76x_pci)
 		edac_pci_release_generic_ctl(amd76x_pci);
 
-	if ((mci = edac_mc_del_mc(&pdev->dev)) == NULL)
+	mci = edac_mc_del_mc(&pdev->dev);
+	if (mci == NULL)
 		return;
 
 	edac_mc_free(mci);
-- 
2.25.1


             reply	other threads:[~2025-08-12 13:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-12 13:01 darshanrathod475 [this message]
2025-08-22 14:48 ` Borislav Petkov

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=20250812130154.2220684-1-darshanrathod475@gmail.com \
    --to=darshanrathod475@gmail.com \
    --cc=bp@alien8.de \
    --cc=james.morse@arm.com \
    --cc=linux-edac@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=rric@kernel.org \
    --cc=tony.luck@intel.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®