linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] enetc: use correct format characters
@ 2022-03-16 21:31 Bill Wendling
  2022-03-17 17:37 ` Claudiu Manoil
  2022-03-17 23:50 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 4+ messages in thread
From: Bill Wendling @ 2022-03-16 21:31 UTC (permalink / raw)
  To: Claudiu Manoil, David S . Miller, Jakub Kicinski,
	Nathan Chancellor, Nick Desaulniers, netdev, linux-kernel, llvm
  Cc: Bill Wendling

When compiling with -Wformat, clang emits the following warning:

drivers/net/ethernet/freescale/enetc/enetc_mdio.c:151:22: warning:
format specifies type 'unsigned char' but the argument has type 'int'
[-Wformat]
                        phy_id, dev_addr, regnum);
                                          ^~~~~~
./include/linux/dev_printk.h:163:47: note: expanded from macro 'dev_dbg'
                dev_printk(KERN_DEBUG, dev, dev_fmt(fmt), ##__VA_ARGS__); \
                                                    ~~~     ^~~~~~~~~~~
./include/linux/dev_printk.h:129:34: note: expanded from macro 'dev_printk'
                _dev_printk(level, dev, fmt, ##__VA_ARGS__);            \
                                        ~~~    ^~~~~~~~~~~

The types of these arguments are unconditionally defined, so this patch
updates the format character to the correct ones for ints and unsigned
ints.

Link: ClangBuiltLinux/linux#378
Signed-off-by: Bill Wendling <morbo@google.com>
---
 drivers/net/ethernet/freescale/enetc/enetc_mdio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/freescale/enetc/enetc_mdio.c b/drivers/net/ethernet/freescale/enetc/enetc_mdio.c
index 70e6d97b380f..1c8f5cc6dec4 100644
--- a/drivers/net/ethernet/freescale/enetc/enetc_mdio.c
+++ b/drivers/net/ethernet/freescale/enetc/enetc_mdio.c
@@ -147,7 +147,7 @@ int enetc_mdio_read(struct mii_bus *bus, int phy_id, int regnum)
 	/* return all Fs if nothing was there */
 	if (enetc_mdio_rd(mdio_priv, ENETC_MDIO_CFG) & MDIO_CFG_RD_ER) {
 		dev_dbg(&bus->dev,
-			"Error while reading PHY%d reg at %d.%hhu\n",
+			"Error while reading PHY%d reg at %d.%d\n",
 			phy_id, dev_addr, regnum);
 		return 0xffff;
 	}
-- 
2.35.1.723.g4982287a31-goog


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* RE: [PATCH] enetc: use correct format characters
  2022-03-16 21:31 [PATCH] enetc: use correct format characters Bill Wendling
@ 2022-03-17 17:37 ` Claudiu Manoil
  2022-03-17 18:51   ` Bill Wendling
  2022-03-17 23:50 ` patchwork-bot+netdevbpf
  1 sibling, 1 reply; 4+ messages in thread
From: Claudiu Manoil @ 2022-03-17 17:37 UTC (permalink / raw)
  To: Bill Wendling, David S . Miller, Jakub Kicinski,
	Nathan Chancellor, Nick Desaulniers, netdev, linux-kernel, llvm

> -----Original Message-----
> From: Bill Wendling <morbo@google.com>
> Sent: Wednesday, March 16, 2022 11:31 PM
[...]
> Subject: [PATCH] enetc: use correct format characters
> 
> When compiling with -Wformat, clang emits the following warning:
> 
> drivers/net/ethernet/freescale/enetc/enetc_mdio.c:151:22: warning:
> format specifies type 'unsigned char' but the argument has type 'int'
> [-Wformat]
>                         phy_id, dev_addr, regnum);
>                                           ^~~~~~
> ./include/linux/dev_printk.h:163:47: note: expanded from macro 'dev_dbg'
>                 dev_printk(KERN_DEBUG, dev, dev_fmt(fmt), ##__VA_ARGS__); \
>                                                     ~~~     ^~~~~~~~~~~
> ./include/linux/dev_printk.h:129:34: note: expanded from macro
> 'dev_printk'
>                 _dev_printk(level, dev, fmt, ##__VA_ARGS__);            \
>                                         ~~~    ^~~~~~~~~~~
> 
> The types of these arguments are unconditionally defined, so this patch
> updates the format character to the correct ones for ints and unsigned ints.
> 
> Link: ClangBuiltLinux/linux#378
> Signed-off-by: Bill Wendling <morbo@google.com>

Reviewed-by: Claudiu Manoil <claudiu.manoil@nxp.com>
Fixes: ebfcb23d62ab ("enetc: Add ENETC PF level external MDIO support")

Can be also net-next material. It's up to you. Thx.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] enetc: use correct format characters
  2022-03-17 17:37 ` Claudiu Manoil
@ 2022-03-17 18:51   ` Bill Wendling
  0 siblings, 0 replies; 4+ messages in thread
From: Bill Wendling @ 2022-03-17 18:51 UTC (permalink / raw)
  To: Claudiu Manoil
  Cc: David S . Miller, Jakub Kicinski, Nathan Chancellor,
	Nick Desaulniers, netdev, linux-kernel, llvm

On Thu, Mar 17, 2022 at 10:37 AM Claudiu Manoil <claudiu.manoil@nxp.com> wrote:
>
> > -----Original Message-----
> > From: Bill Wendling <morbo@google.com>
> > Sent: Wednesday, March 16, 2022 11:31 PM
> [...]
> > Subject: [PATCH] enetc: use correct format characters
> >
> > When compiling with -Wformat, clang emits the following warning:
> >
> > drivers/net/ethernet/freescale/enetc/enetc_mdio.c:151:22: warning:
> > format specifies type 'unsigned char' but the argument has type 'int'
> > [-Wformat]
> >                         phy_id, dev_addr, regnum);
> >                                           ^~~~~~
> > ./include/linux/dev_printk.h:163:47: note: expanded from macro 'dev_dbg'
> >                 dev_printk(KERN_DEBUG, dev, dev_fmt(fmt), ##__VA_ARGS__); \
> >                                                     ~~~     ^~~~~~~~~~~
> > ./include/linux/dev_printk.h:129:34: note: expanded from macro
> > 'dev_printk'
> >                 _dev_printk(level, dev, fmt, ##__VA_ARGS__);            \
> >                                         ~~~    ^~~~~~~~~~~
> >
> > The types of these arguments are unconditionally defined, so this patch
> > updates the format character to the correct ones for ints and unsigned ints.
> >
> > Link: ClangBuiltLinux/linux#378
> > Signed-off-by: Bill Wendling <morbo@google.com>
>
> Reviewed-by: Claudiu Manoil <claudiu.manoil@nxp.com>
> Fixes: ebfcb23d62ab ("enetc: Add ENETC PF level external MDIO support")
>
Thanks Claudiu.

Could you change the Link about to this one? It's a valid URL.

Link: https://github.com/ClangBuiltLinux/linux/issues/378

> Can be also net-next material. It's up to you. Thx.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] enetc: use correct format characters
  2022-03-16 21:31 [PATCH] enetc: use correct format characters Bill Wendling
  2022-03-17 17:37 ` Claudiu Manoil
@ 2022-03-17 23:50 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-03-17 23:50 UTC (permalink / raw)
  To: Bill Wendling
  Cc: claudiu.manoil, davem, kuba, nathan, ndesaulniers, netdev,
	linux-kernel, llvm

Hello:

This patch was applied to netdev/net-next.git (master)
by Jakub Kicinski <kuba@kernel.org>:

On Wed, 16 Mar 2022 14:31:09 -0700 you wrote:
> When compiling with -Wformat, clang emits the following warning:
> 
> drivers/net/ethernet/freescale/enetc/enetc_mdio.c:151:22: warning:
> format specifies type 'unsigned char' but the argument has type 'int'
> [-Wformat]
>                         phy_id, dev_addr, regnum);
>                                           ^~~~~~
> ./include/linux/dev_printk.h:163:47: note: expanded from macro 'dev_dbg'
>                 dev_printk(KERN_DEBUG, dev, dev_fmt(fmt), ##__VA_ARGS__); \
>                                                     ~~~     ^~~~~~~~~~~
> ./include/linux/dev_printk.h:129:34: note: expanded from macro 'dev_printk'
>                 _dev_printk(level, dev, fmt, ##__VA_ARGS__);            \
>                                         ~~~    ^~~~~~~~~~~
> 
> [...]

Here is the summary with links:
  - enetc: use correct format characters
    https://git.kernel.org/netdev/net-next/c/df4d35e1f01f

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-03-17 23:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-16 21:31 [PATCH] enetc: use correct format characters Bill Wendling
2022-03-17 17:37 ` Claudiu Manoil
2022-03-17 18:51   ` Bill Wendling
2022-03-17 23:50 ` patchwork-bot+netdevbpf

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).