From: Michael Tretter <m.tretter@pengutronix.de>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Cc: Pengutronix Kernel Team <kernel@pengutronix.de>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org,
linux-media@vger.kernel.org
Subject: Re: [PATCH] media: platform: allegro-dvt: Constify struct regmap_config
Date: Wed, 8 May 2024 11:00:21 +0200 [thread overview]
Message-ID: <Zjs_Jcin0QJ54luy@pengutronix.de> (raw)
In-Reply-To: <01b9b16b2f86f4d16d9871a29dcda9245512a1f7.1714894086.git.christophe.jaillet@wanadoo.fr>
On Sun, 05 May 2024 09:28:25 +0200, Christophe JAILLET wrote:
> 'allegro_regmap_config' and 'allegro_sram_config' are not modified in this
> diver and are only used as a const struct regmap_config.
>
> Constifying these structures moves some data to a read-only section, so
> increase overall security.
>
> On a x86_64, with allmodconfig:
> Before:
> text data bss dec hex filename
> 79587 3706 116 83409 145d1 drivers/media/platform/allegro-dvt/allegro-core.o
>
> After:
> text data bss dec hex filename
> 80219 3066 116 83401 145c9 drivers/media/platform/allegro-dvt/allegro-core.o
>
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Michael Tretter <m.tretter@pengutronix.de>
> ---
> drivers/media/platform/allegro-dvt/allegro-core.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/media/platform/allegro-dvt/allegro-core.c b/drivers/media/platform/allegro-dvt/allegro-core.c
> index da61f9beb6b4..1a19fef62e81 100644
> --- a/drivers/media/platform/allegro-dvt/allegro-core.c
> +++ b/drivers/media/platform/allegro-dvt/allegro-core.c
> @@ -179,7 +179,7 @@ struct allegro_dev {
> struct list_head channels;
> };
>
> -static struct regmap_config allegro_regmap_config = {
> +static const struct regmap_config allegro_regmap_config = {
> .name = "regmap",
> .reg_bits = 32,
> .val_bits = 32,
> @@ -188,7 +188,7 @@ static struct regmap_config allegro_regmap_config = {
> .cache_type = REGCACHE_NONE,
> };
>
> -static struct regmap_config allegro_sram_config = {
> +static const struct regmap_config allegro_sram_config = {
> .name = "sram",
> .reg_bits = 32,
> .val_bits = 32,
> --
> 2.45.0
>
>
prev parent reply other threads:[~2024-05-08 9:00 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-05 7:28 [PATCH] media: platform: allegro-dvt: Constify struct regmap_config Christophe JAILLET
2024-05-08 9:00 ` Michael Tretter [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Zjs_Jcin0QJ54luy@pengutronix.de \
--to=m.tretter@pengutronix.de \
--cc=christophe.jaillet@wanadoo.fr \
--cc=kernel-janitors@vger.kernel.org \
--cc=kernel@pengutronix.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).