lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20260126-optee-simplify-context-match-v1-1-d4104e526cb6@linaro.org>
Date: Mon, 26 Jan 2026 11:11:24 +0100
From: Rouven Czerwinski via B4 Relay <devnull+rouven.czerwinski.linaro.org@...nel.org>
To: Jens Wiklander <jens.wiklander@...aro.org>, 
 Sumit Garg <sumit.garg@...nel.org>, Olivia Mackall <olivia@...enic.com>, 
 Herbert Xu <herbert@...dor.apana.org.au>, 
 Clément Léger <clement.leger@...tlin.com>, 
 Alexandre Belloni <alexandre.belloni@...tlin.com>
Cc: op-tee@...ts.trustedfirmware.org, linux-kernel@...r.kernel.org, 
 linux-crypto@...r.kernel.org, linux-rtc@...r.kernel.org, 
 Rouven Czerwinski <rouven.czerwinski@...aro.org>
Subject: [PATCH 1/3] optee: simplify OP-TEE context match

From: Rouven Czerwinski <rouven.czerwinski@...aro.org>

Simplify the TEE implementor ID match by returning the boolean
expression directly instead of going through an if/else.

Signed-off-by: Rouven Czerwinski <rouven.czerwinski@...aro.org>
---
 drivers/tee/optee/device.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/tee/optee/device.c b/drivers/tee/optee/device.c
index 950b4661d5df..4c85b04d6004 100644
--- a/drivers/tee/optee/device.c
+++ b/drivers/tee/optee/device.c
@@ -13,10 +13,7 @@
 
 static int optee_ctx_match(struct tee_ioctl_version_data *ver, const void *data)
 {
-	if (ver->impl_id == TEE_IMPL_ID_OPTEE)
-		return 1;
-	else
-		return 0;
+	return (ver->impl_id == TEE_IMPL_ID_OPTEE);
 }
 
 static int get_devices(struct tee_context *ctx, u32 session,

-- 
2.52.0



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ