All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paul Walmsley <paul@pwsan.com>
To: linux-omap@vger.kernel.org
Subject: [PATCH 4/5] fix sparse, checkpatch warnings in OMAP2/3 SCM code
Date: Wed, 07 May 2008 11:52:02 -0600	[thread overview]
Message-ID: <20080507175202.17732.27747.stgit@localhost.localdomain> (raw)
In-Reply-To: <20080507171204.17732.97601.stgit@localhost.localdomain>

Fix sparse warnings with the OMAP2 SCM code. Involves tagging
appropriate pointer<->integer type conversions with __force.  Also fix
a checkpatch warning re: conversion of asm/ includes to linux/.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
---

 arch/arm/mach-omap2/control.c       |   13 ++++++-------
 include/asm-arm/arch-omap/control.h |   16 ++++++++--------
 2 files changed, 14 insertions(+), 15 deletions(-)

diff --git a/arch/arm/mach-omap2/control.c b/arch/arm/mach-omap2/control.c
index a5d86a4..400114b 100644
--- a/arch/arm/mach-omap2/control.c
+++ b/arch/arm/mach-omap2/control.c
@@ -13,15 +13,14 @@
 #undef DEBUG
 
 #include <linux/kernel.h>
-
-#include <asm/io.h>
+#include <linux/io.h>
 
 #include <asm/arch/control.h>
 
 static u32 omap2_ctrl_base;
 
-#define OMAP_CTRL_REGADDR(reg)	(void __iomem *)IO_ADDRESS(omap2_ctrl_base \
-								+ (reg))
+#define OMAP_CTRL_REGADDR(reg)					\
+	(__force void __iomem *)IO_ADDRESS(omap2_ctrl_base + (reg))
 
 void omap_ctrl_base_set(u32 base)
 {
@@ -51,7 +50,7 @@ u32 omap_ctrl_readl(u16 offset)
 void omap_ctrl_writeb(u8 val, u16 offset)
 {
 	pr_debug("omap_ctrl_writeb: writing 0x%0x to 0x%0x\n", val,
-		 (u32)OMAP_CTRL_REGADDR(offset));
+		 (__force u32)OMAP_CTRL_REGADDR(offset));
 
 	__raw_writeb(val, OMAP_CTRL_REGADDR(offset));
 }
@@ -59,7 +58,7 @@ void omap_ctrl_writeb(u8 val, u16 offset)
 void omap_ctrl_writew(u16 val, u16 offset)
 {
 	pr_debug("omap_ctrl_writew: writing 0x%0x to 0x%0x\n", val,
-		 (u32)OMAP_CTRL_REGADDR(offset));
+		 (__force u32)OMAP_CTRL_REGADDR(offset));
 
 	__raw_writew(val, OMAP_CTRL_REGADDR(offset));
 }
@@ -67,7 +66,7 @@ void omap_ctrl_writew(u16 val, u16 offset)
 void omap_ctrl_writel(u32 val, u16 offset)
 {
 	pr_debug("omap_ctrl_writel: writing 0x%0x to 0x%0x\n", val,
-		 (u32)OMAP_CTRL_REGADDR(offset));
+		 (__force u32)OMAP_CTRL_REGADDR(offset));
 
 	__raw_writel(val, OMAP_CTRL_REGADDR(offset));
 }
diff --git a/include/asm-arm/arch-omap/control.h b/include/asm-arm/arch-omap/control.h
index 9944bb5..abecbd9 100644
--- a/include/asm-arm/arch-omap/control.h
+++ b/include/asm-arm/arch-omap/control.h
@@ -1,13 +1,10 @@
-#ifndef __ASM_ARCH_CONTROL_H
-#define __ASM_ARCH_CONTROL_H
-
 /*
  * include/asm-arm/arch-omap/control.h
  *
  * OMAP2/3 System Control Module definitions
  *
- * Copyright (C) 2007 Texas Instruments, Inc.
- * Copyright (C) 2007 Nokia Corporation
+ * Copyright (C) 2007-2008 Texas Instruments, Inc.
+ * Copyright (C) 2007-2008 Nokia Corporation
  *
  * Written by Paul Walmsley
  *
@@ -16,14 +13,17 @@
  * the Free Software Foundation.
  */
 
+#ifndef __ASM_ARCH_CONTROL_H
+#define __ASM_ARCH_CONTROL_H
+
 #include <asm/arch/io.h>
 
 #define OMAP242X_CTRL_REGADDR(reg)					\
-	(void __iomem *)IO_ADDRESS(OMAP242X_CTRL_BASE + (reg))
+	(__force void __iomem *)IO_ADDRESS(OMAP242X_CTRL_BASE + (reg))
 #define OMAP243X_CTRL_REGADDR(reg)					\
-	(void __iomem *)IO_ADDRESS(OMAP243X_CTRL_BASE + (reg))
+	(__force void __iomem *)IO_ADDRESS(OMAP243X_CTRL_BASE + (reg))
 #define OMAP343X_CTRL_REGADDR(reg)					\
-	(void __iomem *)IO_ADDRESS(OMAP343X_CTRL_BASE + (reg))
+	(__force void __iomem *)IO_ADDRESS(OMAP343X_CTRL_BASE + (reg))
 
 /*
  * As elsewhere, the "OMAP2_" prefix indicates that the macro is valid for



  parent reply	other threads:[~2008-05-07 19:50 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-07 17:52 [PATCH 0/5] sparse, checkpatch cleanup in mach-omap2 Paul Walmsley
2008-05-07 17:52 ` [PATCH 1/5] fix sparse, checkpatch warnings in OMAP2/3 PRCM/PM code Paul Walmsley
2008-05-07 17:52 ` [PATCH 2/5] fix sparse, checkpatch warnings in OMAP2/3 SMS/GPMC/SRAM code Paul Walmsley
2008-05-07 17:52 ` [PATCH 5/5] Fix remaining sparse warnings in arch/arm/mach-omap2 Paul Walmsley
2008-05-07 17:52 ` Paul Walmsley [this message]
2008-05-07 17:52 ` [PATCH 3/5] fix sparse, checkpatch warnings in OMAP2/3 IRQ code Paul Walmsley
2008-05-09 21:42 ` [PATCH 0/5] sparse, checkpatch cleanup in mach-omap2 Tony Lindgren

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=20080507175202.17732.27747.stgit@localhost.localdomain \
    --to=paul@pwsan.com \
    --cc=linux-omap@vger.kernel.org \
    /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.