]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
optee: simplify OP-TEE context match
authorRouven Czerwinski <rouven.czerwinski@linaro.org>
Mon, 26 Jan 2026 10:11:24 +0000 (11:11 +0100)
committerJens Wiklander <jens.wiklander@linaro.org>
Wed, 4 Mar 2026 07:33:31 +0000 (08:33 +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>
Reviewed-by: Sumit Garg <sumit.garg@oss.qualcomm.com>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
drivers/tee/optee/device.c

index bae954e79fdc1e23246b1075f49a87b6dfac5872..f751d743a120c484f94d26231d855a54686eafb7 100644 (file)
 
 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,