[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250812130154.2220684-1-darshanrathod475@gmail.com>
Date: Tue, 12 Aug 2025 18:31:54 +0530
From: darshanrathod475@...il.com
To: bp@...en8.de,
tony.luck@...el.com
Cc: james.morse@....com,
mchehab@...nel.org,
rric@...nel.org,
linux-edac@...r.kernel.org,
linux-kernel@...r.kernel.org,
Darshan Rathod <darshanrathod475@...il.com>
Subject: [PATCH] edac/amd76x: Remove assignment from if condition in amd76x_remove_one()
From: Darshan Rathod <darshanrathod475@...il.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@...il.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
Powered by blists - more mailing lists