netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Randy Dunlap <rdunlap@infradead.org>
To: Shruti Kanetkar <Shruti@Freescale.com>, davem@davemloft.net
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH] net/fsl: Add format length modifier to avoid negative values
Date: Tue, 29 Jul 2014 13:29:29 -0700	[thread overview]
Message-ID: <53D80429.8070800@infradead.org> (raw)
In-Reply-To: <1406663583-8824-1-git-send-email-Shruti@Freescale.com>

On 07/29/14 12:53, Shruti Kanetkar wrote:
> Signed-off-by: Shruti Kanetkar <Shruti@Freescale.com>
> ---
>  drivers/net/ethernet/freescale/xgmac_mdio.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/freescale/xgmac_mdio.c b/drivers/net/ethernet/freescale/xgmac_mdio.c
> index 8173407..6e7db66 100644
> --- a/drivers/net/ethernet/freescale/xgmac_mdio.c
> +++ b/drivers/net/ethernet/freescale/xgmac_mdio.c
> @@ -163,7 +163,7 @@ static int xgmac_mdio_read(struct mii_bus *bus, int phy_id, int regnum)
>  	/* Return all Fs if nothing was there */
>  	if (in_be32(&regs->mdio_stat) & MDIO_STAT_RD_ER) {
>  		dev_err(&bus->dev,
> -			"Error while reading PHY%d reg at %d.%d\n",
> +			"Error while reading PHY%d reg at %d.%hhu\n",

I don't get it.  Please explain better.

regnum is not an unsigned char, but that is what %hhu indicates, isn't it?

>  			phy_id, dev_addr, regnum);

Earlier in the code, dev_addr is set to:
	uint16_t dev_addr = regnum >> 16;

and then we see that the register address is the low 16 bits of regnum:
	/* Set the register address */
	out_be32(&regs->mdio_addr, regnum & 0xffff);

so maybe this printk (dev_err) should just use regnum & 0xffff and %u format?

I'm certainly not sure about that suggestion, but the patch didn't make sense to me.

Thanks.

>  		return 0xffff;
>  	}
> 


-- 
~Randy

  reply	other threads:[~2014-07-29 20:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-29 19:53 [PATCH] net/fsl: Add format length modifier to avoid negative values Shruti Kanetkar
2014-07-29 20:29 ` Randy Dunlap [this message]
2014-07-31  2:58 ` David Miller

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=53D80429.8070800@infradead.org \
    --to=rdunlap@infradead.org \
    --cc=Shruti@Freescale.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    /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).