[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231119145855.GA186930@vergenet.net>
Date: Sun, 19 Nov 2023 14:58:55 +0000
From: Simon Horman <horms@...nel.org>
To: Jiri Pirko <jiri@...nulli.us>
Cc: netdev@...r.kernel.org, kuba@...nel.org, pabeni@...hat.com,
davem@...emloft.net, edumazet@...gle.com, jacob.e.keller@...el.com,
jhs@...atatu.com, johannes@...solutions.net,
andriy.shevchenko@...ux.intel.com, amritha.nambiar@...el.com,
sdf@...gle.com
Subject: Re: [patch net-next v2 6/9] netlink: introduce typedef for filter
function
On Thu, Nov 16, 2023 at 05:48:18PM +0100, Jiri Pirko wrote:
> From: Jiri Pirko <jiri@...dia.com>
>
> Make the code using filter function a bit nicer by consolidating the
> filter function arguments using typedef.
>
> Suggested-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
> Signed-off-by: Jiri Pirko <jiri@...dia.com>
> ---
> v1->v2:
> - new patch
> ---
> drivers/connector/connector.c | 5 ++---
> include/linux/connector.h | 6 ++----
> include/linux/netlink.h | 6 ++++--
> net/netlink/af_netlink.c | 6 ++----
> 4 files changed, 10 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/connector/connector.c b/drivers/connector/connector.c
> index 7f7b94f616a6..4028e8eeba82 100644
> --- a/drivers/connector/connector.c
> +++ b/drivers/connector/connector.c
> @@ -59,9 +59,8 @@ static int cn_already_initialized;
> * both, or if both are zero then the group is looked up and sent there.
> */
> int cn_netlink_send_mult(struct cn_msg *msg, u16 len, u32 portid, u32 __group,
> - gfp_t gfp_mask,
> - int (*filter)(struct sock *dsk, struct sk_buff *skb, void *data),
> - void *filter_data)
> + gfp_t gfp_mask, netlink_filter_fn filter,
> + void *filter_data)
> {
> struct cn_callback_entry *__cbq;
> unsigned int size;
> diff --git a/include/linux/connector.h b/include/linux/connector.h
> index cec2d99ae902..cb18d70d623f 100644
> --- a/include/linux/connector.h
> +++ b/include/linux/connector.h
> @@ -98,10 +98,8 @@ void cn_del_callback(const struct cb_id *id);
> *
> * If there are no listeners for given group %-ESRCH can be returned.
> */
> -int cn_netlink_send_mult(struct cn_msg *msg, u16 len, u32 portid,
> - u32 group, gfp_t gfp_mask,
> - int (*filter)(struct sock *dsk, struct sk_buff *skb,
> - void *data),
> +int cn_netlink_send_mult(struct cn_msg *msg, u16 len, u32 portid, u32 __group,
> + gfp_t gfp_mask, netlink_filter_fn filter,
> void *filter_data);
nit: It might be good to update the kernel doc to account for
group => group.
Curiously the kernel doc already documents filter_data rather
than data.
...
Powered by blists - more mailing lists