[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAKwvOdk0wgGrMLrebTcHU078Kjtgb_xR3ghnEgQeS3PxgxNzag@mail.gmail.com>
Date: Wed, 29 Mar 2023 10:41:13 -0700
From: Nick Desaulniers <ndesaulniers@...gle.com>
To: Nathan Chancellor <nathan@...nel.org>
Cc: davem@...emloft.net, edumazet@...gle.com, kuba@...nel.org,
pabeni@...hat.com, trix@...hat.com, razor@...ckwall.org,
kerneljasonxing@...il.com, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org, llvm@...ts.linux.dev,
patches@...ts.linux.dev
Subject: Re: [PATCH net-next] net: ethernet: ti: Fix format specifier in netcp_create_interface()
On Wed, Mar 29, 2023 at 10:10 AM Nick Desaulniers
<ndesaulniers@...gle.com> wrote:
>
> Because integer literals in C are signed, the cast is necessary to
> avoid the format specifier from warning about the wrong signedness.
> It would be preferable to have a `U` suffix on the literal value, then
> the cast would be unnecessary.
>
> Untested:
> ```
> diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
> index 494a23a976b0..67cb6bfc4056 100644
> --- a/include/linux/skbuff.h
> +++ b/include/linux/skbuff.h
> @@ -349,7 +349,7 @@ struct sk_buff;
> # define CONFIG_MAX_SKB_FRAGS 17
> #endif
>
> -#define MAX_SKB_FRAGS CONFIG_MAX_SKB_FRAGS
> +#define MAX_SKB_FRAGS CONFIG_MAX_SKB_FRAGS ## U
Or rather this trick.
https://godbolt.org/z/81aPxf39b
I forget what that's called (it's not xmacros); we definitely have a
macro for that in the kernel.
--
Thanks,
~Nick Desaulniers
Powered by blists - more mailing lists