mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: YANG LI <abaci-bugfix@linux.alibaba.com>, davem@davemloft.net
Cc: kuba@kernel.org, dchickles@marvell.com, sburla@marvell.com,
	fmanlunas@marvell.com, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] liquidio: fix: warning: %u in format string (no. 3) requires 'unsigned int' but the argument type is 'signed int'.
Date: Tue, 29 Dec 2020 22:49:31 -0800	[thread overview]
Message-ID: <42f953220e40a2e32540f729f03b762610b35a42.camel@perches.com> (raw)
In-Reply-To: <1609310480-80777-1-git-send-email-abaci-bugfix@linux.alibaba.com>

On Wed, 2020-12-30 at 14:41 +0800, YANG LI wrote:
> For safety, modify '%u' to '%d' to keep the type consistent.

There is no additional safety here.

The for loop ensures that i is positive as num_ioq_vector is also
int and so i can not be negative as it's incremented from 0.

> diff --git a/drivers/net/ethernet/cavium/liquidio/lio_core.c b/drivers/net/ethernet/cavium/liquidio/lio_core.c
[]
> @@ -1109,12 +1109,12 @@ int octeon_setup_interrupt(struct octeon_device *oct, u32 num_ioqs)
>  		for (i = 0 ; i < num_ioq_vectors ; i++) {
>  			if (OCTEON_CN23XX_PF(oct))
>  				snprintf(&queue_irq_names[IRQ_NAME_OFF(i)],
> -					 INTRNAMSIZ, "LiquidIO%u-pf%u-rxtx-%u",
> +					 INTRNAMSIZ, "LiquidIO%u-pf%u-rxtx-%d",
>  					 oct->octeon_id, oct->pf_num, i);
>  
> 
>  			if (OCTEON_CN23XX_VF(oct))
>  				snprintf(&queue_irq_names[IRQ_NAME_OFF(i)],
> -					 INTRNAMSIZ, "LiquidIO%u-vf%u-rxtx-%u",
> +					 INTRNAMSIZ, "LiquidIO%u-vf%u-rxtx-%d",
>  					 oct->octeon_id, oct->vf_num, i);
>  
> 
>  			irqret = request_irq(msix_entries[i].vector,



      reply	other threads:[~2020-12-30  6:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-30  6:41 YANG LI
2020-12-30  6:49 ` Joe Perches [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=42f953220e40a2e32540f729f03b762610b35a42.camel@perches.com \
    --to=joe@perches.com \
    --cc=abaci-bugfix@linux.alibaba.com \
    --cc=davem@davemloft.net \
    --cc=dchickles@marvell.com \
    --cc=fmanlunas@marvell.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=sburla@marvell.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

all inboxes | Powered by JetHome®