Search Linux Wireless

Re: [PATCH] rt2x00: Fix compile warning

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Saturday 02 August 2008, David Miller wrote:
> From: Ivo van Doorn <ivdoorn@xxxxxxxxx>
> Date: Sat, 2 Aug 2008 07:49:08 +0200
> 
> > rt2x00usb_vendor_request_large_buff is write-only, so it is
> > safe to make the argument a const.
> > 
> > Fixes compile warning:
> > drivers/net/wireless/rt2x00/rt73usb.c: In function 'rt73usb_load_firmware':
> > drivers/net/wireless/rt2x00/rt73usb.c:916: warning: passing argument 5 of 'rt2x00usb_vendor_request_large_buff' discards qualifiers from pointer target typ
> > 
> > Signed-off-by: Ivo van Doorn <IvDoorn@xxxxxxxxx>
> 
> Are you sure?
> 
> This buffer pointer, via 'tb', eventually gets passed down
> to rt2x00usb_vendor_req_buff_lock which conditionally copies
> into the buffer.

Yes but rt2x00usb_vendor_req_buff_lock() can't use the const buffer since
it calls:
	memcpy(buffer, rt2x00dev->csr.cache, buffer_length);
and rt2x00usb_vendor_req_buff_lock() is valid for read commands.

Only rt2x00usb_vendor_request_large_buff() is write only, so that sounds like
the most sane place to convert the const pointer to the normal pointer.

Ivo
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux