diff options
author | Guillaume Nault <g.nault@alphalink.fr> | 2016-08-03 12:52:34 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2016-08-08 11:32:30 +0200 |
commit | fbe0f33b45abd585eb9f52cb56d751a750667dc6 (patch) | |
tree | 33261f91c0975effbf910e73588fa80eb937fb3f /src/callback.c | |
parent | c0f4276b3761ee1cb638e877e090728dbc74b4fa (diff) |
callback: mark cb_ctl_array 'const' in mnl_cb_run2()
Users of mnl_cb_run2() would typically pass a 'static const' array as
cb_ctl_array parameter. Unfortunately this triggers a compiler warning
because the prototype doesn't declare cb_ctl_array with the 'const'
qualifier.
Since mnl_cb_run2() and __mnl_cb_run() don't modify cb_ctl_array (and
don't have any reason to do so in the future), we can mark this
parameter as 'const'.
There should be no impact on existing users beyond removing the
compiler warning when using a constant array.
Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/callback.c')
-rw-r--r-- | src/callback.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/callback.c b/src/callback.c index 00ffcf4..01181e6 100644 --- a/src/callback.c +++ b/src/callback.c @@ -48,7 +48,7 @@ static const mnl_cb_t default_cb_array[NLMSG_MIN_TYPE] = { static inline int __mnl_cb_run(const void *buf, size_t numbytes, unsigned int seq, unsigned int portid, mnl_cb_t cb_data, void *data, - mnl_cb_t *cb_ctl_array, + const mnl_cb_t *cb_ctl_array, unsigned int cb_ctl_array_len) { int ret = MNL_CB_OK, len = numbytes; @@ -130,7 +130,7 @@ out: EXPORT_SYMBOL(mnl_cb_run2); int mnl_cb_run2(const void *buf, size_t numbytes, unsigned int seq, unsigned int portid, mnl_cb_t cb_data, void *data, - mnl_cb_t *cb_ctl_array, unsigned int cb_ctl_array_len) + const mnl_cb_t *cb_ctl_array, unsigned int cb_ctl_array_len) { return __mnl_cb_run(buf, numbytes, seq, portid, cb_data, data, cb_ctl_array, cb_ctl_array_len); |