All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rikard Falkeborn <rikard.falkeborn@gmail.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Arnd Bergmann <arnd@arndb.de>
Cc: Rikard Falkeborn <rikard.falkeborn@gmail.com>,
	Amit Shah <amit@kernel.org>,
	virtualization@lists.linux-foundation.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH 5/5] virtio_console: Constify some static variables
Date: Wed,  1 Jul 2020 22:09:50 +0200	[thread overview]
Message-ID: <20200701200950.30314-6-rikard.falkeborn@gmail.com> (raw)
In-Reply-To: <20200701200950.30314-1-rikard.falkeborn@gmail.com>

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


  parent reply	other threads:[~2020-07-01 21:48 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 ` Rikard Falkeborn [this message]
2020-07-05 18:30   ` [PATCH 5/5] virtio_console: Constify some static variables 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

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=20200701200950.30314-6-rikard.falkeborn@gmail.com \
    --to=rikard.falkeborn@gmail.com \
    --cc=amit@kernel.org \
    --cc=arnd@arndb.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=virtualization@lists.linux-foundation.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 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.