All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nishanth Menon <nm@ti.com>
To: Russell King - ARM Linux <linux@arm.linux.org.uk>
Cc: "G, Manjunath Kondaiah" <manjugk@ti.com>,
	"linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>,
	"linux-mtd@lists.infradead.org" <linux-mtd@lists.infradead.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [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@vger.kernel.org [mailto:linux-omap-
>>> owner@vger.kernel.org] On Behalf Of G, Manjunath Kondaiah
>>> Sent: Tuesday, September 21, 2010 5:01 AM
>>> To: linux-omap@vger.kernel.org
>>> Cc: linux-arm-kernel@lists.infradead.org; linux-mtd@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

WARNING: multiple messages have this Message-ID (diff)
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: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-21 10:01 [PATCH v2 00/10] OMAP2/TWL: Fix Sparse warnings G, Manjunath Kondaiah
2010-09-21 10:01 ` [PATCH v2 01/10] OMAP: mach-omap2: Fix incorrect assignment warnings G, Manjunath Kondaiah
2010-10-08 20:12   ` Kevin Hilman
2010-10-08 20:12     ` Kevin Hilman
2010-10-11  3:51     ` G, Manjunath Kondaiah
2010-10-11  3:51       ` G, Manjunath Kondaiah
2010-09-21 10:01 ` [PATCH v2 02/10] OMAP: mach-omap2: Fix static declaration warnings G, Manjunath Kondaiah
2010-09-21 10:01 ` [PATCH v2 03/10] OMAP: mach-omap2: Fix static function warnings G, Manjunath Kondaiah
2010-09-29 21:35   ` Paul Walmsley
2010-09-29 21:35     ` Paul Walmsley
2010-09-29 23:49     ` G, Manjunath Kondaiah
2010-09-29 23:49       ` G, Manjunath Kondaiah
2010-09-21 10:01 ` [PATCH v2 04/10] OMAP: mach-omap2: Fix miscellaneous sparse warnings G, Manjunath Kondaiah
2010-09-21 10:01 ` [PATCH v2 05/10] OMAP: plat-omap: Fix static function warnings G, Manjunath Kondaiah
2010-09-21 10:01 ` [PATCH v2 06/10] OMAP: NAND: Fix static declaration warning G, Manjunath Kondaiah
2010-09-21 10:01 ` [PATCH v2 07/10] TWL CORE: Fix sparse warning G, Manjunath Kondaiah
2010-09-27 11:07   ` Samuel Ortiz
2010-09-27 11:07     ` Samuel Ortiz
2010-09-21 10:01 ` [PATCH v2 08/10] TWL IRQ: Fix fucntion declaration warnings G, Manjunath Kondaiah
2010-09-27 11:16   ` Samuel Ortiz
2010-09-27 11:16     ` Samuel Ortiz
2010-09-27 13:10     ` G, Manjunath Kondaiah
2010-09-27 13:10       ` G, Manjunath Kondaiah
2010-09-27 13:49       ` G, Manjunath Kondaiah
2010-09-27 13:49         ` G, Manjunath Kondaiah
2010-09-27 14:46         ` Samuel Ortiz
2010-09-27 14:46           ` Samuel Ortiz
2010-09-21 10:01 ` [PATCH v2 09/10] OMAP2/3: Convert write/read functions to raw read/write G, Manjunath Kondaiah
2010-10-07 12:17   ` Menon, Nishanth
2010-10-07 12:17     ` Menon, Nishanth
2010-10-07 12:17     ` Menon, Nishanth
2010-10-07 18:56     ` Russell King - ARM Linux
2010-10-07 18:56       ` Russell King - ARM Linux
2010-10-07 19:50       ` Nishanth Menon [this message]
2010-10-07 19:50         ` Nishanth Menon
2010-10-25  0:01         ` David Woodhouse
2010-10-25  0:01           ` David Woodhouse
2010-10-25  0:01           ` David Woodhouse
2010-10-25  5:34           ` G, Manjunath Kondaiah
2010-10-25  5:34             ` G, Manjunath Kondaiah
2010-10-25  5:34             ` G, Manjunath Kondaiah
2010-10-25 10:11             ` David Woodhouse
2010-10-25 10:11               ` David Woodhouse
2010-10-25 10:11               ` David Woodhouse
2010-10-25  7:54           ` Artem Bityutskiy
2010-10-25  7:54             ` Artem Bityutskiy
2010-10-25  7:54             ` Artem Bityutskiy
2010-10-07 17:39   ` Vimal Singh
2010-10-07 17:39     ` Vimal Singh
2010-09-21 10:01 ` [PATCH v2 10/10] OMAP3: Keypad: Fix incorrect type initializer 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.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=manjugk@ti.com \
    /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.