linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* mainline build: 11 warnings 0 failures (mainline/v3.13-rc8)
       [not found] <52d274b2.aa13450a.77fb.ffffe540@mx.google.com>
@ 2014-01-12 11:09 ` Russell King - ARM Linux
  2014-01-14 13:50   ` [PATCH] spi: davinci: fix build warning when printing resource_size_t vars Grygorii Strashko
  0 siblings, 1 reply; 5+ messages in thread
From: Russell King - ARM Linux @ 2014-01-12 11:09 UTC (permalink / raw)
  To: linux-arm-kernel

On Sun, Jan 12, 2014 at 02:55:46AM -0800, Olof's autobuilder wrote:
> Warnings:
>       1 drivers/leds/leds-pwm.c:88:22: warning: unused variable 'node' [-Wunused-variable]
>       1 drivers/net/ethernet/ti/cpsw.c:2140:2: warning: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'resource_size_t' [-Wformat=]
>       1 drivers/net/ethernet/ti/davinci_cpdma.c:182:3: warning: passing argument 3 of 'dma_alloc_attrs' from incompatible pointer type [enabled by default]
>       1 drivers/net/ethernet/ti/davinci_cpdma.c:222:25: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
>       1 drivers/net/ethernet/ti/davinci_cpdma.c:223:8: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
>       1 drivers/spi/spi-davinci.c:966:3: warning: format '%d' expects argument of type 'int', but argument 3 has type 'resource_size_t' [-Wformat=]
>       1 drivers/spi/spi-davinci.c:966:3: warning: format '%d' expects argument of type 'int', but argument 4 has type 'resource_size_t' [-Wformat=]
>       2 drivers/mtd/nand/gpmi-nand/gpmi-nand.c:123:13: warning: 'set_geometry_by_ecc_info' defined but not used [-Wunused-function]
>       2 net/netfilter/ipvs/ip_vs_sync.c:1640:8: warning: unused variable 'ret' [-Wunused-variable]

Every time I look at these build reports, I see these same old warnings
time and time again, which no one is addressing.  Some warnings are more
serious than others.  In this case:

warning: format 'XX' expects argument of type 'unsigned int', but argument X has type 'resource_size_t' [-Wformat=]

is a serious warning that's a real bug and really needs fixing.  Why?

It means that format expects to see a 32-bit argument, but has been passed
a potential 64-bit argument instead.

Firstly, remember that on EABI, 64-bit arguments need natural alignment in
memory and in registers.  So, if the 32-bit argument would've been in r1,
it actually gets passed in r2/r3 and r1 is unused.  The result will be
that we will print r1.

Secondly, any following arguments are not correctly accessed.  If any of
the following arguments are a pointer which we're going to dereference (eg,
due to a %s format or one of these new fangled %p formats), we will not
dereference the pointer that we think we should be - taking the above
example, the next argument will be r2, rather than the first stacked
argument.

All these resource_size_t warnings need to be fixed, and stay fixed.

-- 
FTTC broadband for 0.8mile line: 5.8Mbps down 500kbps up.  Estimation
in database were 13.1 to 19Mbit for a good line, about 7.5+ for a bad.
Estimate before purchase was "up to 13.2Mbit".

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

* [PATCH] spi: davinci: fix build warning when printing resource_size_t vars
  2014-01-12 11:09 ` mainline build: 11 warnings 0 failures (mainline/v3.13-rc8) Russell King - ARM Linux
@ 2014-01-14 13:50   ` Grygorii Strashko
  2014-01-14 14:39     ` Mark Brown
  0 siblings, 1 reply; 5+ messages in thread
From: Grygorii Strashko @ 2014-01-14 13:50 UTC (permalink / raw)
  To: linux-arm-kernel

Use %pa format specifier when printing variables of resource_size_t type
to fix build warnings:
drivers/spi/spi-davinci.c:966:3: warning: format '%d' expects argument of type 'int', but argument 3 has type 'resource_size_t'
drivers/spi/spi-davinci.c:966:3: warning: format '%d' expects argument of type 'int', but argument 4 has type 'resource_size_t'

Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
---
 drivers/spi/spi-davinci.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/spi/spi-davinci.c b/drivers/spi/spi-davinci.c
index 50b2d88..d3f6386 100644
--- a/drivers/spi/spi-davinci.c
+++ b/drivers/spi/spi-davinci.c
@@ -963,8 +963,8 @@ static int davinci_spi_probe(struct platform_device *pdev)
 			goto free_clk;
 
 		dev_info(&pdev->dev, "DMA: supported\n");
-		dev_info(&pdev->dev, "DMA: RX channel: %d, TX channel: %d, "
-				"event queue: %d\n", dma_rx_chan, dma_tx_chan,
+		dev_info(&pdev->dev, "DMA: RX channel: %pa, TX channel: %pa, "
+				"event queue: %d\n", &dma_rx_chan, &dma_tx_chan,
 				pdata->dma_event_q);
 	}
 
-- 
1.7.9.5

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

* [PATCH] spi: davinci: fix build warning when printing resource_size_t vars
  2014-01-14 13:50   ` [PATCH] spi: davinci: fix build warning when printing resource_size_t vars Grygorii Strashko
@ 2014-01-14 14:39     ` Mark Brown
  2014-01-14 14:41       ` Santosh Shilimkar
  0 siblings, 1 reply; 5+ messages in thread
From: Mark Brown @ 2014-01-14 14:39 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Jan 14, 2014 at 03:50:08PM +0200, Grygorii Strashko wrote:
> Use %pa format specifier when printing variables of resource_size_t type
> to fix build warnings:
> drivers/spi/spi-davinci.c:966:3: warning: format '%d' expects argument of type 'int', but argument 3 has type 'resource_size_t'
> drivers/spi/spi-davinci.c:966:3: warning: format '%d' expects argument of type 'int', but argument 4 has type 'resource_size_t'

This doesn't apply against current code, it seems the same patch has
already been applied.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20140114/fc47ddf5/attachment.sig>

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

* [PATCH] spi: davinci: fix build warning when printing resource_size_t vars
  2014-01-14 14:39     ` Mark Brown
@ 2014-01-14 14:41       ` Santosh Shilimkar
  2014-01-15 10:41         ` Grygorii Strashko
  0 siblings, 1 reply; 5+ messages in thread
From: Santosh Shilimkar @ 2014-01-14 14:41 UTC (permalink / raw)
  To: linux-arm-kernel

On Tuesday 14 January 2014 09:39 AM, Mark Brown wrote:
> On Tue, Jan 14, 2014 at 03:50:08PM +0200, Grygorii Strashko wrote:
>> Use %pa format specifier when printing variables of resource_size_t type
>> to fix build warnings:
>> drivers/spi/spi-davinci.c:966:3: warning: format '%d' expects argument of type 'int', but argument 3 has type 'resource_size_t'
>> drivers/spi/spi-davinci.c:966:3: warning: format '%d' expects argument of type 'int', but argument 4 has type 'resource_size_t'
> 
> This doesn't apply against current code, it seems the same patch has
> already been applied.
> 
Yeah. I did send same patch last merge window time-frame which has been
applied by you.

Regards,
Santosh

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

* [PATCH] spi: davinci: fix build warning when printing resource_size_t vars
  2014-01-14 14:41       ` Santosh Shilimkar
@ 2014-01-15 10:41         ` Grygorii Strashko
  0 siblings, 0 replies; 5+ messages in thread
From: Grygorii Strashko @ 2014-01-15 10:41 UTC (permalink / raw)
  To: linux-arm-kernel

On 01/14/2014 04:41 PM, Santosh Shilimkar wrote:
> On Tuesday 14 January 2014 09:39 AM, Mark Brown wrote:
>> On Tue, Jan 14, 2014 at 03:50:08PM +0200, Grygorii Strashko wrote:
>>> Use %pa format specifier when printing variables of resource_size_t type
>>> to fix build warnings:
>>> drivers/spi/spi-davinci.c:966:3: warning: format '%d' expects argument of type 'int', but argument 3 has type 'resource_size_t'
>>> drivers/spi/spi-davinci.c:966:3: warning: format '%d' expects argument of type 'int', but argument 4 has type 'resource_size_t'
>>
>> This doesn't apply against current code, it seems the same patch has
>> already been applied.
>>
> Yeah. I did send same patch last merge window time-frame which has been
> applied by you.

Ops. Sorry for the noise.

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

end of thread, other threads:[~2014-01-15 10:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <52d274b2.aa13450a.77fb.ffffe540@mx.google.com>
2014-01-12 11:09 ` mainline build: 11 warnings 0 failures (mainline/v3.13-rc8) Russell King - ARM Linux
2014-01-14 13:50   ` [PATCH] spi: davinci: fix build warning when printing resource_size_t vars Grygorii Strashko
2014-01-14 14:39     ` Mark Brown
2014-01-14 14:41       ` Santosh Shilimkar
2014-01-15 10:41         ` Grygorii Strashko

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