All of lore.kernel.org
 help / color / mirror / Atom feed
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 2/5] net: ethernet: ti: cpts: Fix timestamp print
Date: Mon, 21 May 2018 11:45:52 -0700	[thread overview]
Message-ID: <20180521184555.21555-3-f.fainelli@gmail.com> (raw)
In-Reply-To: <20180521184555.21555-1-f.fainelli@gmail.com>

On 64-bit hosts we will get the following warning:

drivers/net/ethernet/ti/cpts.c: In function 'cpts_overflow_check':
drivers/net/ethernet/ti/cpts.c:297:11: warning: format '%lld' expects
argument of type 'long long int', but argument 3 has type
'__kernel_time_t {aka long int}' [-Wformat=]
  pr_debug("cpts overflow check at %lld.%09lu\n", ts.tv_sec,
ts.tv_nsec);

Fix this by using an appropriate casting that works on all bit sizes.

Fixes: a5c79c26e168 ("ptp: cpts: convert to the 64 bit get/set time methods.")
Fixes: 87c0e764d43a ("cpts: introduce time stamping code and a PTP hardware clock.")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 drivers/net/ethernet/ti/cpts.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/ti/cpts.c b/drivers/net/ethernet/ti/cpts.c
index 7842f094f2ef..6f63c8729afc 100644
--- a/drivers/net/ethernet/ti/cpts.c
+++ b/drivers/net/ethernet/ti/cpts.c
@@ -294,7 +294,8 @@ static long cpts_overflow_check(struct ptp_clock_info *ptp)
 		delay = CPTS_SKB_TX_WORK_TIMEOUT;
 	spin_unlock_irqrestore(&cpts->lock, flags);
 
-	pr_debug("cpts overflow check at %lld.%09lu\n", ts.tv_sec, ts.tv_nsec);
+	pr_debug("cpts overflow check at %lld.%09ld\n",
+		 (long long)ts.tv_sec, ts.tv_nsec);
 	return (long)delay;
 }
 
-- 
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 2/5] net: ethernet: ti: cpts: Fix timestamp print
Date: Mon, 21 May 2018 11:45:52 -0700	[thread overview]
Message-ID: <20180521184555.21555-3-f.fainelli@gmail.com> (raw)
In-Reply-To: <20180521184555.21555-1-f.fainelli@gmail.com>

On 64-bit hosts we will get the following warning:

drivers/net/ethernet/ti/cpts.c: In function 'cpts_overflow_check':
drivers/net/ethernet/ti/cpts.c:297:11: warning: format '%lld' expects
argument of type 'long long int', but argument 3 has type
'__kernel_time_t {aka long int}' [-Wformat=]
  pr_debug("cpts overflow check at %lld.%09lu\n", ts.tv_sec,
ts.tv_nsec);

Fix this by using an appropriate casting that works on all bit sizes.

Fixes: a5c79c26e168 ("ptp: cpts: convert to the 64 bit get/set time methods.")
Fixes: 87c0e764d43a ("cpts: introduce time stamping code and a PTP hardware clock.")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 drivers/net/ethernet/ti/cpts.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/ti/cpts.c b/drivers/net/ethernet/ti/cpts.c
index 7842f094f2ef..6f63c8729afc 100644
--- a/drivers/net/ethernet/ti/cpts.c
+++ b/drivers/net/ethernet/ti/cpts.c
@@ -294,7 +294,8 @@ static long cpts_overflow_check(struct ptp_clock_info *ptp)
 		delay = CPTS_SKB_TX_WORK_TIMEOUT;
 	spin_unlock_irqrestore(&cpts->lock, flags);
 
-	pr_debug("cpts overflow check at %lld.%09lu\n", ts.tv_sec, ts.tv_nsec);
+	pr_debug("cpts overflow check at %lld.%09ld\n",
+		 (long long)ts.tv_sec, ts.tv_nsec);
 	return (long)delay;
 }
 
-- 
2.14.1

  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 ` Florian Fainelli [this message]
2018-05-21 18:45   ` [PATCH net-next 2/5] net: ethernet: ti: cpts: Fix timestamp print Florian Fainelli
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   ` 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-3-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: link
Be 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.