public inbox for linux-arm-kernel@lists.infradead.org 
 help / color / mirror / Atom feed
From: nm@ti•com (Nishanth Menon)
To: linux-arm-kernel@lists•infradead.org
Subject: [PATCH v2 09/10] OMAP2/3: Convert write/read functions to raw read/write
Date: Thu, 7 Oct 2010 14:50:13 -0500	[thread overview]
Message-ID: <4CAE2475.4090607@ti.com> (raw)
In-Reply-To: <20101007185630.GA26435@n2100.arm.linux.org.uk>

Russell King - ARM Linux had written, on 10/07/2010 01:56 PM, the following:
> On Thu, Oct 07, 2010 at 07:17:08AM -0500, Menon, Nishanth wrote:
>>> -----Original Message-----
>>> From: linux-omap-owner at vger.kernel.org [mailto:linux-omap-
>>> owner at vger.kernel.org] On Behalf Of G, Manjunath Kondaiah
>>> Sent: Tuesday, September 21, 2010 5:01 AM
>>> To: linux-omap at vger.kernel.org
>>> Cc: linux-arm-kernel at lists.infradead.org; linux-mtd at lists.infradead.org
>>> Subject: [PATCH v2 09/10] OMAP2/3: Convert write/read functions to raw
>>> read/write
>>>
>>> Following sparse warnings exists due to use of writel/w and readl/w
>>> functions.
>>>
>>> This patch fixes the sparse warnings by converting readl/w functions usage
>>> into
>>> __raw_readl/__raw_readw functions.
>> Apologies on bringing up an old topic here -> Is'nt it better to fix
>> readl/w or writel/w than replacing it with __raw_readl/w etc?
> 
> No.  If you're getting sparse warnings its because _you_ are using
> readl/writel wrongly.
> 
> They take a void __iomem pointer, not a u32, unsigned long, int, or
> even a void pointer.
void __iomem *p;
...

readl(p);

unrolls to:
({ u32 __v = ({ u32 __v = (( __u32)(__le32)(( __le32) ((void)0, 
*(volatile unsigned int *)((p))))); __v; }); __asm__ __volatile__ ("mcr 
p15,
, %0, c7, c10, 5" : : "r" (0) : "memory"); __v; });

({ u32 __v = ({ u32 __v

seems to be the obvious cause of sparse warnings such as that attempted 
to be fixed in [1]

  warning: symbol '__v' shadows an earlier one

my comment being that by moving {read,write}[wlb] to __raw versions dont 
solve the real issue of namespace here. fix should be in 
arch/arm/include/asm/io.h IMHO. so that there are no overlaps as this.

[1]http://marc.info/?l=linux-omap&m=128506333803725&w=2

-- 
Regards,
Nishanth Menon

  reply	other threads:[~2010-10-07 19:50 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1285063280-4057-1-git-send-email-manjugk@ti.com>
     [not found] ` <1285063280-4057-8-git-send-email-manjugk@ti.com>
2010-09-27 11:07   ` [PATCH v2 07/10] TWL CORE: Fix sparse warning Samuel Ortiz
     [not found] ` <1285063280-4057-9-git-send-email-manjugk@ti.com>
2010-09-27 11:16   ` [PATCH v2 08/10] TWL IRQ: Fix fucntion declaration warnings Samuel Ortiz
2010-09-27 13:10     ` G, Manjunath Kondaiah
2010-09-27 13:49       ` G, Manjunath Kondaiah
2010-09-27 14:46         ` Samuel Ortiz
     [not found] ` <1285063280-4057-4-git-send-email-manjugk@ti.com>
2010-09-29 21:35   ` [PATCH v2 03/10] OMAP: mach-omap2: Fix static function warnings Paul Walmsley
2010-09-29 23:49     ` G, Manjunath Kondaiah
     [not found] ` <1285063280-4057-10-git-send-email-manjugk@ti.com>
2010-10-07 12:17   ` [PATCH v2 09/10] OMAP2/3: Convert write/read functions to raw read/write Menon, Nishanth
2010-10-07 18:56     ` Russell King - ARM Linux
2010-10-07 19:50       ` Nishanth Menon [this message]
2010-10-25  0:01         ` David Woodhouse
2010-10-25  5:34           ` G, Manjunath Kondaiah
2010-10-25 10:11             ` David Woodhouse
2010-10-25  7:54           ` Artem Bityutskiy
2010-10-07 17:39   ` Vimal Singh
     [not found] ` <1285063280-4057-2-git-send-email-manjugk@ti.com>
2010-10-08 20:12   ` [PATCH v2 01/10] OMAP: mach-omap2: Fix incorrect assignment warnings Kevin Hilman
2010-10-11  3:51     ` G, Manjunath Kondaiah

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=4CAE2475.4090607@ti.com \
    --to=nm@ti$(echo .)com \
    --cc=linux-arm-kernel@lists$(echo .)infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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