netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] liquidio: fix: warning: %u in format string (no. 3) requires 'unsigned int' but the argument type is 'signed int'.
@ 2020-12-30  6:41 YANG LI
  2020-12-30  6:49 ` Joe Perches
  0 siblings, 1 reply; 2+ messages in thread
From: YANG LI @ 2020-12-30  6:41 UTC (permalink / raw)
  To: davem; +Cc: kuba, dchickles, sburla, fmanlunas, netdev, linux-kernel, YANG LI

For safety, modify '%u' to '%d' to keep the type consistent.

Signed-off-by: YANG LI <abaci-bugfix@linux.alibaba.com>
Reported-by: Abaci <abaci@linux.alibaba.com>
---
 drivers/net/ethernet/cavium/liquidio/lio_core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/cavium/liquidio/lio_core.c b/drivers/net/ethernet/cavium/liquidio/lio_core.c
index 37d0641..07846f9 100644
--- 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,
-- 
1.8.3.1


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

* Re: [PATCH] liquidio: fix: warning: %u in format string (no. 3) requires 'unsigned int' but the argument type is 'signed int'.
  2020-12-30  6:41 [PATCH] liquidio: fix: warning: %u in format string (no. 3) requires 'unsigned int' but the argument type is 'signed int' YANG LI
@ 2020-12-30  6:49 ` Joe Perches
  0 siblings, 0 replies; 2+ messages in thread
From: Joe Perches @ 2020-12-30  6:49 UTC (permalink / raw)
  To: YANG LI, davem; +Cc: kuba, dchickles, sburla, fmanlunas, netdev, linux-kernel

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,



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

end of thread, other threads:[~2020-12-30  6:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-30  6:41 [PATCH] liquidio: fix: warning: %u in format string (no. 3) requires 'unsigned int' but the argument type is 'signed int' YANG LI
2020-12-30  6:49 ` Joe Perches

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