Re: [PATCH] HID: remove duplicate hid_warn_ratelimited definition
From: Benjamin Tissoires
Date: Thu May 21 2026 - 12:09:01 EST
Hi,
On May 07 2026, 刘 凯 wrote:
> From 565c81e1b2e1aaad675d9844428af7b35f4328c6 Mon Sep 17 00:00:00 2001
> From: Liu Kai <lukace97@xxxxxxxxxxx>
> Date: Thu, 7 May 2026 16:32:04 +0800
> Subject: [PATCH] HID: remove duplicate hid_warn_ratelimited definition
>
> The hid_warn_ratelimited macro is defined twice in include/linux/hid.h:
> at line 1317 (added by commit 4051ead99888) and at line 1339 (added by
> commit 1d64624243af).
Checkpatch complained about not using the proper format for commits
(i.e. 'commit <12+ chars of sha1> ("<title line>")'). Also, putting
lines numbers in a commit description is not great, because they are
only valid for the time you wrote the patch, and if we apply other
things in the middle, they get wrong.
Last, your email client (outlook) mangled the patch and converted tabs
to space. I managed to apply it with --ignore-whitespace in git am, but
this adds extra steps. Please fix your process for your next submission.
Anyway, I've taken your patch in my local queue, and reformulated the
commit description with the remarks I made above. I should push this
soon.
Cheers,
Benjamin
>
> The second definition is correctly grouped with other ratelimited macros.
> Remove the duplicate definition at line 1317.
>
> Fixes: 1d64624243af ("HID: core: Add printk_ratelimited variants to hid_warn() etc")
> Signed-off-by: Liu Kai <lukace97@xxxxxxxxxxx>
> ---
> include/linux/hid.h | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/include/linux/hid.h b/include/linux/hid.h
> index 442a80d79e89..e1877a9a58e2 100644
> --- a/include/linux/hid.h
> +++ b/include/linux/hid.h
> @@ -1314,8 +1314,6 @@ void hid_quirks_exit(__u16 bus);
> dev_notice(&(hid)->dev, fmt, ##__VA_ARGS__)
> #define hid_warn(hid, fmt, ...) \
> dev_warn(&(hid)->dev, fmt, ##__VA_ARGS__)
> -#define hid_warn_ratelimited(hid, fmt, ...) \
> - dev_warn_ratelimited(&(hid)->dev, fmt, ##__VA_ARGS__)
> #define hid_info(hid, fmt, ...) \
> dev_info(&(hid)->dev, fmt, ##__VA_ARGS__)
> #define hid_dbg(hid, fmt, ...) \
> --
> 2.43.0