From: Ivo van Doorn <ivdoorn@gmail.com>
To: David Miller <davem@davemloft.net>
Cc: linville@tuxdriver.com, linux-wireless@vger.kernel.org,
rt2400-devel@lists.sourceforge.net
Subject: Re: [PATCH] rt2x00: Fix compile warning
Date: Sat, 2 Aug 2008 08:11:35 +0200 [thread overview]
Message-ID: <200808020811.35701.IvDoorn@gmail.com> (raw)
In-Reply-To: <20080801.223048.129067423.davem@davemloft.net>
On Saturday 02 August 2008, David Miller wrote:
> From: Ivo van Doorn <ivdoorn@gmail.com>
> 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@gmail.com>
>
> 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
next prev parent reply other threads:[~2008-08-02 5:48 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-02 5:49 [PATCH] rt2x00: Fix compile warning Ivo van Doorn
2008-08-02 5:30 ` David Miller
2008-08-02 6:11 ` Ivo van Doorn [this message]
2008-08-02 8:31 ` 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=200808020811.35701.IvDoorn@gmail.com \
--to=ivdoorn@gmail.com \
--cc=davem@davemloft.net \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
--cc=rt2400-devel@lists.sourceforge.net \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox