git: e262610007f0 - main - netlink: Make the writers function table static and const

From: Mark Johnston <markj_at_FreeBSD.org>
Date: Tue, 17 Jan 2023 14:45:44 UTC
The branch main has been updated by markj:

URL: https://cgit.FreeBSD.org/src/commit/?id=e262610007f01398630dc8ce7bf404dbcfd6350c

commit e262610007f01398630dc8ce7bf404dbcfd6350c
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2023-01-17 14:37:21 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2023-01-17 14:37:21 +0000

    netlink: Make the writers function table static and const
    
    No functional change intended.
    
    Reviewed by:    melifaro
    Sponsored by:   The FreeBSD Foundation
    Differential Revision:  https://reviews.freebsd.org/D38099
---
 sys/netlink/netlink_message_writer.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sys/netlink/netlink_message_writer.c b/sys/netlink/netlink_message_writer.c
index 6573394eb881..0d27d5d0d47c 100644
--- a/sys/netlink/netlink_message_writer.c
+++ b/sys/netlink/netlink_message_writer.c
@@ -368,7 +368,7 @@ nlmsg_write_group_lbuf(struct nl_writer *nw, void *buf, int datalen, int cnt)
 	return (true);
 }
 
-struct nlwriter_ops nlmsg_writers[] = {
+static const struct nlwriter_ops nlmsg_writers[] = {
 	/* NS_WRITER_TYPE_MBUF */
 	{
 		.init = nlmsg_get_ns_mbuf,
@@ -394,7 +394,7 @@ struct nlwriter_ops nlmsg_writers[] = {
 static void
 nlmsg_set_callback(struct nl_writer *nw)
 {
-	struct nlwriter_ops *pops = &nlmsg_writers[nw->writer_type];
+	const struct nlwriter_ops *pops = &nlmsg_writers[nw->writer_type];
 
 	switch (nw->writer_target) {
 	case NS_WRITER_TARGET_SOCKET: