linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] HID: amd_sfh: Use amd_sfh_clear_intr(mp2) call only once in sfh_init_work()
@ 2024-09-18 11:20 Markus Elfring
  0 siblings, 0 replies; only message in thread
From: Markus Elfring @ 2024-09-18 11:20 UTC (permalink / raw)
  To: linux-input, Basavaraj Natikar, Benjamin Tissoires, Jiri Kosina; +Cc: LKML

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Wed, 18 Sep 2024 13:11:00 +0200

A amd_sfh_clear_intr(mp2) call was immediately used after a return code
check for a amd_sfh_hid_client_init() call in this function implementation.
Thus use such a function call only once instead directly before the check.

This issue was transformed by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/hid/amd-sfh-hid/amd_sfh_pcie.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c b/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c
index 0c28ca349bcd..2322555e5181 100644
--- a/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c
+++ b/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c
@@ -350,13 +350,12 @@ static void sfh_init_work(struct work_struct *work)
 	int rc;

 	rc = amd_sfh_hid_client_init(mp2);
+	amd_sfh_clear_intr(mp2);
 	if (rc) {
-		amd_sfh_clear_intr(mp2);
 		dev_err(&pdev->dev, "amd_sfh_hid_client_init failed err %d\n", rc);
 		return;
 	}

-	amd_sfh_clear_intr(mp2);
 	mp2->init_done = 1;
 }

--
2.46.0


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2024-09-18 11:20 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-18 11:20 [PATCH] HID: amd_sfh: Use amd_sfh_clear_intr(mp2) call only once in sfh_init_work() Markus Elfring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).