Linux EDAC development
 help / color / mirror / Atom feed
* [PATCH] edac/amd76x: Remove assignment from if condition in amd76x_remove_one()
@ 2025-08-12 13:01 darshanrathod475
  2025-08-22 14:48 ` Borislav Petkov
  0 siblings, 1 reply; 2+ messages in thread
From: darshanrathod475 @ 2025-08-12 13:01 UTC (permalink / raw)
  To: bp, tony.luck
  Cc: james.morse, mchehab, rric, linux-edac, linux-kernel,
	Darshan Rathod

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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-08-22 14:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-12 13:01 [PATCH] edac/amd76x: Remove assignment from if condition in amd76x_remove_one() darshanrathod475
2025-08-22 14:48 ` Borislav Petkov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox