mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/3] firmware: qcom: uefisecapp: Simplify mutex with guard
@ 2026-02-15 11:05 Krzysztof Kozlowski
  2026-02-15 11:05 ` [PATCH 2/3] firmware: qcom: uefisecapp: Annotate acquiring locks for sparse Krzysztof Kozlowski
  2026-02-15 11:05 ` [PATCH 3/3] firmware: qcom: scom: Simplify mutex with guard Krzysztof Kozlowski
  0 siblings, 2 replies; 7+ messages in thread
From: Krzysztof Kozlowski @ 2026-02-15 11:05 UTC (permalink / raw)
  To: Maximilian Luz, Bjorn Andersson, Konrad Dybcio, linux-arm-msm,
	linux-kernel
  Cc: Krzysztof Kozlowski

Simplify error path unlocking mutex with the guard.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
---
 drivers/firmware/qcom/qcom_qseecom_uefisecapp.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/firmware/qcom/qcom_qseecom_uefisecapp.c b/drivers/firmware/qcom/qcom_qseecom_uefisecapp.c
index 98a463e9774b..21be447374aa 100644
--- a/drivers/firmware/qcom/qcom_qseecom_uefisecapp.c
+++ b/drivers/firmware/qcom/qcom_qseecom_uefisecapp.c
@@ -699,16 +699,13 @@ static DEFINE_MUTEX(__qcuefi_lock);
 
 static int qcuefi_set_reference(struct qcuefi_client *qcuefi)
 {
-	mutex_lock(&__qcuefi_lock);
+	guard(mutex)(&__qcuefi_lock);
 
-	if (qcuefi && __qcuefi) {
-		mutex_unlock(&__qcuefi_lock);
+	if (qcuefi && __qcuefi)
 		return -EEXIST;
-	}
 
 	__qcuefi = qcuefi;
 
-	mutex_unlock(&__qcuefi_lock);
 	return 0;
 }
 
-- 
2.51.0


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

end of thread, other threads:[~2026-02-16  8:27 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-02-15 11:05 [PATCH 1/3] firmware: qcom: uefisecapp: Simplify mutex with guard Krzysztof Kozlowski
2026-02-15 11:05 ` [PATCH 2/3] firmware: qcom: uefisecapp: Annotate acquiring locks for sparse Krzysztof Kozlowski
2026-02-16  8:00   ` Johan Hovold
2026-02-16  8:14     ` Krzysztof Kozlowski
2026-02-16  8:20       ` Johan Hovold
2026-02-16  8:27         ` Krzysztof Kozlowski
2026-02-15 11:05 ` [PATCH 3/3] firmware: qcom: scom: Simplify mutex with guard Krzysztof Kozlowski

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®