DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: Stephen Hemminger <stephen@networkplumber.org>,
	Junlong Wang <wang.junlong1@zte.com.cn>,
	Lijie Shan <shan.lijie@zte.com.cn>
Subject: [RFC 4/5] net/zxdh: make callback table const and static
Date: Sat, 22 Feb 2025 18:42:23 -0800	[thread overview]
Message-ID: <20250223024334.1216477-5-stephen@networkplumber.org> (raw)
In-Reply-To: <20250223024334.1216477-1-stephen@networkplumber.org>

Tables of function pointers should be const, and since only used
in one file can be marked static.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/zxdh/zxdh_msg.c | 2 +-
 drivers/net/zxdh/zxdh_msg.h | 1 -
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/zxdh/zxdh_msg.c b/drivers/net/zxdh/zxdh_msg.c
index 4cd58ca0cb..ca614d43d9 100644
--- a/drivers/net/zxdh/zxdh_msg.c
+++ b/drivers/net/zxdh/zxdh_msg.c
@@ -2055,7 +2055,7 @@ zxdh_vf_mtr_hw_profile_cfg(struct zxdh_hw *pf_hw __rte_unused,
 	return 0;
 }
 
-zxdh_msg_process_callback zxdh_proc_cb[] = {
+static const zxdh_msg_process_callback zxdh_proc_cb[] = {
 	[ZXDH_NULL] = NULL,
 	[ZXDH_VF_PORT_INIT] = zxdh_vf_port_init,
 	[ZXDH_VF_PORT_UNINIT] = zxdh_vf_port_uninit,
diff --git a/drivers/net/zxdh/zxdh_msg.h b/drivers/net/zxdh/zxdh_msg.h
index f82995bf0b..58836bb4b7 100644
--- a/drivers/net/zxdh/zxdh_msg.h
+++ b/drivers/net/zxdh/zxdh_msg.h
@@ -527,7 +527,6 @@ typedef int (*zxdh_bar_chan_msg_recv_callback)(void *pay_load, uint16_t len,
 		void *reps_buffer, uint16_t *reps_len, void *dev);
 typedef int (*zxdh_msg_process_callback)(struct zxdh_hw *hw, uint16_t vport, void *cfg_data,
 	struct zxdh_msg_reply_body *res_info, uint16_t *res_len);
-extern zxdh_msg_process_callback zxdh_proc_cb[];
 
 typedef int (*zxdh_bar_chan_msg_recv_callback)(void *pay_load, uint16_t len,
 			void *reps_buffer, uint16_t *reps_len, void *dev);
-- 
2.47.2


  parent reply	other threads:[~2025-02-23  2:44 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-23  2:42 [RFC 0/5] net/zxdh: possible changes Stephen Hemminger
2025-02-23  2:42 ` [RFC 1/5] net/zxdh: remove __rte_unused from function prototypes Stephen Hemminger
2025-02-23  2:42 ` [RFC 2/5] net/zxdh: remove __rte_unused attribute Stephen Hemminger
2025-02-23  2:42 ` [RFC 3/5] net/zxdh: fix RTE_ASSERT expression Stephen Hemminger
2025-02-23  2:42 ` Stephen Hemminger [this message]
2025-02-23  2:42 ` [RFC 5/5] net/zxdh: fix indentation in mtr get and use assign Stephen Hemminger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250223024334.1216477-5-stephen@networkplumber.org \
    --to=stephen@networkplumber.org \
    --cc=dev@dpdk.org \
    --cc=shan.lijie@zte.com.cn \
    --cc=wang.junlong1@zte.com.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).