]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
rtc: optee: simplify OP-TEE context match
authorRouven Czerwinski <rouven.czerwinski@linaro.org>
Mon, 26 Jan 2026 10:11:26 +0000 (11:11 +0100)
committerAlexandre Belloni <alexandre.belloni@bootlin.com>
Fri, 20 Feb 2026 22:12:10 +0000 (23:12 +0100)
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@linaro.org>
Link: https://patch.msgid.link/20260126-optee-simplify-context-match-v1-3-d4104e526cb6@linaro.org
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
drivers/rtc/rtc-optee.c

index 184c6d14280163eb981eb461a8e4c7b5f2fcad46..2f18be3de6847aeef700890bc31bdd0f8f88c2ca 100644 (file)
@@ -541,10 +541,7 @@ static int optee_rtc_read_info(struct device *dev, struct rtc_device *rtc,
 
 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_rtc_probe(struct device *dev)