linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] arm64: Rename temp variable in read*_relaxed()
@ 2015-05-18 11:10 Michal Simek
  2015-05-18 13:09 ` Liviu Dudau
  2015-05-18 13:30 ` Catalin Marinas
  0 siblings, 2 replies; 3+ messages in thread
From: Michal Simek @ 2015-05-18 11:10 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Olof Johansson, Liviu Dudau, Andre Przywara, Bjorn Helgaas,
	linux-kernel, Min-Hua Chen, Thierry Reding, Will Deacon,
	Catalin Marinas, Mark Rutland

This resolves the following sparse warning from readl() and other
macros, which ends up embedding readl_relaxed() using the same
variable.

Warning log:
include/asm-generic/io.h:364:16: warning: symbol '__v' shadows an
earlier one
include/asm-generic/io.h:364:16: originally declared here
include/asm-generic/io.h:372:16: warning: symbol '__v' shadows an
earlier one
include/asm-generic/io.h:372:16: originally declared here
include/asm-generic/io.h:380:16: warning: symbol '__v' shadows an
earlier one
include/asm-generic/io.h:380:16: originally declared here
include/asm-generic/io.h:568:16: warning: symbol '__v' shadows an
earlier one
include/asm-generic/io.h:568:16: originally declared here
include/asm-generic/io.h:576:16: warning: symbol '__v' shadows an
earlier one
include/asm-generic/io.h:576:16: originally declared here
include/asm-generic/io.h:584:16: warning: symbol '__v' shadows an
earlier one
include/asm-generic/io.h:584:16: originally declared here

The same patch was already applied to arm32 as
"ARM: 7118/1: rename temp variable in read*_relaxed()"
(sha1: b0c1264f534a1cb3c52036a23a04d238434a0df6)

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
---

 arch/arm64/include/asm/io.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm64/include/asm/io.h b/arch/arm64/include/asm/io.h
index 540f7c0aea82..cb18715cc60f 100644
--- a/arch/arm64/include/asm/io.h
+++ b/arch/arm64/include/asm/io.h
@@ -117,10 +117,10 @@ static inline u64 __raw_readq(const volatile void __iomem *addr)
  * ordering rules but do not guarantee any ordering relative to Normal memory
  * accesses.
  */
-#define readb_relaxed(c)	({ u8  __v = __raw_readb(c); __v; })
-#define readw_relaxed(c)	({ u16 __v = le16_to_cpu((__force __le16)__raw_readw(c)); __v; })
-#define readl_relaxed(c)	({ u32 __v = le32_to_cpu((__force __le32)__raw_readl(c)); __v; })
-#define readq_relaxed(c)	({ u64 __v = le64_to_cpu((__force __le64)__raw_readq(c)); __v; })
+#define readb_relaxed(c)	({ u8  __r = __raw_readb(c); __r; })
+#define readw_relaxed(c)	({ u16 __r = le16_to_cpu((__force __le16)__raw_readw(c)); __r; })
+#define readl_relaxed(c)	({ u32 __r = le32_to_cpu((__force __le32)__raw_readl(c)); __r; })
+#define readq_relaxed(c)	({ u64 __r = le64_to_cpu((__force __le64)__raw_readq(c)); __r; })
 
 #define writeb_relaxed(v,c)	((void)__raw_writeb((v),(c)))
 #define writew_relaxed(v,c)	((void)__raw_writew((__force u16)cpu_to_le16(v),(c)))
-- 
2.3.5


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] arm64: Rename temp variable in read*_relaxed()
  2015-05-18 11:10 [PATCH] arm64: Rename temp variable in read*_relaxed() Michal Simek
@ 2015-05-18 13:09 ` Liviu Dudau
  2015-05-18 13:30 ` Catalin Marinas
  1 sibling, 0 replies; 3+ messages in thread
From: Liviu Dudau @ 2015-05-18 13:09 UTC (permalink / raw)
  To: Michal Simek
  Cc: linux-arm-kernel, Olof Johansson, Andre Przywara, Bjorn Helgaas,
	linux-kernel, Min-Hua Chen, Thierry Reding, Will Deacon,
	Catalin Marinas, Mark Rutland

On Mon, May 18, 2015 at 12:10:48PM +0100, Michal Simek wrote:
> This resolves the following sparse warning from readl() and other
> macros, which ends up embedding readl_relaxed() using the same
> variable.
> 
> Warning log:
> include/asm-generic/io.h:364:16: warning: symbol '__v' shadows an
> earlier one
> include/asm-generic/io.h:364:16: originally declared here
> include/asm-generic/io.h:372:16: warning: symbol '__v' shadows an
> earlier one
> include/asm-generic/io.h:372:16: originally declared here
> include/asm-generic/io.h:380:16: warning: symbol '__v' shadows an
> earlier one
> include/asm-generic/io.h:380:16: originally declared here
> include/asm-generic/io.h:568:16: warning: symbol '__v' shadows an
> earlier one
> include/asm-generic/io.h:568:16: originally declared here
> include/asm-generic/io.h:576:16: warning: symbol '__v' shadows an
> earlier one
> include/asm-generic/io.h:576:16: originally declared here
> include/asm-generic/io.h:584:16: warning: symbol '__v' shadows an
> earlier one
> include/asm-generic/io.h:584:16: originally declared here
> 
> The same patch was already applied to arm32 as
> "ARM: 7118/1: rename temp variable in read*_relaxed()"
> (sha1: b0c1264f534a1cb3c52036a23a04d238434a0df6)
> 
> Signed-off-by: Michal Simek <michal.simek@xilinx.com>

Acked-by: Liviu Dudau <Liviu.Dudau@arm.com>

> ---
> 
>  arch/arm64/include/asm/io.h | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/arm64/include/asm/io.h b/arch/arm64/include/asm/io.h
> index 540f7c0aea82..cb18715cc60f 100644
> --- a/arch/arm64/include/asm/io.h
> +++ b/arch/arm64/include/asm/io.h
> @@ -117,10 +117,10 @@ static inline u64 __raw_readq(const volatile void __iomem *addr)
>   * ordering rules but do not guarantee any ordering relative to Normal memory
>   * accesses.
>   */
> -#define readb_relaxed(c)	({ u8  __v = __raw_readb(c); __v; })
> -#define readw_relaxed(c)	({ u16 __v = le16_to_cpu((__force __le16)__raw_readw(c)); __v; })
> -#define readl_relaxed(c)	({ u32 __v = le32_to_cpu((__force __le32)__raw_readl(c)); __v; })
> -#define readq_relaxed(c)	({ u64 __v = le64_to_cpu((__force __le64)__raw_readq(c)); __v; })
> +#define readb_relaxed(c)	({ u8  __r = __raw_readb(c); __r; })
> +#define readw_relaxed(c)	({ u16 __r = le16_to_cpu((__force __le16)__raw_readw(c)); __r; })
> +#define readl_relaxed(c)	({ u32 __r = le32_to_cpu((__force __le32)__raw_readl(c)); __r; })
> +#define readq_relaxed(c)	({ u64 __r = le64_to_cpu((__force __le64)__raw_readq(c)); __r; })
>  
>  #define writeb_relaxed(v,c)	((void)__raw_writeb((v),(c)))
>  #define writew_relaxed(v,c)	((void)__raw_writew((__force u16)cpu_to_le16(v),(c)))
> -- 
> 2.3.5
> 

-- 
====================
| I would like to |
| fix the world,  |
| but they're not |
| giving me the   |
 \ source code!  /
  ---------------
    ¯\_(ツ)_/¯


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] arm64: Rename temp variable in read*_relaxed()
  2015-05-18 11:10 [PATCH] arm64: Rename temp variable in read*_relaxed() Michal Simek
  2015-05-18 13:09 ` Liviu Dudau
@ 2015-05-18 13:30 ` Catalin Marinas
  1 sibling, 0 replies; 3+ messages in thread
From: Catalin Marinas @ 2015-05-18 13:30 UTC (permalink / raw)
  To: Michal Simek
  Cc: linux-arm-kernel, Mark Rutland, Min-Hua Chen, Andre Przywara,
	Liviu Dudau, linux-kernel, Will Deacon, Bjorn Helgaas,
	Olof Johansson, Thierry Reding

On Mon, May 18, 2015 at 01:10:48PM +0200, Michal Simek wrote:
> This resolves the following sparse warning from readl() and other
> macros, which ends up embedding readl_relaxed() using the same
> variable.
> 
> Warning log:
> include/asm-generic/io.h:364:16: warning: symbol '__v' shadows an
> earlier one
> include/asm-generic/io.h:364:16: originally declared here
> include/asm-generic/io.h:372:16: warning: symbol '__v' shadows an
> earlier one
> include/asm-generic/io.h:372:16: originally declared here
> include/asm-generic/io.h:380:16: warning: symbol '__v' shadows an
> earlier one
> include/asm-generic/io.h:380:16: originally declared here
> include/asm-generic/io.h:568:16: warning: symbol '__v' shadows an
> earlier one
> include/asm-generic/io.h:568:16: originally declared here
> include/asm-generic/io.h:576:16: warning: symbol '__v' shadows an
> earlier one
> include/asm-generic/io.h:576:16: originally declared here
> include/asm-generic/io.h:584:16: warning: symbol '__v' shadows an
> earlier one
> include/asm-generic/io.h:584:16: originally declared here
> 
> The same patch was already applied to arm32 as
> "ARM: 7118/1: rename temp variable in read*_relaxed()"
> (sha1: b0c1264f534a1cb3c52036a23a04d238434a0df6)
> 
> Signed-off-by: Michal Simek <michal.simek@xilinx.com>

Applied. Thanks.

-- 
Catalin

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-05-18 13:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-18 11:10 [PATCH] arm64: Rename temp variable in read*_relaxed() Michal Simek
2015-05-18 13:09 ` Liviu Dudau
2015-05-18 13:30 ` Catalin Marinas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).