Commit 352b2e24 authored by Paul Walmsley's avatar Paul Walmsley Committed by Tony Lindgren

fix sparse, checkpatch warnings in OMAP2/3 SCM code

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: default avatarPaul Walmsley <paul@pwsan.com>
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
parent 7306009b
...@@ -13,15 +13,14 @@ ...@@ -13,15 +13,14 @@
#undef DEBUG #undef DEBUG
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/io.h>
#include <asm/io.h>
#include <asm/arch/control.h> #include <asm/arch/control.h>
static u32 omap2_ctrl_base; static u32 omap2_ctrl_base;
#define OMAP_CTRL_REGADDR(reg) (void __iomem *)IO_ADDRESS(omap2_ctrl_base \ #define OMAP_CTRL_REGADDR(reg) \
+ (reg)) (__force void __iomem *)IO_ADDRESS(omap2_ctrl_base + (reg))
void omap_ctrl_base_set(u32 base) void omap_ctrl_base_set(u32 base)
{ {
...@@ -51,7 +50,7 @@ u32 omap_ctrl_readl(u16 offset) ...@@ -51,7 +50,7 @@ u32 omap_ctrl_readl(u16 offset)
void omap_ctrl_writeb(u8 val, u16 offset) void omap_ctrl_writeb(u8 val, u16 offset)
{ {
pr_debug("omap_ctrl_writeb: writing 0x%0x to 0x%0x\n", val, 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)); __raw_writeb(val, OMAP_CTRL_REGADDR(offset));
} }
...@@ -59,7 +58,7 @@ void omap_ctrl_writeb(u8 val, u16 offset) ...@@ -59,7 +58,7 @@ void omap_ctrl_writeb(u8 val, u16 offset)
void omap_ctrl_writew(u16 val, u16 offset) void omap_ctrl_writew(u16 val, u16 offset)
{ {
pr_debug("omap_ctrl_writew: writing 0x%0x to 0x%0x\n", val, 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)); __raw_writew(val, OMAP_CTRL_REGADDR(offset));
} }
...@@ -67,7 +66,7 @@ void omap_ctrl_writew(u16 val, u16 offset) ...@@ -67,7 +66,7 @@ void omap_ctrl_writew(u16 val, u16 offset)
void omap_ctrl_writel(u32 val, u16 offset) void omap_ctrl_writel(u32 val, u16 offset)
{ {
pr_debug("omap_ctrl_writel: writing 0x%0x to 0x%0x\n", val, 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)); __raw_writel(val, OMAP_CTRL_REGADDR(offset));
} }
......
#ifndef __ASM_ARCH_CONTROL_H
#define __ASM_ARCH_CONTROL_H
/* /*
* include/asm-arm/arch-omap/control.h * include/asm-arm/arch-omap/control.h
* *
* OMAP2/3 System Control Module definitions * OMAP2/3 System Control Module definitions
* *
* Copyright (C) 2007 Texas Instruments, Inc. * Copyright (C) 2007-2008 Texas Instruments, Inc.
* Copyright (C) 2007 Nokia Corporation * Copyright (C) 2007-2008 Nokia Corporation
* *
* Written by Paul Walmsley * Written by Paul Walmsley
* *
...@@ -16,14 +13,17 @@ ...@@ -16,14 +13,17 @@
* the Free Software Foundation. * the Free Software Foundation.
*/ */
#ifndef __ASM_ARCH_CONTROL_H
#define __ASM_ARCH_CONTROL_H
#include <asm/arch/io.h> #include <asm/arch/io.h>
#define OMAP242X_CTRL_REGADDR(reg) \ #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) \ #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) \ #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 * As elsewhere, the "OMAP2_" prefix indicates that the macro is valid for
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment