On Fri, Jan 09, 2026 at 03:44:42PM +0000, Colin Ian King wrote:
Don't populate the read-only array attr on the stack at run time, instead make it static const.
Is there any value add to do this? AFAIK, the static local variables aren't preffered.
-Sumit
Signed-off-by: Colin Ian King coking@nvidia.com
drivers/tee/optee/rpc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/tee/optee/rpc.c b/drivers/tee/optee/rpc.c index 97fc5b14db0c..1758eb7e6e8b 100644 --- a/drivers/tee/optee/rpc.c +++ b/drivers/tee/optee/rpc.c @@ -43,7 +43,7 @@ static void handle_rpc_func_cmd_i2c_transfer(struct tee_context *ctx, struct i2c_msg msg = { }; size_t i; int ret = -EOPNOTSUPP;
- u8 attr[] = {
- static const u8 attr[] = { TEE_IOCTL_PARAM_ATTR_TYPE_VALUE_INPUT, TEE_IOCTL_PARAM_ATTR_TYPE_VALUE_INPUT, TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_INOUT,
-- 2.51.0