* [PATCH] crypto: virtio - constify features[] and id_table[]
@ 2020-07-01 20:29 Rikard Falkeborn
2020-07-09 12:55 ` Herbert Xu
0 siblings, 1 reply; 2+ messages in thread
From: Rikard Falkeborn @ 2020-07-01 20:29 UTC (permalink / raw)
Cc: mst, jasowang, arei.gonglei, herbert, davem, virtualization,
linux-crypto, linux-kernel, Rikard Falkeborn
features[] and id_table[] are not modified and can be made const to
allow the compiler to put them in read-only memory.
Before:
text data bss dec hex filename
11534 2056 160 13750 35b6 drivers/crypto/virtio/virtio_crypto_core.o
After:
text data bss dec hex filename
11630 1992 128 13750 35b6 drivers/crypto/virtio/virtio_crypto_core.o
Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
---
drivers/crypto/virtio/virtio_crypto_core.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/crypto/virtio/virtio_crypto_core.c b/drivers/crypto/virtio/virtio_crypto_core.c
index ba8a19c72391..0c66d6193ca2 100644
--- a/drivers/crypto/virtio/virtio_crypto_core.c
+++ b/drivers/crypto/virtio/virtio_crypto_core.c
@@ -498,11 +498,11 @@ static int virtcrypto_restore(struct virtio_device *vdev)
}
#endif
-static unsigned int features[] = {
+static const unsigned int features[] = {
/* none */
};
-static struct virtio_device_id id_table[] = {
+static const struct virtio_device_id id_table[] = {
{ VIRTIO_ID_CRYPTO, VIRTIO_DEV_ANY_ID },
{ 0 },
};
--
2.27.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] crypto: virtio - constify features[] and id_table[]
2020-07-01 20:29 [PATCH] crypto: virtio - constify features[] and id_table[] Rikard Falkeborn
@ 2020-07-09 12:55 ` Herbert Xu
0 siblings, 0 replies; 2+ messages in thread
From: Herbert Xu @ 2020-07-09 12:55 UTC (permalink / raw)
To: Rikard Falkeborn
Cc: mst, jasowang, arei.gonglei, davem, virtualization, linux-crypto,
linux-kernel
On Wed, Jul 01, 2020 at 10:29:36PM +0200, Rikard Falkeborn wrote:
> features[] and id_table[] are not modified and can be made const to
> allow the compiler to put them in read-only memory.
>
> Before:
> text data bss dec hex filename
> 11534 2056 160 13750 35b6 drivers/crypto/virtio/virtio_crypto_core.o
>
> After:
> text data bss dec hex filename
> 11630 1992 128 13750 35b6 drivers/crypto/virtio/virtio_crypto_core.o
>
> Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
> ---
> drivers/crypto/virtio/virtio_crypto_core.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
Patch 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] 2+ messages in thread
end of thread, other threads:[~2020-07-09 12:55 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-01 20:29 [PATCH] crypto: virtio - constify features[] and id_table[] Rikard Falkeborn
2020-07-09 12:55 ` Herbert Xu
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).