]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
net: ethernet: ti: cpsw: Fix cpsw_add_ch_strings() printk format
authorFlorian Fainelli <f.fainelli@gmail.com>
Mon, 21 May 2018 18:45:53 +0000 (11:45 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 21 May 2018 20:17:10 +0000 (16:17 -0400)
When building on a 64-bit host we will get the following warning:

drivers/net/ethernet/ti/cpsw.c: In function 'cpsw_add_ch_strings':
drivers/net/ethernet/ti/cpsw.c:1284:19: warning: format '%d' expects
argument of type 'int', but argument 5 has type 'long unsigned int'
[-Wformat=]
     "%s DMA chan %d: %s", rx_dir ? "Rx" : "Tx",
                  ~^
                  %ld

Fix this by using an %ld format and casting to long.

Fixes: e05107e6b747 ("net: ethernet: ti: cpsw: add multi queue support")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/ti/cpsw.c

index a7285dddfd2913b2a5c4d9c73f05c39abe8dbd9b..643cd2d9dfb684b4e68041f16fb5f05049b91011 100644 (file)
@@ -1281,8 +1281,8 @@ static void cpsw_add_ch_strings(u8 **p, int ch_num, int rx_dir)
        for (i = 0; i < ch_stats_len; i++) {
                line = i % CPSW_STATS_CH_LEN;
                snprintf(*p, ETH_GSTRING_LEN,
-                        "%s DMA chan %d: %s", rx_dir ? "Rx" : "Tx",
-                        i / CPSW_STATS_CH_LEN,
+                        "%s DMA chan %ld: %s", rx_dir ? "Rx" : "Tx",
+                        (long)(i / CPSW_STATS_CH_LEN),
                         cpsw_gstrings_ch_stats[line].stat_string);
                *p += ETH_GSTRING_LEN;
        }