From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5452D2E5437 for ; Mon, 12 Jan 2026 15:15:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.54 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768230924; cv=none; b=qZ5eCgumqGYyrbKkCVD/lIj2C3XUTywF+fq+BsTe3jethJ+bT1I4Zi+EfU/33ae2qwQojwymUd9YAtk02h7aUqYnXA70H2kPvJQlLMFGP/RW3qQMKLkrcyZ/q+DdIbbMLTJSCd72NRcQEyotU+L/52rFOvfuhQBxhAEHINhGxWw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768230924; c=relaxed/simple; bh=h6QudfM+BEqfTeHE7YkRJO0iiai84hHMZjRpU5X0XBs=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=iQZCXB04soD8I1AkKYgdxXK2FjIL0vQxn9vd4AZAssO1btCHjAXMas3UKw1EBiVHZl08vBJhp83KBZu0kb7iVfaICPAKuWs+kRdC0ALjha4pfIWhgAysHs3/7F+MZhaJRFhXWmX3aiHyTmUQLqd4VYGI25qKnx5nNGfBSun6/6g= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=MDRdIALF; arc=none smtp.client-ip=209.85.128.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="MDRdIALF" Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-4779cb0a33fso70337105e9.0 for ; Mon, 12 Jan 2026 07:15:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1768230922; x=1768835722; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=B9FXlOztAQ3v1foaiiiFEOmTKWgsDAmfXBn5g4N5tkI=; b=MDRdIALF7t8MXo6oF6WgMPBTdx1ByRCL6Z7NlLMt66q8Uu/3LP0/X+IQPwF+TLLQ8+ Oi6SAE1N5dqRSy/re0vr2sxoA0JI7ibG8Id3HkrmmNpakY6SpDZhxWQT94trxIo5WNTn bkcTgb+qyP4GGWoFEKrS3L7AcDDi+3SbFS2kulvFenNil8gXAMBpDTl5RjQSoUj73RWk YhCaGq5ghTpVkXvRiOs7v63mdB0lbviXssOHHSnypfpd4wAuZ0Up5Jx7tF2GT7/Ic9HS RUdnvIaO3a6VQmKFu5TuXO+ZsTNpZac8HODVB0y5SYmC8UjbxyLIDNuhXoTwq2hpjIQ5 41Tw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768230922; x=1768835722; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=B9FXlOztAQ3v1foaiiiFEOmTKWgsDAmfXBn5g4N5tkI=; b=RDA+Dhe+JsII1YyoK3QwQbx1DPqmMoRhcV1RlvsFOpK1iNQdMZ2R86kA+ZDJOomPjV egNjtgd2Iv/l79FDrjWyIHWSft/544ZZPYsOvYbfKsn/B082h0nsmtBzwRViDalI0S9F V74BIFJHn+gag2Ws1GB59TDMhg2lq3iAxzTVsqds6g7i3kVfA2msb3za3UHwlpAZ4mNp NwnLOf65nkOZYgQacnZQw4j3crj5yixxTlFvxaaFxRsj00IiCu2Q/qWus/Ma8E6nvsMS ibyZ0rGa+KA21qYx+q7pcm/Uo9VnqsYxc7YaZTxMlryWDu7LmvGrZamngwG//KjmuvVf GOWQ== X-Forwarded-Encrypted: i=1; AJvYcCUn5jB7FK7liRaVSqzxE8fGaz7Wiv2mprxmJXtcj56dmc/tAlislRDak3b5+AkoYVuuK41b9U1zS9ZxtJc=@vger.kernel.org X-Gm-Message-State: AOJu0Yzcgi95+9Jrs8lvTr0RxvAfOXyoR9BZlh2v75+hgN0OdZA4lQKZ cU+QOTMPrOXz6ugOFo+jCyCpCGggt0eK/xKNznW1C6Xg0WWJ8U3jf5AEjwsdoz5pbZQ= X-Gm-Gg: AY/fxX7XYwli2UYuEksk8WcxtfeWfjsYyz1Hj1vsvi2yV4VM58orwfmofbIxflbJgpm vj9DSDOuULjyREIls6ezfP6CH67e16Yy/rKCSt+AT6x67PI+F6CCAkv4UiaakvJq2UR3FItupto mM/I1h4pd6pKMdPJz5Dw9KAIHAz+ICrEGlTmBDZTqRV0ypgCPQMr8cWyMj1qc2Zh0ICAUttrD/6 7KsIBg7FhyxmX79wo2Oy0Ml49NGOQpG3lRhYMAoIKwSkVgm03pHkEbZTvPf3Q8i1aMtitR8DjtD I/oi8jEQOej9prLINs3rIHuLA5I1tPi4qtp8m6J0fYzQip4+HPVUXo/VSPJDhmIfRy2Ox3fXDh5 1m/e7sE20Jd7rfLQ/LJZjumDxKcHyg1cExmfqOJj94y6yMxRMniwfcNDsgCh4raTIqY2IK/+L2D NLDu4RZC8W2KXgtpom X-Google-Smtp-Source: AGHT+IFO0yPg5n5oM2epf+jZFSWNft4b56dzwR4qk5iFKZhjsdfcK/zEf81nvYnre7YVzrIgmZde6g== X-Received: by 2002:a05:600c:4ed3:b0:47d:6140:3284 with SMTP id 5b1f17b1804b1-47d88fc1df4mr187863785e9.37.1768230921406; Mon, 12 Jan 2026 07:15:21 -0800 (PST) Received: from localhost ([196.207.164.177]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-432bd5dfa07sm38984778f8f.25.2026.01.12.07.15.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jan 2026 07:15:21 -0800 (PST) Date: Mon, 12 Jan 2026 18:15:17 +0300 From: Dan Carpenter To: Sumit Garg Cc: Colin Ian King , Jens Wiklander , op-tee@lists.trustedfirmware.org, kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH][next] optee: make read-only array attr static const Message-ID: References: <20260109154442.421248-1-coking@nvidia.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Mon, Jan 12, 2026 at 04:56:10PM +0530, Sumit Garg wrote: > 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. > I have never heard that static local variables aren't prefered. I imagine that because they're often not thread safe? But if they're const thread safeness isn't an problem. Generally, we prefer the scope as local as possible. regards, dan carpenter