]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
hwrng: optee - simplify OP-TEE context match
authorRouven Czerwinski <rouven.czerwinski@linaro.org>
Mon, 26 Jan 2026 10:11:25 +0000 (11:11 +0100)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 6 Feb 2026 10:52:22 +0000 (18:52 +0800)
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>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/char/hw_random/optee-rng.c

index 96b5d546d136adaecb5af8fd78b4afbb9aeee511..1cb741a6d112bec73eb4c97835920d106942b49a 100644 (file)
@@ -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)