Linux I2C development
 help / color / mirror / Atom feed
From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
To: Andi Shyti <andi.shyti@kernel.org>
Cc: Viresh Kumar <viresh.kumar@linaro.org>,
	"Chen, Jian Jun" <jian.jun.chen@intel.com>,
	linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org,
	linux-i2c@vger.kernel.org, virtualization@lists.linux.dev
Subject: Re: [PATCH] i2c: virtio: Constify struct i2c_algorithm and struct virtio_device_id
Date: Mon, 9 Sep 2024 21:38:09 +0200	[thread overview]
Message-ID: <c83a517b-2a48-4bbb-9946-e267238bd234@wanadoo.fr> (raw)
In-Reply-To: <cnetcfge6r7votsarnvk3dlqec4ufz3uyfkkf4wuhkxhlhw5wu@ckkns42r5psi>

Le 09/09/2024 à 20:54, Andi Shyti a écrit :
> Hi Christophe,
> 
> On Sun, Sep 08, 2024 at 08:52:07AM GMT, Christophe JAILLET wrote:
>> 'struct i2c_algorithm' and 'struct virtio_device_id' are 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, which is the case for struct i2c_algorithm.
>>
>> On a x86_64, with allmodconfig:
>> Before:
>> ======
>>     text	   data	    bss	    dec	    hex	filename
>>     6663	    568	     16	   7247	   1c4f	drivers/i2c/busses/i2c-virtio.o
>>
>> After:
>> =====
>>     text	   data	    bss	    dec	    hex	filename
>>     6735	    472	     16	   7223	   1c37	drivers/i2c/busses/i2c-virtio.o
>>
>> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
>> --
>> Compile tested only
> 
> Makes sense to me... if this works, you could pioneer a sequence
> of simiar changes :-)

Hi,

I already did some other ones [1]. A few more still need to be checked.

I'll finish it after ending struct regulator_desc that I'm currently 
looking at. [2]


[1]: https://lore.kernel.org/all/?q=%22Constify+struct+i2c_algorithm%22
[2]: https://lore.kernel.org/all/?q=%22Constify+struct+regulator_desc%22

> 
> Merged to i2c/i2c-host.

Thanks.
CJ

> 
> Thanks,
> Andi
> 
> 


      reply	other threads:[~2024-09-09 19:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-08  6:52 [PATCH] i2c: virtio: Constify struct i2c_algorithm and struct virtio_device_id Christophe JAILLET
2024-09-09 18:54 ` Andi Shyti
2024-09-09 19:38   ` Christophe JAILLET [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=c83a517b-2a48-4bbb-9946-e267238bd234@wanadoo.fr \
    --to=christophe.jaillet@wanadoo.fr \
    --cc=andi.shyti@kernel.org \
    --cc=jian.jun.chen@intel.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viresh.kumar@linaro.org \
    --cc=virtualization@lists.linux.dev \
    /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