All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] drivers/char: Constify static variables
@ 2020-07-01 20:09 ` Rikard Falkeborn
  0 siblings, 0 replies; 18+ messages in thread
From: Rikard Falkeborn @ 2020-07-01 20:09 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Arnd Bergmann
  Cc: Rikard Falkeborn, Amit Shah, Matt Mackall, Herbert Xu,
	Nicolas Saenz Julienne, Florian Fainelli, Ray Jui, Scott Branden,
	Corey Minyard, virtualization, openipmi-developer,
	bcm-kernel-feedback-list, linux-crypto, linux-rpi-kernel,
	linux-arm-kernel, linux-kernel

Constify some static variables (mostly structs) that are not modified.

Rikard Falkeborn (5):
  hwrng: bcm2835 - Constify bcm2835_rng_devtype[]
  hwrng: nomadik - Constify nmk_rng_ids[]
  hwrng: virtio - Constify id_table[]
  ipmi: watchdog: Constify ident
  virtio_console: Constify some static variables

 drivers/char/hw_random/bcm2835-rng.c | 2 +-
 drivers/char/hw_random/nomadik-rng.c | 2 +-
 drivers/char/hw_random/virtio-rng.c  | 2 +-
 drivers/char/ipmi/ipmi_watchdog.c    | 2 +-
 drivers/char/virtio_console.c        | 8 ++++----
 5 files changed, 8 insertions(+), 8 deletions(-)

-- 
2.27.0


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

* [PATCH 0/5] drivers/char: Constify static variables
@ 2020-07-01 20:09 ` Rikard Falkeborn
  0 siblings, 0 replies; 18+ messages in thread
From: Rikard Falkeborn @ 2020-07-01 20:09 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Arnd Bergmann
  Cc: Corey Minyard, Florian Fainelli, Herbert Xu, Scott Branden,
	Amit Shah, linux-arm-kernel, Ray Jui, linux-kernel,
	Rikard Falkeborn, virtualization, bcm-kernel-feedback-list,
	linux-crypto, Matt Mackall, openipmi-developer,
	Nicolas Saenz Julienne, linux-rpi-kernel

Constify some static variables (mostly structs) that are not modified.

Rikard Falkeborn (5):
  hwrng: bcm2835 - Constify bcm2835_rng_devtype[]
  hwrng: nomadik - Constify nmk_rng_ids[]
  hwrng: virtio - Constify id_table[]
  ipmi: watchdog: Constify ident
  virtio_console: Constify some static variables

 drivers/char/hw_random/bcm2835-rng.c | 2 +-
 drivers/char/hw_random/nomadik-rng.c | 2 +-
 drivers/char/hw_random/virtio-rng.c  | 2 +-
 drivers/char/ipmi/ipmi_watchdog.c    | 2 +-
 drivers/char/virtio_console.c        | 8 ++++----
 5 files changed, 8 insertions(+), 8 deletions(-)

-- 
2.27.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 1/5] hwrng: bcm2835 - Constify bcm2835_rng_devtype[]
  2020-07-01 20:09 ` Rikard Falkeborn
@ 2020-07-01 20:09   ` Rikard Falkeborn
  -1 siblings, 0 replies; 18+ messages in thread
From: Rikard Falkeborn @ 2020-07-01 20:09 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Arnd Bergmann
  Cc: Rikard Falkeborn, linux-kernel, Matt Mackall, Herbert Xu,
	Nicolas Saenz Julienne, Florian Fainelli, Ray Jui, Scott Branden,
	bcm-kernel-feedback-list, linux-crypto, linux-rpi-kernel,
	linux-arm-kernel

bcm2835_rng_devtype[] is not modified and can be made const to allow the
compiler to put it in read-only memory.

Before:
   text    data     bss     dec     hex filename
   2392     176       0    2568     a08 drivers/char/hw_random/bcm2835-rng.o

After:
   text    data     bss     dec     hex filename
   2464     104       0    2568     a08 drivers/char/hw_random/bcm2835-rng.o

Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
---
 drivers/char/hw_random/bcm2835-rng.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/char/hw_random/bcm2835-rng.c b/drivers/char/hw_random/bcm2835-rng.c
index cbf5eaea662c..0839236a6d19 100644
--- a/drivers/char/hw_random/bcm2835-rng.c
+++ b/drivers/char/hw_random/bcm2835-rng.c
@@ -188,7 +188,7 @@ static int bcm2835_rng_probe(struct platform_device *pdev)
 
 MODULE_DEVICE_TABLE(of, bcm2835_rng_of_match);
 
-static struct platform_device_id bcm2835_rng_devtype[] = {
+static const struct platform_device_id bcm2835_rng_devtype[] = {
 	{ .name = "bcm2835-rng" },
 	{ .name = "bcm63xx-rng" },
 	{ /* sentinel */ }
-- 
2.27.0


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

* [PATCH 1/5] hwrng: bcm2835 - Constify bcm2835_rng_devtype[]
@ 2020-07-01 20:09   ` Rikard Falkeborn
  0 siblings, 0 replies; 18+ messages in thread
From: Rikard Falkeborn @ 2020-07-01 20:09 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Arnd Bergmann
  Cc: linux-arm-kernel, Florian Fainelli, Herbert Xu, Scott Branden,
	Ray Jui, linux-kernel, Rikard Falkeborn,
	bcm-kernel-feedback-list, linux-crypto, Matt Mackall,
	Nicolas Saenz Julienne, linux-rpi-kernel

bcm2835_rng_devtype[] is not modified and can be made const to allow the
compiler to put it in read-only memory.

Before:
   text    data     bss     dec     hex filename
   2392     176       0    2568     a08 drivers/char/hw_random/bcm2835-rng.o

After:
   text    data     bss     dec     hex filename
   2464     104       0    2568     a08 drivers/char/hw_random/bcm2835-rng.o

Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
---
 drivers/char/hw_random/bcm2835-rng.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/char/hw_random/bcm2835-rng.c b/drivers/char/hw_random/bcm2835-rng.c
index cbf5eaea662c..0839236a6d19 100644
--- a/drivers/char/hw_random/bcm2835-rng.c
+++ b/drivers/char/hw_random/bcm2835-rng.c
@@ -188,7 +188,7 @@ static int bcm2835_rng_probe(struct platform_device *pdev)
 
 MODULE_DEVICE_TABLE(of, bcm2835_rng_of_match);
 
-static struct platform_device_id bcm2835_rng_devtype[] = {
+static const struct platform_device_id bcm2835_rng_devtype[] = {
 	{ .name = "bcm2835-rng" },
 	{ .name = "bcm63xx-rng" },
 	{ /* sentinel */ }
-- 
2.27.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 2/5] hwrng: nomadik - Constify nmk_rng_ids[]
  2020-07-01 20:09 ` Rikard Falkeborn
  (?)
  (?)
@ 2020-07-01 20:09 ` Rikard Falkeborn
  2020-07-02  7:51   ` Arnd Bergmann
  -1 siblings, 1 reply; 18+ messages in thread
From: Rikard Falkeborn @ 2020-07-01 20:09 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Arnd Bergmann
  Cc: Rikard Falkeborn, Matt Mackall, Herbert Xu, linux-crypto, linux-kernel

nmk_rng_ids[] is not modified and can be made const to allow the
compiler to put it in read-only memory.

Before:
   text    data     bss     dec     hex filename
    652     216       4     872     368 drivers/char/hw_random/nomadik-rng.o

After:
   text    data     bss     dec     hex filename
    676     192       4     872     368 drivers/char/hw_random/nomadik-rng.o

Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
---
 drivers/char/hw_random/nomadik-rng.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/char/hw_random/nomadik-rng.c b/drivers/char/hw_random/nomadik-rng.c
index 74ed29f42e4f..b0ded41eb865 100644
--- a/drivers/char/hw_random/nomadik-rng.c
+++ b/drivers/char/hw_random/nomadik-rng.c
@@ -76,7 +76,7 @@ static int nmk_rng_remove(struct amba_device *dev)
 	return 0;
 }
 
-static struct amba_id nmk_rng_ids[] = {
+static const struct amba_id nmk_rng_ids[] = {
 	{
 		.id	= 0x000805e1,
 		.mask	= 0x000fffff, /* top bits are rev and cfg: accept all */
-- 
2.27.0


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

* [PATCH 3/5] hwrng: virtio - Constify id_table[]
  2020-07-01 20:09 ` Rikard Falkeborn
                   ` (2 preceding siblings ...)
  (?)
@ 2020-07-01 20:09 ` Rikard Falkeborn
  -1 siblings, 0 replies; 18+ messages in thread
From: Rikard Falkeborn @ 2020-07-01 20:09 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Arnd Bergmann
  Cc: Rikard Falkeborn, Matt Mackall, Herbert Xu, linux-crypto, linux-kernel

id_table[] is not modified and an be made const to allow the compiler to
put it in read-only memory.

Before:
   text    data     bss     dec     hex filename
   1746     192       8    1946     79a drivers/char/hw_random/virtio-rng.o

After:
   text    data     bss     dec     hex filename
   1762     176       8    1946     79a drivers/char/hw_random/virtio-rng.o

Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
---
 drivers/char/hw_random/virtio-rng.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/char/hw_random/virtio-rng.c b/drivers/char/hw_random/virtio-rng.c
index 79a6e47b5fbc..a90001e02bf7 100644
--- a/drivers/char/hw_random/virtio-rng.c
+++ b/drivers/char/hw_random/virtio-rng.c
@@ -195,7 +195,7 @@ static int virtrng_restore(struct virtio_device *vdev)
 }
 #endif
 
-static struct virtio_device_id id_table[] = {
+static const struct virtio_device_id id_table[] = {
 	{ VIRTIO_ID_RNG, VIRTIO_DEV_ANY_ID },
 	{ 0 },
 };
-- 
2.27.0


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

* [PATCH 4/5] ipmi: watchdog: Constify ident
  2020-07-01 20:09 ` Rikard Falkeborn
                   ` (3 preceding siblings ...)
  (?)
@ 2020-07-01 20:09 ` Rikard Falkeborn
  -1 siblings, 0 replies; 18+ messages in thread
From: Rikard Falkeborn @ 2020-07-01 20:09 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Arnd Bergmann
  Cc: Rikard Falkeborn, Corey Minyard, openipmi-developer, linux-kernel

ident is not modified and can be made const to allow the compiler to put
it in read-only memory.

Before:
   text    data     bss     dec     hex filename
  14067    3188      64   17319    43a7 drivers/char/ipmi/ipmi_watchdog.o

After:
   text    data     bss     dec     hex filename
  14115    3148      64   17327    43af drivers/char/ipmi/ipmi_watchdog.o

Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
---
 drivers/char/ipmi/ipmi_watchdog.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/char/ipmi/ipmi_watchdog.c b/drivers/char/ipmi/ipmi_watchdog.c
index 55986e10a124..3df13c3da5f9 100644
--- a/drivers/char/ipmi/ipmi_watchdog.c
+++ b/drivers/char/ipmi/ipmi_watchdog.c
@@ -654,7 +654,7 @@ static int ipmi_heartbeat(void)
 	return rv;
 }
 
-static struct watchdog_info ident = {
+static const struct watchdog_info ident = {
 	.options	= 0,	/* WDIOF_SETTIMEOUT, */
 	.firmware_version = 1,
 	.identity	= "IPMI"
-- 
2.27.0


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

* [PATCH 5/5] virtio_console: Constify some static variables
  2020-07-01 20:09 ` Rikard Falkeborn
                   ` (4 preceding siblings ...)
  (?)
@ 2020-07-01 20:09 ` Rikard Falkeborn
  2020-07-05 18:30   ` Amit Shah
  -1 siblings, 1 reply; 18+ messages in thread
From: Rikard Falkeborn @ 2020-07-01 20:09 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Arnd Bergmann
  Cc: Rikard Falkeborn, Amit Shah, virtualization, linux-kernel

The id_table and feature_table pointers in struct virtio_driver are
pointers to const. Mark the corresponding static variables const to
allow the compiler to put them in read-only memory.

Before:
   text    data     bss     dec     hex filename
  25447     713      76   26236    667c drivers/char/virtio_console.o

After:
   text    data     bss     dec     hex filename
  25488     673      76   26237    667d drivers/char/virtio_console.o

Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
---
 drivers/char/virtio_console.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c
index 00c5e3acee46..896f0ba9ba3c 100644
--- a/drivers/char/virtio_console.c
+++ b/drivers/char/virtio_console.c
@@ -2112,24 +2112,24 @@ static int virtcons_probe(struct virtio_device *vdev)
 	return err;
 }
 
-static struct virtio_device_id id_table[] = {
+static const struct virtio_device_id id_table[] = {
 	{ VIRTIO_ID_CONSOLE, VIRTIO_DEV_ANY_ID },
 	{ 0 },
 };
 
-static unsigned int features[] = {
+static const unsigned int features[] = {
 	VIRTIO_CONSOLE_F_SIZE,
 	VIRTIO_CONSOLE_F_MULTIPORT,
 };
 
-static struct virtio_device_id rproc_serial_id_table[] = {
+static const struct virtio_device_id rproc_serial_id_table[] = {
 #if IS_ENABLED(CONFIG_REMOTEPROC)
 	{ VIRTIO_ID_RPROC_SERIAL, VIRTIO_DEV_ANY_ID },
 #endif
 	{ 0 },
 };
 
-static unsigned int rproc_serial_features[] = {
+static const unsigned int rproc_serial_features[] = {
 };
 
 #ifdef CONFIG_PM_SLEEP
-- 
2.27.0


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

* Re: [PATCH 1/5] hwrng: bcm2835 - Constify bcm2835_rng_devtype[]
  2020-07-01 20:09   ` Rikard Falkeborn
@ 2020-07-01 21:52     ` Florian Fainelli
  -1 siblings, 0 replies; 18+ messages in thread
From: Florian Fainelli @ 2020-07-01 21:52 UTC (permalink / raw)
  To: Rikard Falkeborn, Greg Kroah-Hartman, Arnd Bergmann
  Cc: linux-kernel, Matt Mackall, Herbert Xu, Nicolas Saenz Julienne,
	Ray Jui, Scott Branden, bcm-kernel-feedback-list, linux-crypto,
	linux-rpi-kernel, linux-arm-kernel



On 7/1/2020 1:09 PM, Rikard Falkeborn wrote:
> bcm2835_rng_devtype[] is not modified and can be made const to allow the
> compiler to put it in read-only memory.
> 
> Before:
>    text    data     bss     dec     hex filename
>    2392     176       0    2568     a08 drivers/char/hw_random/bcm2835-rng.o
> 
> After:
>    text    data     bss     dec     hex filename
>    2464     104       0    2568     a08 drivers/char/hw_random/bcm2835-rng.o
> 
> Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>

Acked-by: Florian Fainelli <f.fainelli@gmail.com>
-- 
Florian

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

* Re: [PATCH 1/5] hwrng: bcm2835 - Constify bcm2835_rng_devtype[]
@ 2020-07-01 21:52     ` Florian Fainelli
  0 siblings, 0 replies; 18+ messages in thread
From: Florian Fainelli @ 2020-07-01 21:52 UTC (permalink / raw)
  To: Rikard Falkeborn, Greg Kroah-Hartman, Arnd Bergmann
  Cc: linux-arm-kernel, Herbert Xu, Scott Branden, Ray Jui,
	linux-kernel, bcm-kernel-feedback-list, linux-crypto,
	Matt Mackall, Nicolas Saenz Julienne, linux-rpi-kernel



On 7/1/2020 1:09 PM, Rikard Falkeborn wrote:
> bcm2835_rng_devtype[] is not modified and can be made const to allow the
> compiler to put it in read-only memory.
> 
> Before:
>    text    data     bss     dec     hex filename
>    2392     176       0    2568     a08 drivers/char/hw_random/bcm2835-rng.o
> 
> After:
>    text    data     bss     dec     hex filename
>    2464     104       0    2568     a08 drivers/char/hw_random/bcm2835-rng.o
> 
> Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>

Acked-by: Florian Fainelli <f.fainelli@gmail.com>
-- 
Florian

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 2/5] hwrng: nomadik - Constify nmk_rng_ids[]
  2020-07-01 20:09 ` [PATCH 2/5] hwrng: nomadik - Constify nmk_rng_ids[] Rikard Falkeborn
@ 2020-07-02  7:51   ` Arnd Bergmann
  0 siblings, 0 replies; 18+ messages in thread
From: Arnd Bergmann @ 2020-07-02  7:51 UTC (permalink / raw)
  To: Rikard Falkeborn
  Cc: Greg Kroah-Hartman, Matt Mackall, Herbert Xu,
	open list:HARDWARE RANDOM NUMBER GENERATOR CORE, linux-kernel

On Wed, Jul 1, 2020 at 11:48 PM Rikard Falkeborn
<rikard.falkeborn@gmail.com> wrote:
>
> nmk_rng_ids[] is not modified and can be made const to allow the
> compiler to put it in read-only memory.
>
> Before:
>    text    data     bss     dec     hex filename
>     652     216       4     872     368 drivers/char/hw_random/nomadik-rng.o
>
> After:
>    text    data     bss     dec     hex filename
>     676     192       4     872     368 drivers/char/hw_random/nomadik-rng.o

Moving 24 bytes into the .rodata section is probably not a worth
the change, but the patch is correct and I agree this should be
.rodata anway.

> Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>

Acked-by: Arnd Bergmann <arnd@arndb.de>

> ---
>  drivers/char/hw_random/nomadik-rng.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/char/hw_random/nomadik-rng.c b/drivers/char/hw_random/nomadik-rng.c
> index 74ed29f42e4f..b0ded41eb865 100644
> --- a/drivers/char/hw_random/nomadik-rng.c
> +++ b/drivers/char/hw_random/nomadik-rng.c
> @@ -76,7 +76,7 @@ static int nmk_rng_remove(struct amba_device *dev)
>         return 0;
>  }
>
> -static struct amba_id nmk_rng_ids[] = {
> +static const struct amba_id nmk_rng_ids[] = {
>         {
>                 .id     = 0x000805e1,
>                 .mask   = 0x000fffff, /* top bits are rev and cfg: accept all */
> --
> 2.27.0
>

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

* Re: [PATCH 0/5] drivers/char: Constify static variables
  2020-07-01 20:09 ` Rikard Falkeborn
  (?)
@ 2020-07-02  8:58   ` Arnd Bergmann
  -1 siblings, 0 replies; 18+ messages in thread
From: Arnd Bergmann @ 2020-07-02  8:58 UTC (permalink / raw)
  To: Rikard Falkeborn
  Cc: Greg Kroah-Hartman, Amit Shah, Matt Mackall, Herbert Xu,
	Nicolas Saenz Julienne, Florian Fainelli, Ray Jui, Scott Branden,
	Corey Minyard, virtualization, openipmi-developer,
	bcm-kernel-feedback-list,
	open list:HARDWARE RANDOM NUMBER GENERATOR CORE,
	moderated list:BROADCOM BCM2835 ARM ARCHITECTURE, Linux ARM,
	linux-kernel

On Wed, Jul 1, 2020 at 11:48 PM Rikard Falkeborn
<rikard.falkeborn@gmail.com> wrote:
>
> Constify some static variables (mostly structs) that are not modified.
>
> Rikard Falkeborn (5):
>   hwrng: bcm2835 - Constify bcm2835_rng_devtype[]
>   hwrng: nomadik - Constify nmk_rng_ids[]
>   hwrng: virtio - Constify id_table[]
>   ipmi: watchdog: Constify ident
>   virtio_console: Constify some static variables

I just realized it was a series rather than a single patch I received. They
all look correct, so

Acked-by: Arnd Bergmann <arnd@arndb.de>

but if you do more of those, I would suggest not including the 'size'
output for the small variables as that is not the main point here.

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

* Re: [PATCH 0/5] drivers/char: Constify static variables
@ 2020-07-02  8:58   ` Arnd Bergmann
  0 siblings, 0 replies; 18+ messages in thread
From: Arnd Bergmann @ 2020-07-02  8:58 UTC (permalink / raw)
  To: Rikard Falkeborn
  Cc: Greg Kroah-Hartman, Amit Shah, Matt Mackall, Herbert Xu,
	Nicolas Saenz Julienne, Florian Fainelli, Ray Jui, Scott Branden,
	Corey Minyard, virtualization, openipmi-developer,
	bcm-kernel-feedback-list,
	open list:HARDWARE RANDOM NUMBER GENERATOR CORE,
	moderated list:BROADCOM BCM2835 ARM ARCHITECTURE, Linux ARM,
	linux-kernel@vger.kernel.org

On Wed, Jul 1, 2020 at 11:48 PM Rikard Falkeborn
<rikard.falkeborn@gmail.com> wrote:
>
> Constify some static variables (mostly structs) that are not modified.
>
> Rikard Falkeborn (5):
>   hwrng: bcm2835 - Constify bcm2835_rng_devtype[]
>   hwrng: nomadik - Constify nmk_rng_ids[]
>   hwrng: virtio - Constify id_table[]
>   ipmi: watchdog: Constify ident
>   virtio_console: Constify some static variables

I just realized it was a series rather than a single patch I received. They
all look correct, so

Acked-by: Arnd Bergmann <arnd@arndb.de>

but if you do more of those, I would suggest not including the 'size'
output for the small variables as that is not the main point here.

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

* Re: [PATCH 0/5] drivers/char: Constify static variables
@ 2020-07-02  8:58   ` Arnd Bergmann
  0 siblings, 0 replies; 18+ messages in thread
From: Arnd Bergmann @ 2020-07-02  8:58 UTC (permalink / raw)
  To: Rikard Falkeborn
  Cc: Corey Minyard, Florian Fainelli, Herbert Xu, Scott Branden,
	Amit Shah, Linux ARM, Greg Kroah-Hartman, linux-kernel, Ray Jui,
	virtualization, bcm-kernel-feedback-list,
	open list:HARDWARE RANDOM NUMBER GENERATOR CORE, Matt Mackall,
	openipmi-developer, Nicolas Saenz Julienne,
	moderated list:BROADCOM BCM2835 ARM ARCHITECTURE

On Wed, Jul 1, 2020 at 11:48 PM Rikard Falkeborn
<rikard.falkeborn@gmail.com> wrote:
>
> Constify some static variables (mostly structs) that are not modified.
>
> Rikard Falkeborn (5):
>   hwrng: bcm2835 - Constify bcm2835_rng_devtype[]
>   hwrng: nomadik - Constify nmk_rng_ids[]
>   hwrng: virtio - Constify id_table[]
>   ipmi: watchdog: Constify ident
>   virtio_console: Constify some static variables

I just realized it was a series rather than a single patch I received. They
all look correct, so

Acked-by: Arnd Bergmann <arnd@arndb.de>

but if you do more of those, I would suggest not including the 'size'
output for the small variables as that is not the main point here.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 5/5] virtio_console: Constify some static variables
  2020-07-01 20:09 ` [PATCH 5/5] virtio_console: Constify some static variables Rikard Falkeborn
@ 2020-07-05 18:30   ` Amit Shah
  2020-07-05 20:50     ` Joe Perches
  0 siblings, 1 reply; 18+ messages in thread
From: Amit Shah @ 2020-07-05 18:30 UTC (permalink / raw)
  To: Rikard Falkeborn
  Cc: Greg Kroah-Hartman, Arnd Bergmann, virtualization, linux-kernel

On (Wed) 01 Jul 2020 [22:09:50], Rikard Falkeborn wrote:
> The id_table and feature_table pointers in struct virtio_driver are
> pointers to const. Mark the corresponding static variables const to
> allow the compiler to put them in read-only memory.
> 
> Before:
>    text    data     bss     dec     hex filename
>   25447     713      76   26236    667c drivers/char/virtio_console.o
> 
> After:
>    text    data     bss     dec     hex filename
>   25488     673      76   26237    667d drivers/char/virtio_console.o
> 
> Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>

Reviewed-by: Amit Shah <amit@kernel.org>

Please CC me on the entire series instead of individual patches in the
future.

Thanks,

		Amit
-- 
http://amitshah.net/

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

* Re: [PATCH 5/5] virtio_console: Constify some static variables
  2020-07-05 18:30   ` Amit Shah
@ 2020-07-05 20:50     ` Joe Perches
  0 siblings, 0 replies; 18+ messages in thread
From: Joe Perches @ 2020-07-05 20:50 UTC (permalink / raw)
  To: Amit Shah, Rikard Falkeborn
  Cc: Greg Kroah-Hartman, Arnd Bergmann, virtualization, linux-kernel,
	Andrew Morton

On Sun, 2020-07-05 at 20:30 +0200, Amit Shah wrote:
> On (Wed) 01 Jul 2020 [22:09:50], Rikard Falkeborn wrote:
> > The id_table and feature_table pointers in struct virtio_driver are
> > pointers to const. Mark the corresponding static variables const to
> > allow the compiler to put them in read-only memory.
> > 
> > Before:
> >    text    data     bss     dec     hex filename
> >   25447     713      76   26236    667c drivers/char/virtio_console.o
> > 
> > After:
> >    text    data     bss     dec     hex filename
> >   25488     673      76   26237    667d drivers/char/virtio_console.o
> > 
> > Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
> 
> Reviewed-by: Amit Shah <amit@kernel.org>
> 
> Please CC me on the entire series instead of individual patches in the
> future.

CC'ing individual maintainers on entire patch sets
that span multiple subsystems doesn't scale.

Given that lore.kernel.org now stores all emails
sent to lkml, it's a reasonable thing to add a
reference to the cover letter below the --- line
to make it easier for individual recipients of
patches in a series to find the entire patch set.

i.e. Send emails with something like:

Subject: [PATCH N/M] foo: bar

commit message

Signed-off-by: J. Random Developer <address@domain.tld>
---

Link: https://lore.kernel.org/r/<message_id_of_cover_letter>

[patch]

A trivial script to insert these links if all patches
in a series are stored in a separate directory:

$ bash insert_cover_letter_link.bash <patch_directory>

---
$ cat insert_cover_letter_link.bash
#!/bin/bash

find $@ -name "*.patch" | sort | \
    while read file ; do

	echo "File: <$file>"
	if [[ $(basename $file) =~ ^0000- ]] ; then
	    message_id=$(grep '^Message-Id: <' $file)
	    if [ $? -ne 0 ] ; then
		echo "Message_Id not found"
		exit 1
	    fi
	    message_id=$(echo $message_id | \
			     sed -r -e 's/^Message-Id:\s*<//' -e 's/>\s*$//')
	    separator="-- "
	    echo "Message_Id: <$message_id>"
	else
	    separator="---"
	fi
	
	if [[ "$message_id" == "" ]] ; then
	    echo "Patch series cover letter Message_Id not found"
	    exit 1
	fi

	perl -n -i -e "if (\$_ =~ /^$separator$/) { print; print \"\\n\"; print \"Link: https://lore.kernel.org/r/\" . '$message_id' . \"\\n\"; print \"\\n\"; } else { print; }" $file

    done

exit 0



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

* Re: [PATCH 0/5] drivers/char: Constify static variables
  2020-07-01 20:09 ` Rikard Falkeborn
@ 2020-07-09 12:54   ` Herbert Xu
  -1 siblings, 0 replies; 18+ messages in thread
From: Herbert Xu @ 2020-07-09 12:54 UTC (permalink / raw)
  To: Rikard Falkeborn
  Cc: Greg Kroah-Hartman, Arnd Bergmann, Amit Shah, Matt Mackall,
	Nicolas Saenz Julienne, Florian Fainelli, Ray Jui, Scott Branden,
	Corey Minyard, virtualization, openipmi-developer,
	bcm-kernel-feedback-list, linux-crypto, linux-rpi-kernel,
	linux-arm-kernel, linux-kernel

On Wed, Jul 01, 2020 at 10:09:45PM +0200, Rikard Falkeborn wrote:
> Constify some static variables (mostly structs) that are not modified.
> 
> Rikard Falkeborn (5):
>   hwrng: bcm2835 - Constify bcm2835_rng_devtype[]
>   hwrng: nomadik - Constify nmk_rng_ids[]
>   hwrng: virtio - Constify id_table[]
>   ipmi: watchdog: Constify ident
>   virtio_console: Constify some static variables
> 
>  drivers/char/hw_random/bcm2835-rng.c | 2 +-
>  drivers/char/hw_random/nomadik-rng.c | 2 +-
>  drivers/char/hw_random/virtio-rng.c  | 2 +-
>  drivers/char/ipmi/ipmi_watchdog.c    | 2 +-
>  drivers/char/virtio_console.c        | 8 ++++----
>  5 files changed, 8 insertions(+), 8 deletions(-)

Patches 1-3 applied.  Thanks.
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

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

* Re: [PATCH 0/5] drivers/char: Constify static variables
@ 2020-07-09 12:54   ` Herbert Xu
  0 siblings, 0 replies; 18+ messages in thread
From: Herbert Xu @ 2020-07-09 12:54 UTC (permalink / raw)
  To: Rikard Falkeborn
  Cc: Corey Minyard, Florian Fainelli, Scott Branden, Arnd Bergmann,
	Amit Shah, linux-arm-kernel, Greg Kroah-Hartman, linux-kernel,
	Ray Jui, virtualization, bcm-kernel-feedback-list, linux-crypto,
	Matt Mackall, openipmi-developer, Nicolas Saenz Julienne,
	linux-rpi-kernel

On Wed, Jul 01, 2020 at 10:09:45PM +0200, Rikard Falkeborn wrote:
> Constify some static variables (mostly structs) that are not modified.
> 
> Rikard Falkeborn (5):
>   hwrng: bcm2835 - Constify bcm2835_rng_devtype[]
>   hwrng: nomadik - Constify nmk_rng_ids[]
>   hwrng: virtio - Constify id_table[]
>   ipmi: watchdog: Constify ident
>   virtio_console: Constify some static variables
> 
>  drivers/char/hw_random/bcm2835-rng.c | 2 +-
>  drivers/char/hw_random/nomadik-rng.c | 2 +-
>  drivers/char/hw_random/virtio-rng.c  | 2 +-
>  drivers/char/ipmi/ipmi_watchdog.c    | 2 +-
>  drivers/char/virtio_console.c        | 8 ++++----
>  5 files changed, 8 insertions(+), 8 deletions(-)

Patches 1-3 applied.  Thanks.
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2020-07-09 12:57 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-01 20:09 [PATCH 0/5] drivers/char: Constify static variables Rikard Falkeborn
2020-07-01 20:09 ` Rikard Falkeborn
2020-07-01 20:09 ` [PATCH 1/5] hwrng: bcm2835 - Constify bcm2835_rng_devtype[] Rikard Falkeborn
2020-07-01 20:09   ` Rikard Falkeborn
2020-07-01 21:52   ` Florian Fainelli
2020-07-01 21:52     ` Florian Fainelli
2020-07-01 20:09 ` [PATCH 2/5] hwrng: nomadik - Constify nmk_rng_ids[] Rikard Falkeborn
2020-07-02  7:51   ` Arnd Bergmann
2020-07-01 20:09 ` [PATCH 3/5] hwrng: virtio - Constify id_table[] Rikard Falkeborn
2020-07-01 20:09 ` [PATCH 4/5] ipmi: watchdog: Constify ident Rikard Falkeborn
2020-07-01 20:09 ` [PATCH 5/5] virtio_console: Constify some static variables Rikard Falkeborn
2020-07-05 18:30   ` Amit Shah
2020-07-05 20:50     ` Joe Perches
2020-07-02  8:58 ` [PATCH 0/5] drivers/char: Constify " Arnd Bergmann
2020-07-02  8:58   ` Arnd Bergmann
2020-07-02  8:58   ` Arnd Bergmann
2020-07-09 12:54 ` Herbert Xu
2020-07-09 12:54   ` Herbert Xu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.