From: Rouven Czerwinski Date: Mon, 26 Jan 2026 10:11:25 +0000 (+0100) Subject: hwrng: optee - simplify OP-TEE context match X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3cd3059af122faa3cc58dddacbc86d46e654c757;p=thirdparty%2Fkernel%2Flinux.git hwrng: optee - simplify OP-TEE context match Simplify the TEE implementor ID match by returning the boolean expression directly instead of going through an if/else. Signed-off-by: Rouven Czerwinski Signed-off-by: Herbert Xu --- diff --git a/drivers/char/hw_random/optee-rng.c b/drivers/char/hw_random/optee-rng.c index 96b5d546d136a..1cb741a6d112b 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)