[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250225082832.GA6982@breakpoint.cc>
Date: Tue, 25 Feb 2025 09:28:32 +0100
From: Florian Westphal <fw@...len.de>
To: Leon Romanovsky <leon@...nel.org>
Cc: Florian Westphal <fw@...len.de>, netdev@...r.kernel.org,
steffen.klassert@...unet.com, herbert@...dor.apana.org.au
Subject: Re: [PATCH ipsec-next] xfrm: remove hash table alloc/free helpers
Leon Romanovsky <leon@...nel.org> wrote:
> > xfrm_hash_free() is kept around because of 'struct hlist_head *' arg type
> > instead of 'void *'.
>
> <...>
>
> > -struct hlist_head *xfrm_hash_alloc(unsigned int sz);
> > -void xfrm_hash_free(struct hlist_head *n, unsigned int sz);
> > +static inline struct hlist_head *xfrm_hash_alloc(unsigned int sz)
> > +{
> > + return kvzalloc(sz, GFP_KERNEL);
> > +}
> >
> > +static inline void xfrm_hash_free(struct hlist_head *n)
> > +{
> > + kvfree(n);
> > +}
>
> Sorry, what does this wrapper give us?
> You are passing pointer as is and there is no any pointer type check
> that this construction will give us.
Compiler will warn when the argument is something other than a pointer
to a hlist_head.
I can send a v2 with this wrapper removed if you don't think its worth it.
Thanks for reviewing.
Powered by blists - more mailing lists