From: Florian Fainelli <f.fainelli@gmail.com> To: netdev@vger.kernel.org Cc: "Florian Fainelli" <f.fainelli@gmail.com>, "Grygorii Strashko" <grygorii.strashko@ti.com>, "David S. Miller" <davem@davemloft.net>, "Ivan Khoronzhuk" <ivan.khoronzhuk@linaro.org>, "Andrew Morton" <akpm@linux-foundation.org>, Keerthy <j-keerthy@ti.com>, "Bhumika Goyal" <bhumirks@gmail.com>, "Hernán Gonzalez" <hernan@vanguardiasur.com.ar>, "Richard Cochran" <richardcochran@gmail.com>, "Lukas Wunner" <lukas@wunner.de>, "Rob Herring" <robh@kernel.org>, linux-omap@vger.kernel.org (open list:TI ETHERNET SWITCH DRIVER (CPSW)), linux-kernel@vger.kernel.org (open list) Subject: [PATCH net-next 3/5] net: ethernet: ti: cpsw: Fix cpsw_add_ch_strings() printk format Date: Mon, 21 May 2018 11:45:53 -0700 [thread overview] Message-ID: <20180521184555.21555-4-f.fainelli@gmail.com> (raw) In-Reply-To: <20180521184555.21555-1-f.fainelli@gmail.com> 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> --- drivers/net/ethernet/ti/cpsw.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c index a7285dddfd29..643cd2d9dfb6 100644 --- a/drivers/net/ethernet/ti/cpsw.c +++ b/drivers/net/ethernet/ti/cpsw.c @@ -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; } -- 2.14.1
WARNING: multiple messages have this Message-ID (diff)
From: Florian Fainelli <f.fainelli@gmail.com> To: netdev@vger.kernel.org Cc: "Florian Fainelli" <f.fainelli@gmail.com>, "Grygorii Strashko" <grygorii.strashko@ti.com>, "David S. Miller" <davem@davemloft.net>, "Ivan Khoronzhuk" <ivan.khoronzhuk@linaro.org>, "Andrew Morton" <akpm@linux-foundation.org>, Keerthy <j-keerthy@ti.com>, "Bhumika Goyal" <bhumirks@gmail.com>, "Hernán Gonzalez" <hernan@vanguardiasur.com.ar>, "Richard Cochran" <richardcochran@gmail.com>, "Lukas Wunner" <lukas@wunner.de>, "Rob Herring" <robh@kernel.org>, "open list:TI ETHERNET SWITCH DRIVER CPSW" <linux-omap@vger.kernel.org>, "open list" <linux-kernel@vger.kernel.org> Subject: [PATCH net-next 3/5] net: ethernet: ti: cpsw: Fix cpsw_add_ch_strings() printk format Date: Mon, 21 May 2018 11:45:53 -0700 [thread overview] Message-ID: <20180521184555.21555-4-f.fainelli@gmail.com> (raw) In-Reply-To: <20180521184555.21555-1-f.fainelli@gmail.com> 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> --- drivers/net/ethernet/ti/cpsw.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c index a7285dddfd29..643cd2d9dfb6 100644 --- a/drivers/net/ethernet/ti/cpsw.c +++ b/drivers/net/ethernet/ti/cpsw.c @@ -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; } -- 2.14.1
next prev parent reply other threads:[~2018-05-21 18:47 UTC|newest] Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top 2018-05-21 18:45 [PATCH net-next 0/5] TI Ethernet driver warnings fixes Florian Fainelli 2018-05-21 18:45 ` Florian Fainelli 2018-05-21 18:45 ` [PATCH net-next 1/5] ti: ethernet: cpdma: Use correct format for genpool_* Florian Fainelli 2018-05-21 18:45 ` Florian Fainelli 2018-05-21 18:45 ` [PATCH net-next 2/5] net: ethernet: ti: cpts: Fix timestamp print Florian Fainelli 2018-05-21 18:45 ` Florian Fainelli 2018-05-21 18:45 ` Florian Fainelli [this message] 2018-05-21 18:45 ` [PATCH net-next 3/5] net: ethernet: ti: cpsw: Fix cpsw_add_ch_strings() printk format Florian Fainelli 2018-05-21 18:45 ` [PATCH net-next 4/5] net: ethernet: davinci_emac: Fix printing of base address Florian Fainelli 2018-05-21 18:45 ` Florian Fainelli 2018-05-21 18:45 ` [PATCH net-next 5/5] ti: ethernet: davinci: Fix cast to int warnings Florian Fainelli 2018-05-21 18:45 ` Florian Fainelli 2018-05-21 20:18 ` [PATCH net-next 0/5] TI Ethernet driver warnings fixes 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=20180521184555.21555-4-f.fainelli@gmail.com \ --to=f.fainelli@gmail.com \ --cc=akpm@linux-foundation.org \ --cc=bhumirks@gmail.com \ --cc=davem@davemloft.net \ --cc=grygorii.strashko@ti.com \ --cc=hernan@vanguardiasur.com.ar \ --cc=ivan.khoronzhuk@linaro.org \ --cc=j-keerthy@ti.com \ --cc=linux-kernel@vger.kernel.org \ --cc=linux-omap@vger.kernel.org \ --cc=lukas@wunner.de \ --cc=netdev@vger.kernel.org \ --cc=richardcochran@gmail.com \ --cc=robh@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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.