mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-08-28 04:03:23 -04:00
uio: make read-only const array porttypes static
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> Link: https://patch.msgid.link/20260714185624.192829-1-colin.i.king@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
a432f68c51
commit
a477830bc2
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user