All of lore.kernel.org
 help / color / mirror / Atom feed
From: Larry Finger <Larry.Finger@lwfinger.net>
To: Benny Halevy <bhalevy@panasas.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Dominik Brodowski <linux@dominikbrodowski.net>
Subject: Re: Help with compiler warning
Date: Sun, 24 Aug 2008 10:50:57 -0500	[thread overview]
Message-ID: <48B18361.6000305@lwfinger.net> (raw)
In-Reply-To: <48B17EE0.2090608@panasas.com>

Benny Halevy wrote:
> On Aug. 24, 2008, 18:29 +0300, Benny Halevy <bhalevy@panasas.com> wrote:
>> On Aug. 22, 2008, 4:36 +0300, Larry Finger <Larry.Finger@lwfinger.net> wrote:
>>> In drivers/pcmcia/cardbus.c, the following statement
>>>
>>>          memcpy_fromio(ptr, s->cb_cis_virt + addr, len);
>>>
>>> generates the warning
>>>
>>>    CC [M]  drivers/pcmcia/cardbus.o
>>> include/asm/io_32.h: In function ‘memcpy_fromio’:
>>> include/asm/io_32.h:151: warning: passing argument 2 of ‘__memcpy’ 
>>> discards qualifiers from pointer target type
>>>
>>> s->cb_cis_virt is "void __iomem" and addr is uint.
>>>
>>> What cast does argument 2 need to silence the warning?
>> memcpy_fromio takes a (const volatile void __iomem *) for the 
>> src address.
> 
> So the culprit could be the volatile qualifier...

Changing it to

memcpy_fromio(ptr, (const volatile void __iomem *)(s->cb_cis_virt + 
addr), len);

memcpy_fromio(ptr, (const volatile void __iomem *)s->cb_cis_virt + 
addr, len);

memcpy_fromio(ptr, (volatile void __iomem *)(s->cb_cis_virt + addr), len);

or

memcpy_fromio(ptr, (volatile void __iomem *)s->cb_cis_virt + addr, len);

makes no difference.

Thanks,

Larry

  reply	other threads:[~2008-08-24 15:51 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-22  1:36 Help with compiler warning Larry Finger
2008-08-24 15:29 ` Benny Halevy
2008-08-24 15:31   ` Benny Halevy
2008-08-24 15:50     ` Larry Finger [this message]
2008-08-24 16:32       ` Andreas Schwab

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=48B18361.6000305@lwfinger.net \
    --to=larry.finger@lwfinger.net \
    --cc=bhalevy@panasas.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@dominikbrodowski.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 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.