[PATCH] edac/amd76x: Remove assignment from if condition in amd76x_remove_one()
From: darshanrathod475
Date: Tue Aug 12 2025 - 09:10:20 EST
From: Darshan Rathod <darshanrathod475@xxxxxxxxx>
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@xxxxxxxxx>
---
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