[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20260126-optee-simplify-context-match-v1-2-d4104e526cb6@linaro.org>
Date: Mon, 26 Jan 2026 11:11:25 +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 2/3] hwrng: 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/char/hw_random/optee-rng.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/char/hw_random/optee-rng.c b/drivers/char/hw_random/optee-rng.c
index 96b5d546d136..1cb741a6d112 100644
--- a/drivers/char/hw_random/optee-rng.c
+++ b/drivers/char/hw_random/optee-rng.c
@@ -205,10 +205,7 @@ static int get_optee_rng_info(struct device *dev)
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 optee_rng_probe(struct device *dev)
--
2.52.0
Powered by blists - more mailing lists