[PATCH] nvme-keyring: Constify struct nvme_tls_psk_priority_list

From: Christophe JAILLET

Date: Sat Sep 12 2026 - 03:30:37 EST


'struct nvme_tls_psk_priority_list' is not modified in this driver.

Constifying this structure moves some data to a read-only section, so
increases overall security.

On a x86_64, with allmodconfig:
Before:
======
text data bss dec hex filename
7097 4296 64 11457 2cc1 drivers/nvme/common/keyring.o

After:
=====
text data bss dec hex filename
7193 4200 64 11457 2cc1 drivers/nvme/common/keyring.o

Signed-off-by: Christophe JAILLET <christophe.jaillet@xxxxxxxxxx>
---
Compile tested only.
---
drivers/nvme/common/keyring.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/nvme/common/keyring.c b/drivers/nvme/common/keyring.c
index 32d16c53133b..43624d7713de 100644
--- a/drivers/nvme/common/keyring.c
+++ b/drivers/nvme/common/keyring.c
@@ -194,7 +194,7 @@ EXPORT_SYMBOL_GPL(nvme_tls_psk_refresh);
* PSKs, PSKs with hash (psk_ver 1) should be preferred to PSKs without hash
* (psk_ver 0), and SHA-384 should be preferred to SHA-256.
*/
-static struct nvme_tls_psk_priority_list {
+static const struct nvme_tls_psk_priority_list {
bool generated;
u8 psk_ver;
enum nvme_tcp_tls_cipher cipher;
--
2.55.0