mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2 1/3] firmware: qcom: uefisecapp: Simplify mutex with guard
@ 2026-02-16  9:15 Krzysztof Kozlowski
  2026-02-16  9:15 ` [PATCH v2 2/3] firmware: qcom: uefisecapp: Annotate acquiring locks for context tracking Krzysztof Kozlowski
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Krzysztof Kozlowski @ 2026-02-16  9:15 UTC (permalink / raw)
  To: Maximilian Luz, Bjorn Andersson, Konrad Dybcio,
	Nathan Chancellor, Nick Desaulniers, Bill Wendling, Justin Stitt,
	linux-arm-msm, linux-kernel, llvm
  Cc: Krzysztof Kozlowski

Simplify error path unlocking mutex with the guard.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>

---

Changes in v2:
None
---
 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-03-18 13:50 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-02-16  9:15 [PATCH v2 1/3] firmware: qcom: uefisecapp: Simplify mutex with guard Krzysztof Kozlowski
2026-02-16  9:15 ` [PATCH v2 2/3] firmware: qcom: uefisecapp: Annotate acquiring locks for context tracking Krzysztof Kozlowski
2026-02-16 11:11   ` Konrad Dybcio
2026-02-16  9:15 ` [PATCH v2 3/3] firmware: qcom: scom: Simplify mutex with guard Krzysztof Kozlowski
2026-02-16 11:11   ` Konrad Dybcio
2026-02-16 11:10 ` [PATCH v2 1/3] firmware: qcom: uefisecapp: " Konrad Dybcio
2026-03-18 13:50 ` (subset) " Bjorn Andersson

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®