mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Cc: Lars-Peter Clausen <lars@metafoo.de>,
	linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org,
	linux-iio@vger.kernel.org
Subject: Re: [PATCH] iio: proximity: aw96103: Constify struct iio_info
Date: Sat, 7 Dec 2024 17:55:16 +0000	[thread overview]
Message-ID: <20241207175516.4b611eea@jic23-huawei> (raw)
In-Reply-To: <da4918af46fef03903ab0e9fdcb4f23e014f3821.1733522812.git.christophe.jaillet@wanadoo.fr>

On Fri,  6 Dec 2024 23:07:23 +0100
Christophe JAILLET <christophe.jaillet@wanadoo.fr> wrote:

> 'struct iio_info' is not modified in this driver.
> 
> Constifying this structure moves some data to a read-only section, so
> increase overall security, especially when the structure holds some
> function pointers.
> 
> On a x86_64, with allmodconfig:
> Before:
> ======
>    text	   data	    bss	    dec	    hex	filename
>   17366	   1454	     16	  18836	   4994	drivers/iio/proximity/aw96103.o
> 
> After:
> =====
>    text	   data	    bss	    dec	    hex	filename
>   17526	   1294	     16	  18836	   4994	drivers/iio/proximity/aw96103.o
> 
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Applied. Thanks
Jonathan

> ---
> Compile tested only
> ---
>  drivers/iio/proximity/aw96103.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/proximity/aw96103.c b/drivers/iio/proximity/aw96103.c
> index cdd254da9e50..3472a2c36e44 100644
> --- a/drivers/iio/proximity/aw96103.c
> +++ b/drivers/iio/proximity/aw96103.c
> @@ -433,7 +433,7 @@ static int aw96103_write_event_config(struct iio_dev *indio_dev,
>  				  state ? BIT(chan->channel) : 0);
>  }
>  
> -static struct iio_info iio_info = {
> +static const struct iio_info iio_info = {
>  	.read_raw = aw96103_read_raw,
>  	.read_event_value = aw96103_read_event_val,
>  	.write_event_value = aw96103_write_event_val,


      reply	other threads:[~2024-12-07 17:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-06 22:07 [PATCH] iio: proximity: aw96103: Constify struct iio_info​ Christophe JAILLET
2024-12-07 17:55 ` Jonathan Cameron [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=20241207175516.4b611eea@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=christophe.jaillet@wanadoo.fr \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.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

all inboxes | Powered by JetHome®