diff options
author | Aaro Koskinen <aaro.koskinen@iki.fi> | 2011-09-13 19:49:33 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-09-16 18:16:48 (GMT) |
commit | c44fa627c7b351cb359b7bd373756776b907ecd5 (patch) | |
tree | 0df5300ac4eae6985555bcf3c0f54de280510b51 /drivers/staging/xgifb | |
parent | 4b4954621ff57e168ebd77b7d2682308d13b4e7f (diff) | |
download | linux-c44fa627c7b351cb359b7bd373756776b907ecd5.tar.xz |
staging: xgifb: vb_init: use readl()/writel() to access iomapped memory
Use readl() and writel() in FB memory test instead of direct pointer
access, and also add iomem annotations for the FB memory.
The patch eliminates the following sparse warnings:
drivers/staging/xgifb/XGI_main_26.c:2113:69: warning: incorrect type in assignment (different address spaces)
drivers/staging/xgifb/XGI_main_26.c:2113:69: expected unsigned char *static [addressable] [toplevel] [assigned] pjVideoMemoryAddress
drivers/staging/xgifb/XGI_main_26.c:2113:69: got void [noderef] <asn:2>*
drivers/staging/xgifb/XGI_main_26.c:2399:30: warning: incorrect type in assignment (different address spaces)
drivers/staging/xgifb/XGI_main_26.c:2399:30: expected char [noderef] <asn:2>*screen_base
drivers/staging/xgifb/XGI_main_26.c:2399:30: got char *[addressable] [toplevel] [assigned] video_vbase
drivers/staging/xgifb/XGI_main_26.c:2430:31: warning: incorrect type in argument 1 (different address spaces)
drivers/staging/xgifb/XGI_main_26.c:2430:31: expected void volatile [noderef] <asn:2>*addr
drivers/staging/xgifb/XGI_main_26.c:2430:31: got char *[addressable] [toplevel] [assigned] video_vbase
drivers/staging/xgifb/XGI_main_26.c:2454:31: warning: incorrect type in argument 1 (different address spaces)
drivers/staging/xgifb/XGI_main_26.c:2454:31: expected void volatile [noderef] <asn:2>*addr
drivers/staging/xgifb/XGI_main_26.c:2454:31: got char *[addressable] [toplev
Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/xgifb')
-rw-r--r-- | drivers/staging/xgifb/XGIfb.h | 2 | ||||
-rw-r--r-- | drivers/staging/xgifb/vb_init.c | 10 | ||||
-rw-r--r-- | drivers/staging/xgifb/vb_struct.h | 2 | ||||
-rw-r--r-- | drivers/staging/xgifb/vgatypes.h | 2 |
4 files changed, 8 insertions, 8 deletions
diff --git a/drivers/staging/xgifb/XGIfb.h b/drivers/staging/xgifb/XGIfb.h index 12e1a3e..f778293 100644 --- a/drivers/staging/xgifb/XGIfb.h +++ b/drivers/staging/xgifb/XGIfb.h @@ -56,7 +56,7 @@ struct video_info { int chip_id; unsigned int video_size; unsigned long video_base; - char *video_vbase; + void __iomem *video_vbase; unsigned long mmio_base; unsigned long mmio_size; void __iomem *mmio_vbase; diff --git a/drivers/staging/xgifb/vb_init.c b/drivers/staging/xgifb/vb_init.c index c7fd406..ce5bf68 100644 --- a/drivers/staging/xgifb/vb_init.c +++ b/drivers/staging/xgifb/vb_init.c @@ -678,12 +678,13 @@ static int XGINew_ReadWriteRest(unsigned short StopAddr, { int i; unsigned long Position = 0; + void __iomem *fbaddr = pVBInfo->FBAddr; - *((unsigned long *) (pVBInfo->FBAddr + Position)) = Position; + writel(Position, fbaddr + Position); for (i = StartAddr; i <= StopAddr; i++) { Position = 1 << i; - *((unsigned long *) (pVBInfo->FBAddr + Position)) = Position; + writel(Position, fbaddr + Position); } udelay(500); /* [Vicent] 2004/04/16. @@ -691,13 +692,12 @@ static int XGINew_ReadWriteRest(unsigned short StopAddr, Position = 0; - if ((*(unsigned long *) (pVBInfo->FBAddr + Position)) != Position) + if (readl(fbaddr + Position) != Position) return 0; for (i = StartAddr; i <= StopAddr; i++) { Position = 1 << i; - if ((*(unsigned long *) (pVBInfo->FBAddr + Position)) != - Position) + if (readl(fbaddr + Position) != Position) return 0; } return 1; diff --git a/drivers/staging/xgifb/vb_struct.h b/drivers/staging/xgifb/vb_struct.h index 6f13442..860c986 100644 --- a/drivers/staging/xgifb/vb_struct.h +++ b/drivers/staging/xgifb/vb_struct.h @@ -300,7 +300,7 @@ struct vb_device_info { unsigned short SelectCRT2Rate; unsigned char *ROMAddr; - unsigned char *FBAddr; + void __iomem *FBAddr; unsigned long BaseAddr; unsigned long RelIO; diff --git a/drivers/staging/xgifb/vgatypes.h b/drivers/staging/xgifb/vgatypes.h index 7f911f1..76e2d81 100644 --- a/drivers/staging/xgifb/vgatypes.h +++ b/drivers/staging/xgifb/vgatypes.h @@ -53,7 +53,7 @@ struct xgi_hw_device_info { unsigned char *pjVirtualRomBase; /* ROM image */ - unsigned char *pjVideoMemoryAddress;/* base virtual memory address */ + void __iomem *pjVideoMemoryAddress;/* base virtual memory address */ /* of Linear VGA memory */ unsigned long ulVideoMemorySize; /* size, in bytes, of the |