mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH][next] uio: make read-only const array porttypes static
@ 2026-07-14 18:56 Colin Ian King
  0 siblings, 0 replies; only message in thread
From: Colin Ian King @ 2026-07-14 18:56 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: kernel-janitors, linux-kernel

Don't populate the read-only const array porttypes on the stack
at run time, instead make it static const char * const

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
 drivers/uio/uio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/uio/uio.c b/drivers/uio/uio.c
index 1e4ade78ed84..981f8d21daad 100644
--- a/drivers/uio/uio.c
+++ b/drivers/uio/uio.c
@@ -150,7 +150,7 @@ static ssize_t portio_size_show(struct uio_port *port, char *buf)
 
 static ssize_t portio_porttype_show(struct uio_port *port, char *buf)
 {
-	const char *porttypes[] = {"none", "x86", "gpio", "other"};
+	static const char * const porttypes[] = {"none", "x86", "gpio", "other"};
 
 	if ((port->porttype < 0) || (port->porttype > UIO_PORT_OTHER))
 		return -EINVAL;
-- 
2.53.0


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-07-14 18:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-07-14 18:56 [PATCH][next] uio: make read-only const array porttypes static Colin Ian King

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®