[PATCH v2] staging: sm750fb: Fix sparse warning

Subsystems: staging - silicon motion sm750 frame buffer driver, staging subsystem, the rest

STALE4213d

3 messages, 2 authors, 2015-03-10 · open the first message on its own page

[PATCH v2] staging: sm750fb: Fix sparse warning

From: Lorenzo Stoakes <hidden>
Date: 2015-03-10 08:52:10

This patch fixes the following sparse warning:-

drivers/staging/sm750fb/ddk750_help.c: warning: incorrect type in assignment (different address spaces)

In addition it eliminates an unnecessary volatile.

Signed-off-by: Lorenzo Stoakes <redacted>
---
 drivers/staging/sm750fb/ddk750_chip.h | 4 +++-
 drivers/staging/sm750fb/ddk750_help.c | 2 +-
 2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/sm750fb/ddk750_chip.h b/drivers/staging/sm750fb/ddk750_chip.h
index 1c78875..a4e5bcc 100644
--- a/drivers/staging/sm750fb/ddk750_chip.h
+++ b/drivers/staging/sm750fb/ddk750_chip.h
@@ -3,6 +3,8 @@
 #define DEFAULT_INPUT_CLOCK 14318181 /* Default reference clock */
 #define SM750LE_REVISION_ID (char)0xfe
 
+#include <linux/io.h>
+
 /* This is all the chips recognized by this library */
 typedef enum _logical_chip_type_t
 {
@@ -70,7 +72,7 @@ logical_chip_type_t getChipType(void);
 unsigned int calcPllValue(unsigned int request,pll_value_t *pll);
 unsigned int calcPllValue2(unsigned int,pll_value_t *);
 unsigned int formatPllReg(pll_value_t *pPLL);
-void ddk750_set_mmio(volatile unsigned char *,unsigned short,char);
+void ddk750_set_mmio(unsigned char __iomem *,unsigned short,char);
 unsigned int ddk750_getVMSize(void);
 int ddk750_initHw(initchip_param_t *);
 unsigned int getPllValue(clock_type_t clockType, pll_value_t *pPLL);
diff --git a/drivers/staging/sm750fb/ddk750_help.c b/drivers/staging/sm750fb/ddk750_help.c
index cc00d2b..6ad4dec 100644
--- a/drivers/staging/sm750fb/ddk750_help.c
+++ b/drivers/staging/sm750fb/ddk750_help.c
@@ -7,7 +7,7 @@ char revId750 = 0;
 unsigned short devId750 = 0;
 
 /* after driver mapped io registers, use this function first */
-void ddk750_set_mmio(volatile unsigned char * addr,unsigned short devId,char revId)
+void ddk750_set_mmio(unsigned char __iomem * addr,unsigned short devId,char revId)
 {
 	mmio750 = addr;
 	devId750 = devId;
-- 
2.3.2

Re: [PATCH v2] staging: sm750fb: Fix sparse warning

From: Greg KH <gregkh@linuxfoundation.org>
Date: 2015-03-10 15:06:19

On Tue, Mar 10, 2015 at 08:51:59AM +0000, Lorenzo Stoakes wrote:
This patch fixes the following sparse warning:-

drivers/staging/sm750fb/ddk750_help.c: warning: incorrect type in assignment (different address spaces)

In addition it eliminates an unnecessary volatile.
This doesn't apply anymore due to other patches I just took, so can you
rebase this patch on my latest staging-testing branch of staging.git?

Also, how about someone fixing the real compiler warnings this driver is
spitting out first, before we worry about sparse warnings?  That's much
more relevant here as it's keeping the driver from being built in
linux-next at the moment.

thanks,

greg k-h

Re: [PATCH v2] staging: sm750fb: Fix sparse warning

From: Lorenzo Stoakes <hidden>
Date: 2015-03-10 15:33:16

On 10 March 2015 at 15:06, Greg KH [off-list ref] wrote:
This doesn't apply anymore due to other patches I just took, so can you
rebase this patch on my latest staging-testing branch of staging.git?
Fixed in v3 of staging: sm750fb: Cleanup the type of mmio75.
Also, how about someone fixing the real compiler warnings this driver is
spitting out first, before we worry about sparse warnings?  That's much
more relevant here as it's keeping the driver from being built in
linux-next at the moment.

thanks,

greg k-h
I am more than happy to take a look at this later today when I have
the opportunity to do so :)

-- 
Lorenzo Stoakes
https:/ljs.io
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help