public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] auxdisplay: img-ascii-lcd: Remove an unused field in struct img_ascii_lcd_ctx
@ 2024-12-06 22:25 Christophe JAILLET
  2024-12-06 22:25 ` [PATCH 2/2] auxdisplay: img-ascii-lcd: Constify struct img_ascii_lcd_config Christophe JAILLET
  2024-12-09  8:54 ` [PATCH 1/2] auxdisplay: img-ascii-lcd: Remove an unused field in struct img_ascii_lcd_ctx Geert Uytterhoeven
  0 siblings, 2 replies; 6+ messages in thread
From: Christophe JAILLET @ 2024-12-06 22:25 UTC (permalink / raw)
  To: Paul Burton, Andy Shevchenko, Geert Uytterhoeven
  Cc: linux-kernel, kernel-janitors, Christophe JAILLET

Remove 'cfg' from struct img_ascii_lcd_ctx. It is unused since commit
7e76aece6f03 ("auxdisplay: Extract character line display core support")

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
 drivers/auxdisplay/img-ascii-lcd.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/auxdisplay/img-ascii-lcd.c b/drivers/auxdisplay/img-ascii-lcd.c
index a802678a6f74..693339ba89d0 100644
--- a/drivers/auxdisplay/img-ascii-lcd.c
+++ b/drivers/auxdisplay/img-ascii-lcd.c
@@ -36,7 +36,6 @@ struct img_ascii_lcd_config {
  * @base: the base address of the LCD registers
  * @regmap: the regmap through which LCD registers are accessed
  * @offset: the offset within regmap to the start of the LCD registers
- * @cfg: pointer to the LCD model configuration
  */
 struct img_ascii_lcd_ctx {
 	struct linedisp linedisp;
@@ -45,7 +44,6 @@ struct img_ascii_lcd_ctx {
 		struct regmap *regmap;
 	};
 	u32 offset;
-	const struct img_ascii_lcd_config *cfg;
 };
 
 /*
-- 
2.47.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/2] auxdisplay: img-ascii-lcd: Constify struct img_ascii_lcd_config
  2024-12-06 22:25 [PATCH 1/2] auxdisplay: img-ascii-lcd: Remove an unused field in struct img_ascii_lcd_ctx Christophe JAILLET
@ 2024-12-06 22:25 ` Christophe JAILLET
  2024-12-09  8:55   ` Geert Uytterhoeven
  2024-12-09  8:54 ` [PATCH 1/2] auxdisplay: img-ascii-lcd: Remove an unused field in struct img_ascii_lcd_ctx Geert Uytterhoeven
  1 sibling, 1 reply; 6+ messages in thread
From: Christophe JAILLET @ 2024-12-06 22:25 UTC (permalink / raw)
  To: Paul Burton, Andy Shevchenko, Geert Uytterhoeven
  Cc: linux-kernel, kernel-janitors, Christophe JAILLET

'struct img_ascii_lcd_config' 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
   6110	    728	      0	   6838	   1ab6	drivers/auxdisplay/img-ascii-lcd.o

After:
=====
   text	   data	    bss	    dec	    hex	filename
   6198	    632	      0	   6830	   1aae	drivers/auxdisplay/img-ascii-lcd.o

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
Compile tested only
---
 drivers/auxdisplay/img-ascii-lcd.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/auxdisplay/img-ascii-lcd.c b/drivers/auxdisplay/img-ascii-lcd.c
index 693339ba89d0..32e1863ef4b2 100644
--- a/drivers/auxdisplay/img-ascii-lcd.c
+++ b/drivers/auxdisplay/img-ascii-lcd.c
@@ -69,7 +69,7 @@ static void boston_update(struct linedisp *linedisp)
 #endif
 }
 
-static struct img_ascii_lcd_config boston_config = {
+static const struct img_ascii_lcd_config boston_config = {
 	.num_chars = 8,
 	.ops = {
 		.update = boston_update,
@@ -98,7 +98,7 @@ static void malta_update(struct linedisp *linedisp)
 		pr_err_ratelimited("Failed to update LCD display: %d\n", err);
 }
 
-static struct img_ascii_lcd_config malta_config = {
+static const struct img_ascii_lcd_config malta_config = {
 	.num_chars = 8,
 	.external_regmap = true,
 	.ops = {
@@ -200,7 +200,7 @@ static void sead3_update(struct linedisp *linedisp)
 		pr_err_ratelimited("Failed to update LCD display: %d\n", err);
 }
 
-static struct img_ascii_lcd_config sead3_config = {
+static const struct img_ascii_lcd_config sead3_config = {
 	.num_chars = 16,
 	.external_regmap = true,
 	.ops = {
-- 
2.47.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] auxdisplay: img-ascii-lcd: Remove an unused field in struct img_ascii_lcd_ctx
  2024-12-06 22:25 [PATCH 1/2] auxdisplay: img-ascii-lcd: Remove an unused field in struct img_ascii_lcd_ctx Christophe JAILLET
  2024-12-06 22:25 ` [PATCH 2/2] auxdisplay: img-ascii-lcd: Constify struct img_ascii_lcd_config Christophe JAILLET
@ 2024-12-09  8:54 ` Geert Uytterhoeven
  2024-12-09 16:56   ` Andy Shevchenko
  1 sibling, 1 reply; 6+ messages in thread
From: Geert Uytterhoeven @ 2024-12-09  8:54 UTC (permalink / raw)
  To: Christophe JAILLET
  Cc: Paul Burton, Andy Shevchenko, linux-kernel, kernel-janitors

On Fri, Dec 6, 2024 at 11:26 PM Christophe JAILLET
<christophe.jaillet@wanadoo.fr> wrote:
> Remove 'cfg' from struct img_ascii_lcd_ctx. It is unused since commit
> 7e76aece6f03 ("auxdisplay: Extract character line display core support")
>
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>

Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/2] auxdisplay: img-ascii-lcd: Constify struct img_ascii_lcd_config
  2024-12-06 22:25 ` [PATCH 2/2] auxdisplay: img-ascii-lcd: Constify struct img_ascii_lcd_config Christophe JAILLET
@ 2024-12-09  8:55   ` Geert Uytterhoeven
  2024-12-09 16:55     ` Andy Shevchenko
  0 siblings, 1 reply; 6+ messages in thread
From: Geert Uytterhoeven @ 2024-12-09  8:55 UTC (permalink / raw)
  To: Christophe JAILLET
  Cc: Paul Burton, Andy Shevchenko, linux-kernel, kernel-janitors

On Fri, Dec 6, 2024 at 11:26 PM Christophe JAILLET
<christophe.jaillet@wanadoo.fr> wrote:
> 'struct img_ascii_lcd_config' 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
>    6110     728       0    6838    1ab6 drivers/auxdisplay/img-ascii-lcd.o
>
> After:
> =====
>    text    data     bss     dec     hex filename
>    6198     632       0    6830    1aae drivers/auxdisplay/img-ascii-lcd.o
>
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>

Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/2] auxdisplay: img-ascii-lcd: Constify struct img_ascii_lcd_config
  2024-12-09  8:55   ` Geert Uytterhoeven
@ 2024-12-09 16:55     ` Andy Shevchenko
  0 siblings, 0 replies; 6+ messages in thread
From: Andy Shevchenko @ 2024-12-09 16:55 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Christophe JAILLET, Paul Burton, linux-kernel, kernel-janitors

On Mon, Dec 09, 2024 at 09:55:48AM +0100, Geert Uytterhoeven wrote:
> On Fri, Dec 6, 2024 at 11:26 PM Christophe JAILLET
> <christophe.jaillet@wanadoo.fr> wrote:
> > 'struct img_ascii_lcd_config' 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
> >    6110     728       0    6838    1ab6 drivers/auxdisplay/img-ascii-lcd.o
> >
> > After:
> > =====
> >    text    data     bss     dec     hex filename
> >    6198     632       0    6830    1aae drivers/auxdisplay/img-ascii-lcd.o
> >
> > Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> 
> Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>

Pushed to my review and testing queue, thanks!

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] auxdisplay: img-ascii-lcd: Remove an unused field in struct img_ascii_lcd_ctx
  2024-12-09  8:54 ` [PATCH 1/2] auxdisplay: img-ascii-lcd: Remove an unused field in struct img_ascii_lcd_ctx Geert Uytterhoeven
@ 2024-12-09 16:56   ` Andy Shevchenko
  0 siblings, 0 replies; 6+ messages in thread
From: Andy Shevchenko @ 2024-12-09 16:56 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Christophe JAILLET, Paul Burton, linux-kernel, kernel-janitors

On Mon, Dec 09, 2024 at 09:54:19AM +0100, Geert Uytterhoeven wrote:
> On Fri, Dec 6, 2024 at 11:26 PM Christophe JAILLET
> <christophe.jaillet@wanadoo.fr> wrote:
> > Remove 'cfg' from struct img_ascii_lcd_ctx. It is unused since commit
> > 7e76aece6f03 ("auxdisplay: Extract character line display core support")
> >
> > Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> 
> Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>

Pushed to my review and testing queue, thanks!

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-12-09 16:56 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-06 22:25 [PATCH 1/2] auxdisplay: img-ascii-lcd: Remove an unused field in struct img_ascii_lcd_ctx Christophe JAILLET
2024-12-06 22:25 ` [PATCH 2/2] auxdisplay: img-ascii-lcd: Constify struct img_ascii_lcd_config Christophe JAILLET
2024-12-09  8:55   ` Geert Uytterhoeven
2024-12-09 16:55     ` Andy Shevchenko
2024-12-09  8:54 ` [PATCH 1/2] auxdisplay: img-ascii-lcd: Remove an unused field in struct img_ascii_lcd_ctx Geert Uytterhoeven
2024-12-09 16:56   ` Andy Shevchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox