netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Florian Westphal <fw@strlen.de>
To: Leon Romanovsky <leon@kernel.org>
Cc: Florian Westphal <fw@strlen.de>,
	netdev@vger.kernel.org, steffen.klassert@secunet.com,
	herbert@gondor.apana.org.au
Subject: Re: [PATCH ipsec-next] xfrm: remove hash table alloc/free helpers
Date: Tue, 25 Feb 2025 09:28:32 +0100	[thread overview]
Message-ID: <20250225082832.GA6982@breakpoint.cc> (raw)
In-Reply-To: <20250225080440.GE53094@unreal>

Leon Romanovsky <leon@kernel.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.

  reply	other threads:[~2025-02-25  8:28 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-24 17:10 [PATCH ipsec-next] xfrm: remove hash table alloc/free helpers Florian Westphal
2025-02-25  8:04 ` Leon Romanovsky
2025-02-25  8:28   ` Florian Westphal [this message]
2025-02-25  9:22     ` Leon Romanovsky
2025-02-25 21:25 ` kernel test robot

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=20250225082832.GA6982@breakpoint.cc \
    --to=fw@strlen.de \
    --cc=herbert@gondor.apana.org.au \
    --cc=leon@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=steffen.klassert@secunet.com \
    /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).