linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] wl1271: fix compiler warnings on 64 bit archs
@ 2009-08-11  8:58 Luciano Coelho
  2009-08-11 10:07 ` Stephen Rothwell
  0 siblings, 1 reply; 6+ messages in thread
From: Luciano Coelho @ 2009-08-11  8:58 UTC (permalink / raw)
  To: linux-wireless; +Cc: linville, linux-next, linux-kernel, sfr

There were a few warnings when compiling the wl1271 driver on 64 bit
architectures.  This was due to size mismatch of integers.

This commit fixes the following warnings:

drivers/net/wireless/wl12xx/wl1271_main.c: In function 'wl1271_irq_work':
drivers/net/wireless/wl12xx/wl1271_main.c:184: warning: large integer implicitly truncated to unsigned type
drivers/net/wireless/wl12xx/wl1271_boot.c: In function 'wl1271_boot_upload_firmware_chunk':
drivers/net/wireless/wl12xx/wl1271_boot.c:103: warning: format '%d' expects type 'int', but argument 2 has type 'size_t'
drivers/net/wireless/wl12xx/wl1271_boot.c:150: warning: format '%d' expects type 'int', but argument 2 has type 'size_t'
drivers/net/wireless/wl12xx/wl1271_boot.c: In function 'wl1271_boot_enable_interrupts':
drivers/net/wireless/wl12xx/wl1271_boot.c:278: warning: large integer implicitly truncated to unsigned type

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
---
 drivers/net/wireless/wl12xx/wl1271_boot.c |    9 +++++----
 drivers/net/wireless/wl12xx/wl1271_main.c |    3 ++-
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/net/wireless/wl12xx/wl1271_boot.c b/drivers/net/wireless/wl12xx/wl1271_boot.c
index 4c22f25..2b5d101 100644
--- a/drivers/net/wireless/wl12xx/wl1271_boot.c
+++ b/drivers/net/wireless/wl12xx/wl1271_boot.c
@@ -100,8 +100,8 @@ static int wl1271_boot_upload_firmware_chunk(struct wl1271 *wl, void *buf,
 
 	wl1271_debug(DEBUG_BOOT, "starting firmware upload");
 
-	wl1271_debug(DEBUG_BOOT, "fw_data_len %d chunk_size %d", fw_data_len,
-		CHUNK_SIZE);
+	wl1271_debug(DEBUG_BOOT, "fw_data_len %d chunk_size %d",
+		     (u32) fw_data_len, CHUNK_SIZE);
 
 
 	if ((fw_data_len % 4) != 0) {
@@ -148,7 +148,7 @@ static int wl1271_boot_upload_firmware_chunk(struct wl1271 *wl, void *buf,
 	addr = dest + chunk_num * CHUNK_SIZE;
 	p = buf + chunk_num * CHUNK_SIZE;
 	wl1271_debug(DEBUG_BOOT, "uploading fw last chunk (%d B) 0x%p to 0x%x",
-		     fw_data_len % CHUNK_SIZE, p, addr);
+		     (u32) fw_data_len % CHUNK_SIZE, p, addr);
 	wl1271_spi_mem_write(wl, addr, p, fw_data_len % CHUNK_SIZE);
 
 	return 0;
@@ -275,7 +275,8 @@ static int wl1271_boot_upload_nvs(struct wl1271 *wl)
 static void wl1271_boot_enable_interrupts(struct wl1271 *wl)
 {
 	enable_irq(wl->irq);
-	wl1271_reg_write32(wl, ACX_REG_INTERRUPT_MASK, ~(WL1271_INTR_MASK));
+	wl1271_reg_write32(wl, ACX_REG_INTERRUPT_MASK,
+			   WL1271_ACX_INTR_ALL & ~(WL1271_INTR_MASK));
 	wl1271_reg_write32(wl, HI_CFG, HI_CFG_DEF_VAL);
 }
 
diff --git a/drivers/net/wireless/wl12xx/wl1271_main.c b/drivers/net/wireless/wl12xx/wl1271_main.c
index 3bb45ce..4102d59 100644
--- a/drivers/net/wireless/wl12xx/wl1271_main.c
+++ b/drivers/net/wireless/wl12xx/wl1271_main.c
@@ -181,7 +181,8 @@ static void wl1271_irq_work(struct work_struct *work)
 	} while (intr && --ctr);
 
 out_sleep:
-	wl1271_reg_write32(wl, ACX_REG_INTERRUPT_MASK, ~(WL1271_INTR_MASK));
+	wl1271_reg_write32(wl, ACX_REG_INTERRUPT_MASK,
+			   WL1271_ACX_INTR_ALL & ~(WL1271_INTR_MASK));
 	wl1271_ps_elp_sleep(wl);
 
 out:
-- 
1.6.0.4


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

* Re: [PATCH] wl1271: fix compiler warnings on 64 bit archs
  2009-08-11  8:58 [PATCH] wl1271: fix compiler warnings on 64 bit archs Luciano Coelho
@ 2009-08-11 10:07 ` Stephen Rothwell
  2009-08-11 18:41   ` Luciano Coelho
  0 siblings, 1 reply; 6+ messages in thread
From: Stephen Rothwell @ 2009-08-11 10:07 UTC (permalink / raw)
  To: Luciano Coelho; +Cc: linux-wireless, linville, linux-next, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1060 bytes --]

Hi Luciano,

On Tue, 11 Aug 2009 11:58:27 +0300 Luciano Coelho <luciano.coelho@nokia.com> wrote:
>
> +++ b/drivers/net/wireless/wl12xx/wl1271_boot.c
> @@ -100,8 +100,8 @@ static int wl1271_boot_upload_firmware_chunk(struct wl1271 *wl, void *buf,
>  
>  	wl1271_debug(DEBUG_BOOT, "starting firmware upload");
>  
> -	wl1271_debug(DEBUG_BOOT, "fw_data_len %d chunk_size %d", fw_data_len,
> -		CHUNK_SIZE);
> +	wl1271_debug(DEBUG_BOOT, "fw_data_len %d chunk_size %d",
> +		     (u32) fw_data_len, CHUNK_SIZE);

fw_data_len is a size_t and so should be printed with %zd.

> @@ -148,7 +148,7 @@ static int wl1271_boot_upload_firmware_chunk(struct wl1271 *wl, void *buf,
>  	addr = dest + chunk_num * CHUNK_SIZE;
>  	p = buf + chunk_num * CHUNK_SIZE;
>  	wl1271_debug(DEBUG_BOOT, "uploading fw last chunk (%d B) 0x%p to 0x%x",
> -		     fw_data_len % CHUNK_SIZE, p, addr);
> +		     (u32) fw_data_len % CHUNK_SIZE, p, addr);

ditto.

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

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

* Re: [PATCH] wl1271: fix compiler warnings on 64 bit archs
  2009-08-11 10:07 ` Stephen Rothwell
@ 2009-08-11 18:41   ` Luciano Coelho
  2009-08-11 18:45     ` Randy Dunlap
  2009-08-11 19:15     ` John W. Linville
  0 siblings, 2 replies; 6+ messages in thread
From: Luciano Coelho @ 2009-08-11 18:41 UTC (permalink / raw)
  To: ext Stephen Rothwell; +Cc: linux-wireless, linville, linux-next, linux-kernel

ext Stephen Rothwell wrote:
> Hi Luciano,
>
> On Tue, 11 Aug 2009 11:58:27 +0300 Luciano Coelho <luciano.coelho@nokia.com> wrote:
>   
>> +++ b/drivers/net/wireless/wl12xx/wl1271_boot.c
>> @@ -100,8 +100,8 @@ static int wl1271_boot_upload_firmware_chunk(struct wl1271 *wl, void *buf,
>>  
>>  	wl1271_debug(DEBUG_BOOT, "starting firmware upload");
>>  
>> -	wl1271_debug(DEBUG_BOOT, "fw_data_len %d chunk_size %d", fw_data_len,
>> -		CHUNK_SIZE);
>> +	wl1271_debug(DEBUG_BOOT, "fw_data_len %d chunk_size %d",
>> +		     (u32) fw_data_len, CHUNK_SIZE);
>>     
>
> fw_data_len is a size_t and so should be printed with %zd.
>
>   
>> @@ -148,7 +148,7 @@ static int wl1271_boot_upload_firmware_chunk(struct wl1271 *wl, void *buf,
>>  	addr = dest + chunk_num * CHUNK_SIZE;
>>  	p = buf + chunk_num * CHUNK_SIZE;
>>  	wl1271_debug(DEBUG_BOOT, "uploading fw last chunk (%d B) 0x%p to 0x%x",
>> -		     fw_data_len % CHUNK_SIZE, p, addr);
>> +		     (u32) fw_data_len % CHUNK_SIZE, p, addr);
>>     
>
> ditto.
>   

Thanks! I didn't know about the z length modifier for printf (everyday 
learning something new!), I should have checked the manpage.  I'll fix 
this and send v2 of my patch.

-- 
Cheers,
Luca.


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

* Re: [PATCH] wl1271: fix compiler warnings on 64 bit archs
  2009-08-11 18:41   ` Luciano Coelho
@ 2009-08-11 18:45     ` Randy Dunlap
  2009-08-11 19:15     ` John W. Linville
  1 sibling, 0 replies; 6+ messages in thread
From: Randy Dunlap @ 2009-08-11 18:45 UTC (permalink / raw)
  To: Luciano Coelho
  Cc: ext Stephen Rothwell, linux-wireless, linville, linux-next, linux-kernel

On Tue, 11 Aug 2009 21:41:11 +0300 Luciano Coelho wrote:

> ext Stephen Rothwell wrote:
> > Hi Luciano,
> >
> > On Tue, 11 Aug 2009 11:58:27 +0300 Luciano Coelho <luciano.coelho@nokia.com> wrote:
> >   
> >> +++ b/drivers/net/wireless/wl12xx/wl1271_boot.c
> >> @@ -100,8 +100,8 @@ static int wl1271_boot_upload_firmware_chunk(struct wl1271 *wl, void *buf,
> >>  
> >>  	wl1271_debug(DEBUG_BOOT, "starting firmware upload");
> >>  
> >> -	wl1271_debug(DEBUG_BOOT, "fw_data_len %d chunk_size %d", fw_data_len,
> >> -		CHUNK_SIZE);
> >> +	wl1271_debug(DEBUG_BOOT, "fw_data_len %d chunk_size %d",
> >> +		     (u32) fw_data_len, CHUNK_SIZE);
> >>     
> >
> > fw_data_len is a size_t and so should be printed with %zd.
> >
> >   
> >> @@ -148,7 +148,7 @@ static int wl1271_boot_upload_firmware_chunk(struct wl1271 *wl, void *buf,
> >>  	addr = dest + chunk_num * CHUNK_SIZE;
> >>  	p = buf + chunk_num * CHUNK_SIZE;
> >>  	wl1271_debug(DEBUG_BOOT, "uploading fw last chunk (%d B) 0x%p to 0x%x",
> >> -		     fw_data_len % CHUNK_SIZE, p, addr);
> >> +		     (u32) fw_data_len % CHUNK_SIZE, p, addr);
> >>     
> >
> > ditto.
> >   
> 
> Thanks! I didn't know about the z length modifier for printf (everyday 
> learning something new!), I should have checked the manpage.  I'll fix 
> this and send v2 of my patch.

man page is fine, but you can also check (in the kernel source tree)
Documentation/printk-formats.txt


---
~Randy
LPC 2009, Sept. 23-25, Portland, Oregon
http://linuxplumbersconf.org/2009/

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

* Re: [PATCH] wl1271: fix compiler warnings on 64 bit archs
  2009-08-11 18:41   ` Luciano Coelho
  2009-08-11 18:45     ` Randy Dunlap
@ 2009-08-11 19:15     ` John W. Linville
  2009-08-11 19:43       ` Luciano Coelho
  1 sibling, 1 reply; 6+ messages in thread
From: John W. Linville @ 2009-08-11 19:15 UTC (permalink / raw)
  To: Luciano Coelho
  Cc: ext Stephen Rothwell, linux-wireless, linux-next, linux-kernel

On Tue, Aug 11, 2009 at 09:41:11PM +0300, Luciano Coelho wrote:
> ext Stephen Rothwell wrote:
>> Hi Luciano,
>>
>> On Tue, 11 Aug 2009 11:58:27 +0300 Luciano Coelho <luciano.coelho@nokia.com> wrote:
>>   
>>> +++ b/drivers/net/wireless/wl12xx/wl1271_boot.c
>>> @@ -100,8 +100,8 @@ static int wl1271_boot_upload_firmware_chunk(struct wl1271 *wl, void *buf,
>>>   	wl1271_debug(DEBUG_BOOT, "starting firmware upload");
>>>  -	wl1271_debug(DEBUG_BOOT, "fw_data_len %d chunk_size %d", 
>>> fw_data_len,
>>> -		CHUNK_SIZE);
>>> +	wl1271_debug(DEBUG_BOOT, "fw_data_len %d chunk_size %d",
>>> +		     (u32) fw_data_len, CHUNK_SIZE);
>>>     
>>
>> fw_data_len is a size_t and so should be printed with %zd.
>>
>>   
>>> @@ -148,7 +148,7 @@ static int wl1271_boot_upload_firmware_chunk(struct wl1271 *wl, void *buf,
>>>  	addr = dest + chunk_num * CHUNK_SIZE;
>>>  	p = buf + chunk_num * CHUNK_SIZE;
>>>  	wl1271_debug(DEBUG_BOOT, "uploading fw last chunk (%d B) 0x%p to 0x%x",
>>> -		     fw_data_len % CHUNK_SIZE, p, addr);
>>> +		     (u32) fw_data_len % CHUNK_SIZE, p, addr);
>>>     
>>
>> ditto.
>>   
>
> Thanks! I didn't know about the z length modifier for printf (everyday  
> learning something new!), I should have checked the manpage.  I'll fix  
> this and send v2 of my patch.

I've got it fixed-up already...

John
-- 
John W. Linville		Someday the world will need a hero, and you
linville@tuxdriver.com			might be all we have.  Be ready.

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

* Re: [PATCH] wl1271: fix compiler warnings on 64 bit archs
  2009-08-11 19:15     ` John W. Linville
@ 2009-08-11 19:43       ` Luciano Coelho
  0 siblings, 0 replies; 6+ messages in thread
From: Luciano Coelho @ 2009-08-11 19:43 UTC (permalink / raw)
  To: ext John W. Linville
  Cc: ext Stephen Rothwell, linux-wireless, linux-next, linux-kernel

ext John W. Linville wrote:
> On Tue, Aug 11, 2009 at 09:41:11PM +0300, Luciano Coelho wrote:
>   
>> Thanks! I didn't know about the z length modifier for printf (everyday  
>> learning something new!), I should have checked the manpage.  I'll fix  
>> this and send v2 of my patch.
>>     
>
> I've got it fixed-up already...
>   

Thanks, I noticed that it was already fixed in wireless-next after I had 
already sent v2.  Sorry for the trouble.

-- 
Cheers,
Luca.


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

end of thread, other threads:[~2009-08-11 19:44 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-11  8:58 [PATCH] wl1271: fix compiler warnings on 64 bit archs Luciano Coelho
2009-08-11 10:07 ` Stephen Rothwell
2009-08-11 18:41   ` Luciano Coelho
2009-08-11 18:45     ` Randy Dunlap
2009-08-11 19:15     ` John W. Linville
2009-08-11 19:43       ` Luciano Coelho

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