From: Kuan-Wei Chiu <visitorckw@gmail.com>
To: Dan Carpenter <dan.carpenter@linaro.org>
Cc: Benjamin Berg <benjamin.berg@intel.com>,
Brendan Higgins <brendan.higgins@linux.dev>,
David Gow <davidgow@google.com>, Rae Moar <rmoar@google.com>,
linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com,
linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] kunit: skb: use "gfp" variable instead of hardcoding GFP_KERNEL
Date: Sun, 10 Nov 2024 01:00:17 +0800 [thread overview]
Message-ID: <Zy+VIXDPuU613fFd@visitorckw-System-Product-Name> (raw)
In-Reply-To: <57a8d38a-6299-4d2c-bb2e-c9d1e3bf1c99@stanley.mountain>
On Mon, Nov 04, 2024 at 08:16:30PM +0300, Dan Carpenter wrote:
> The intent here was clearly to use the gfp variable flags instead of
> hardcoding GFP_KERNEL. All the callers pass GFP_KERNEL as the gfp
> flags so this doesn't affect runtime.
>
> Fixes: b3231d353a51 ("kunit: add a convenience allocation wrapper for SKBs")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
The kernel doc comment for kunit_zalloc_skb() is missing a mention of
the gfp parameter. Additionally, the comment says "Allocate a new
struct sk_buff with GFP_KERNEL," which should replace GFP_KERNEL with
@gfp. It might be better to fix both issues in the comment together.
With the above corrections:
Reviewed-by: Kuan-Wei Chiu <visitorckw@gmail.com>
Regards,
Kuan-Wei
> ---
> include/kunit/skbuff.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/include/kunit/skbuff.h b/include/kunit/skbuff.h
> index 44d12370939a..345e1e8f0312 100644
> --- a/include/kunit/skbuff.h
> +++ b/include/kunit/skbuff.h
> @@ -29,7 +29,7 @@ static void kunit_action_kfree_skb(void *p)
> static inline struct sk_buff *kunit_zalloc_skb(struct kunit *test, int len,
> gfp_t gfp)
> {
> - struct sk_buff *res = alloc_skb(len, GFP_KERNEL);
> + struct sk_buff *res = alloc_skb(len, gfp);
>
> if (!res || skb_pad(res, len))
> return NULL;
> --
> 2.45.2
>
>
prev parent reply other threads:[~2024-11-09 17:00 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-04 17:16 [PATCH] kunit: skb: use "gfp" variable instead of hardcoding GFP_KERNEL Dan Carpenter
2024-11-09 9:33 ` David Gow
2024-11-09 17:00 ` Kuan-Wei Chiu [this message]
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=Zy+VIXDPuU613fFd@visitorckw-System-Product-Name \
--to=visitorckw@gmail.com \
--cc=benjamin.berg@intel.com \
--cc=brendan.higgins@linux.dev \
--cc=dan.carpenter@linaro.org \
--cc=davidgow@google.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=kunit-dev@googlegroups.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=rmoar@google.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