[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190521145116.24378-1-TheSven73@gmail.com>
Date: Tue, 21 May 2019 10:51:16 -0400
From: Sven Van Asbroeck <thesven73@...il.com>
To: Greg KH <gregkh@...uxfoundation.org>
Cc: devel@...verdev.osuosl.org,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: [PATCH] staging: fieldbus: anybuss: force address space conversion
The regmap's context (stored as 'void *') consists of a pointer to
__iomem. Mixing __iomem and non-__iomem addresses generates
sparse warnings.
Fix by using __force when converting to/from 'void __iomem *' and
the regmap's context.
Signed-off-by: Sven Van Asbroeck <TheSven73@...il.com>
---
drivers/staging/fieldbus/anybuss/arcx-anybus.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/fieldbus/anybuss/arcx-anybus.c b/drivers/staging/fieldbus/anybuss/arcx-anybus.c
index a167fb68e355..8126e5535ada 100644
--- a/drivers/staging/fieldbus/anybuss/arcx-anybus.c
+++ b/drivers/staging/fieldbus/anybuss/arcx-anybus.c
@@ -114,7 +114,7 @@ static void export_reset_1(struct device *dev, bool assert)
static int read_reg_bus(void *context, unsigned int reg,
unsigned int *val)
{
- void __iomem *base = context;
+ void __iomem *base = (__force void __iomem *)context;
*val = readb(base + reg);
return 0;
@@ -123,7 +123,7 @@ static int read_reg_bus(void *context, unsigned int reg,
static int write_reg_bus(void *context, unsigned int reg,
unsigned int val)
{
- void __iomem *base = context;
+ void __iomem *base = (__force void __iomem *)context;
writeb(val, base + reg);
return 0;
@@ -153,7 +153,7 @@ static struct regmap *create_parallel_regmap(struct platform_device *pdev,
base = devm_ioremap_resource(dev, res);
if (IS_ERR(base))
return ERR_CAST(base);
- return devm_regmap_init(dev, NULL, base, ®map_cfg);
+ return devm_regmap_init(dev, NULL, (__force void *)base, ®map_cfg);
}
static struct anybuss_host *
--
2.17.1
Powered by blists - more mailing lists