From: Rikard Falkeborn <rikard.falkeborn@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: arnd@arndb.de, gregkh@linuxfoundation.org,
Rikard Falkeborn <rikard.falkeborn@gmail.com>,
Sudeep Dutt <sudeep.dutt@intel.com>,
Ashutosh Dixit <ashutosh.dixit@intel.com>
Subject: [PATCH 4/4] mic: vop: Constify static structs
Date: Thu, 11 Jun 2020 00:47:04 +0200 [thread overview]
Message-ID: <20200610224704.27082-5-rikard.falkeborn@gmail.com> (raw)
In-Reply-To: <20200610224704.27082-1-rikard.falkeborn@gmail.com>
vop_vq_config_ops and id_table[] are never modified so make them const
to allow the compiler to put them in read-only memory.
Before:
text data bss dec hex filename
14889 4065 192 19146 4aca drivers/misc/mic/vop/vop_main.o
After:
text data bss dec hex filename
15113 3841 192 19146 4aca drivers/misc/mic/vop/vop_main.o
Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
---
drivers/misc/mic/vop/vop_main.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/misc/mic/vop/vop_main.c b/drivers/misc/mic/vop/vop_main.c
index 85942f6717c5..51a1ab83a630 100644
--- a/drivers/misc/mic/vop/vop_main.c
+++ b/drivers/misc/mic/vop/vop_main.c
@@ -438,7 +438,7 @@ static int vop_find_vqs(struct virtio_device *dev, unsigned nvqs,
/*
* The config ops structure as defined by virtio config
*/
-static struct virtio_config_ops vop_vq_config_ops = {
+static const struct virtio_config_ops vop_vq_config_ops = {
.get_features = vop_get_features,
.finalize_features = vop_finalize_features,
.get = vop_get,
@@ -763,7 +763,7 @@ static void vop_driver_remove(struct vop_device *vpdev)
kfree(vi);
}
-static struct vop_device_id id_table[] = {
+static const struct vop_device_id id_table[] = {
{ VOP_DEV_TRNSP, VOP_DEV_ANY_ID },
{ 0 },
};
--
2.27.0
prev parent reply other threads:[~2020-06-10 22:47 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-10 22:47 [PATCH 0/4] drivers/misc: Constify static structs Rikard Falkeborn
2020-06-10 22:47 ` [PATCH 1/4] misc: rtsx_usb: Constify struct usb_device_id Rikard Falkeborn
2020-06-10 22:47 ` [PATCH 2/4] misc: genwqe: Constify struct pci_error_handlers Rikard Falkeborn
2020-06-30 7:13 ` haver
2020-06-10 22:47 ` [PATCH 3/4] mei: hdcp: Constify struct mei_cl_device_id Rikard Falkeborn
2020-06-10 22:47 ` Rikard Falkeborn [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=20200610224704.27082-5-rikard.falkeborn@gmail.com \
--to=rikard.falkeborn@gmail.com \
--cc=arnd@arndb.de \
--cc=ashutosh.dixit@intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sudeep.dutt@intel.com \
/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;
as well as URLs for NNTP newsgroup(s).