mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Cc: Jagan Teki <jagan@amarulasolutions.com>,
	Andrzej Hajda <andrzej.hajda@intel.com>,
	Neil Armstrong <neil.armstrong@linaro.org>,
	Robert Foss <rfoss@kernel.org>, Jonas Karlman <jonas@kwiboo.se>,
	Jernej Skrabec <jernej.skrabec@gmail.com>,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Maxime Ripard <mripard@kernel.org>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
	Douglas Anderson <dianders@chromium.org>,
	linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org,
	dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] drm/bridge: Constify struct i2c_device_id
Date: Thu, 14 Nov 2024 13:06:58 +0200	[thread overview]
Message-ID: <20241114110658.GF26171@pendragon.ideasonboard.com> (raw)
In-Reply-To: <71348ac9-07bf-460f-a200-653f57ed4061@wanadoo.fr>

Hi Christophe,

On Wed, Nov 13, 2024 at 10:19:24PM +0100, Christophe JAILLET wrote:
> Le 12/11/2024 à 23:43, Laurent Pinchart a écrit :
> > On Tue, Nov 12, 2024 at 10:12:25PM +0100, Christophe JAILLET wrote:
> >> 'struct i2c_device_id' is not modified in these drivers.
> >>
> >> Constifying this structure moves some data to a read-only section, so
> >> increase overall security.
> >>
> >> On a x86_64, with allmodconfig, as an example:
> >> Before:
> >> ======
> >>     text	   data	    bss	    dec	    hex	filename
> >>    15566	    987	     32	  16585	   40c9	drivers/gpu/drm/bridge/chipone-icn6211.o
> >>
> >> After:
> >> =====
> >>     text	   data	    bss	    dec	    hex	filename
> >>    15630	    923	     32	  16585	   40c9	drivers/gpu/drm/bridge/chipone-icn6211.o
> >>
> >> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> >> ---
> >> Compile tested-only.
> >> ---
> >>   drivers/gpu/drm/bridge/chipone-icn6211.c   | 2 +-
> >>   drivers/gpu/drm/bridge/lontium-lt9211.c    | 2 +-
> >>   drivers/gpu/drm/bridge/lontium-lt9611.c    | 2 +-
> >>   drivers/gpu/drm/bridge/lontium-lt9611uxc.c | 2 +-
> >>   drivers/gpu/drm/bridge/ti-sn65dsi83.c      | 2 +-
> >>   drivers/gpu/drm/bridge/ti-sn65dsi86.c      | 2 +-
> > 
> > While at it, could you address drivers/gpu/drm/i2c/tda9950.c too ? If I
> > were to push a tad more, there are only two other drivers in the kernel
> > with the same issues outside of drivers/gpu/ according to
> 
> Hi Laurent,
> 
> this is in my todo list. I wanted to send it separately because all 
> these files are in gpu/drm/bridge/ and tda9950.c is in gpu/drm/.
> 
> Most of the times, maintainers ask for separate patches when several 
> drivers are patched. For such clean-ups, I try at least to group them by 
> directory.

I would probably have included tda9950.c in this patch, but I'm also
fine handling it separately.

> Same answer the other files in input and sound. Patches will be sent in 
> a few days.

Thank you. If you have extra time, there are also a handful of similar
issues with of_device_id :-)

> I've also sent one for the documentation [1] and will send one for 
> const_structs.checkpatch as well.

Thank you for that.

> CJ
> 
> [1]: https://lore.kernel.org/linux-kernel/c8e6da4adb7381ee27e8e11854c9d856382cdc93.1731445244.git.christophe.jaillet@wanadoo.fr/
> 
> > $ git grep '^static struct i2c_device_id'
> > drivers/gpu/drm/bridge/chipone-icn6211.c:static struct i2c_device_id chipone_i2c_id[] = {
> > drivers/gpu/drm/bridge/lontium-lt9211.c:static struct i2c_device_id lt9211_id[] = {
> > drivers/gpu/drm/bridge/lontium-lt9611.c:static struct i2c_device_id lt9611_id[] = {
> > drivers/gpu/drm/bridge/lontium-lt9611uxc.c:static struct i2c_device_id lt9611uxc_id[] = {
> > drivers/gpu/drm/bridge/ti-sn65dsi83.c:static struct i2c_device_id sn65dsi83_id[] = {
> > drivers/gpu/drm/bridge/ti-sn65dsi86.c:static struct i2c_device_id ti_sn65dsi86_id[] = {
> > drivers/gpu/drm/i2c/tda9950.c:static struct i2c_device_id tda9950_ids[] = {
> > drivers/input/keyboard/cypress-sf.c:static struct i2c_device_id cypress_sf_id_table[] = {
> > sound/soc/codecs/cs42l51-i2c.c:static struct i2c_device_id cs42l51_i2c_id[] = {
> > 
> > :-)
> > 
> > Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
> > 
> >>   6 files changed, 6 insertions(+), 6 deletions(-)

-- 
Regards,

Laurent Pinchart

  reply	other threads:[~2024-11-14 11:07 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-12 21:12 Christophe JAILLET
2024-11-12 22:29 ` Doug Anderson
2024-11-12 22:43 ` Laurent Pinchart
2024-11-13 21:19   ` Christophe JAILLET
2024-11-14 11:06     ` Laurent Pinchart [this message]
2024-11-20 23:18 ` Doug Anderson

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=20241114110658.GF26171@pendragon.ideasonboard.com \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=airlied@gmail.com \
    --cc=andrzej.hajda@intel.com \
    --cc=christophe.jaillet@wanadoo.fr \
    --cc=dianders@chromium.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jagan@amarulasolutions.com \
    --cc=jernej.skrabec@gmail.com \
    --cc=jonas@kwiboo.se \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=neil.armstrong@linaro.org \
    --cc=rfoss@kernel.org \
    --cc=simona@ffwll.ch \
    --cc=tzimmermann@suse.de \
    /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®