mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] sparse fixes
@ 2012-06-25 17:38 Sascha Hauer
  2012-06-25 17:38 ` [PATCH 01/12] MMC i.MX esdhc: Fix sparse warnings Sascha Hauer
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: Sascha Hauer @ 2012-06-25 17:38 UTC (permalink / raw)
  To: barebox

This series fixes a bunch of sparse warnings. Don't worry, there are
still some left in the tree ;)

Sascha

----------------------------------------------------------------
Sascha Hauer (12):
      MMC i.MX esdhc: Fix sparse warnings
      tlsf: Use NULL instead of 0 for returning NULL pointers
      qsort: declare strcmp_compar publically
      Do not use iomem space for dev_get_mem_region
      define __user empty
      ARM i.MX speed: sparse fixes
      USB ohci: Fix sparse warnings
      net smc911x: Use __iomem for register base
      ARM i.MX clocksource: put registers in iomem space
      USB gadget fsl: Put registers into iomem space
      fs FAT: fix warning: Using plain integer as NULL pointer
      of: Fix usage of 0 as NULL pointer

 arch/arm/mach-imx/clocksource.c        |   12 ++++++----
 arch/arm/mach-imx/include/mach/clock.h |    2 ++
 arch/arm/mach-imx/speed-imx35.c        |    2 +-
 arch/arm/mach-imx/speed-imx51.c        |    5 ++--
 arch/arm/mach-imx/speed-imx53.c        |    3 ++-
 common/oftree.c                        |    2 +-
 common/tlsf.c                          |   12 +++++-----
 drivers/base/driver.c                  |    6 ++---
 drivers/mci/imx-esdhc.c                |   20 ++++++++--------
 drivers/mtd/ubi/ubi-barebox.h          |    1 -
 drivers/net/smc911x.c                  |    2 +-
 drivers/usb/gadget/fsl_udc.c           |    2 +-
 drivers/usb/host/ohci-hcd.c            |   40 ++++++--------------------------
 drivers/usb/host/ohci.h                |    2 +-
 fs/fat/ff.c                            |   10 ++++----
 include/driver.h                       |    2 +-
 include/linux/compiler.h               |    2 +-
 include/qsort.h                        |    2 ++
 18 files changed, 54 insertions(+), 73 deletions(-)

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH 01/12] MMC i.MX esdhc: Fix sparse warnings
  2012-06-25 17:38 [PATCH] sparse fixes Sascha Hauer
@ 2012-06-25 17:38 ` Sascha Hauer
  2012-06-25 17:38 ` [PATCH 02/12] tlsf: Use NULL instead of 0 for returning NULL pointers Sascha Hauer
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Sascha Hauer @ 2012-06-25 17:38 UTC (permalink / raw)
  To: barebox

mostly by moving the registers into the correct address space.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/mci/imx-esdhc.c |   20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/mci/imx-esdhc.c b/drivers/mci/imx-esdhc.c
index ae3c805..585cab9 100644
--- a/drivers/mci/imx-esdhc.c
+++ b/drivers/mci/imx-esdhc.c
@@ -70,7 +70,7 @@ struct fsl_esdhc {
 
 struct fsl_esdhc_host {
 	struct mci_host		mci;
-	struct fsl_esdhc	*regs;
+	struct fsl_esdhc __iomem	*regs;
 	u32			no_snoop;
 	unsigned long		cur_clock;
 	struct device_d		*dev;
@@ -81,7 +81,7 @@ struct fsl_esdhc_host {
 #define  SDHCI_CMD_ABORTCMD (0xC0 << 16)
 
 /* Return the XFERTYP flags for a given command and data packet */
-u32 esdhc_xfertyp(struct mci_cmd *cmd, struct mci_data *data)
+static u32 esdhc_xfertyp(struct mci_cmd *cmd, struct mci_data *data)
 {
 	u32 xfertyp = 0;
 
@@ -185,7 +185,7 @@ esdhc_pio_read_write(struct mci_host *mci, struct mci_data *data)
 static int esdhc_setup_data(struct mci_host *mci, struct mci_data *data)
 {
 	struct fsl_esdhc_host *host = to_fsl_esdhc(mci);
-	struct fsl_esdhc *regs = host->regs;
+	struct fsl_esdhc __iomem *regs = host->regs;
 #ifndef CONFIG_MCI_IMX_ESDHC_PIO
 	u32 wml_value;
 
@@ -237,7 +237,7 @@ esdhc_send_cmd(struct mci_host *mci, struct mci_cmd *cmd, struct mci_data *data)
 	u32	xfertyp, mixctrl;
 	u32	irqstat;
 	struct fsl_esdhc_host *host = to_fsl_esdhc(mci);
-	struct fsl_esdhc *regs = host->regs;
+	struct fsl_esdhc __iomem *regs = host->regs;
 	int ret;
 
 	esdhc_write32(&regs->irqstat, -1);
@@ -353,11 +353,11 @@ esdhc_send_cmd(struct mci_host *mci, struct mci_cmd *cmd, struct mci_data *data)
 	return 0;
 }
 
-void set_sysctl(struct mci_host *mci, u32 clock)
+static void set_sysctl(struct mci_host *mci, u32 clock)
 {
 	int div, pre_div;
 	struct fsl_esdhc_host *host = to_fsl_esdhc(mci);
-	struct fsl_esdhc *regs = host->regs;
+	struct fsl_esdhc __iomem *regs = host->regs;
 	int sdhc_clk = imx_get_mmcclk();
 	u32 clk;
 
@@ -400,7 +400,7 @@ void set_sysctl(struct mci_host *mci, u32 clock)
 static void esdhc_set_ios(struct mci_host *mci, struct mci_ios *ios)
 {
 	struct fsl_esdhc_host *host = to_fsl_esdhc(mci);
-	struct fsl_esdhc *regs = host->regs;
+	struct fsl_esdhc __iomem *regs = host->regs;
 
 	/* Set the clock speed */
 	set_sysctl(mci, ios->clock);
@@ -425,7 +425,7 @@ static void esdhc_set_ios(struct mci_host *mci, struct mci_ios *ios)
 
 static int esdhc_card_detect(struct fsl_esdhc_host *host)
 {
-	struct fsl_esdhc *regs = host->regs;
+	struct fsl_esdhc __iomem *regs = host->regs;
 	struct esdhc_platform_data *pdata = host->dev->platform_data;
 	int ret;
 
@@ -451,7 +451,7 @@ static int esdhc_card_detect(struct fsl_esdhc_host *host)
 static int esdhc_init(struct mci_host *mci, struct device_d *dev)
 {
 	struct fsl_esdhc_host *host = to_fsl_esdhc(mci);
-	struct fsl_esdhc *regs = host->regs;
+	struct fsl_esdhc __iomem *regs = host->regs;
 	int timeout = 1000;
 	int ret = 0;
 
@@ -493,7 +493,7 @@ static int esdhc_init(struct mci_host *mci, struct device_d *dev)
 	return ret;
 }
 
-static int esdhc_reset(struct fsl_esdhc *regs)
+static int esdhc_reset(struct fsl_esdhc __iomem *regs)
 {
 	uint64_t start;
 
-- 
1.7.10


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH 02/12] tlsf: Use NULL instead of 0 for returning NULL pointers
  2012-06-25 17:38 [PATCH] sparse fixes Sascha Hauer
  2012-06-25 17:38 ` [PATCH 01/12] MMC i.MX esdhc: Fix sparse warnings Sascha Hauer
@ 2012-06-25 17:38 ` Sascha Hauer
  2012-06-25 17:38 ` [PATCH 03/12] qsort: declare strcmp_compar publically Sascha Hauer
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Sascha Hauer @ 2012-06-25 17:38 UTC (permalink / raw)
  To: barebox

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 common/tlsf.c |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/common/tlsf.c b/common/tlsf.c
index c810e8d..9515ac7 100644
--- a/common/tlsf.c
+++ b/common/tlsf.c
@@ -367,7 +367,7 @@ static block_header_t* search_suitable_block(pool_t* pool, int* fli, int* sli)
 		if (!fl_map)
 		{
 			/* No free blocks available, memory has been exhausted. */
-			return 0;
+			return NULL;
 		}
 
 		fl = tlsf_ffs(fl_map);
@@ -563,7 +563,7 @@ static block_header_t* block_trim_free_leading(pool_t* pool, block_header_t* blo
 static block_header_t* block_locate_free(pool_t* pool, size_t size)
 {
 	int fl = 0, sl = 0;
-	block_header_t* block = 0;
+	block_header_t* block = NULL;
 
 	if (size)
 	{
@@ -582,7 +582,7 @@ static block_header_t* block_locate_free(pool_t* pool, size_t size)
 
 static void* block_prepare_used(pool_t* pool, block_header_t* block, size_t size)
 {
-	void* p = 0;
+	void* p = NULL;
 	if (block)
 	{
 		block_trim_free(pool, block, size);
@@ -737,7 +737,7 @@ size_t tlsf_block_size(void* ptr)
 ** tlsf_create, equal to the size of a pool_t plus overhead of the initial
 ** free block and the sentinel block.
 */
-size_t tlsf_overhead()
+size_t tlsf_overhead(void)
 {
 	const size_t pool_overhead = sizeof(pool_t) + 2 * block_header_overhead;
 	return pool_overhead;
@@ -790,7 +790,7 @@ tlsf_pool tlsf_create(void* mem, size_t bytes)
 			(unsigned int)(pool_overhead + block_size_min),
 			(unsigned int)(pool_overhead + block_size_max));
 #endif
-		return 0;
+		return NULL;
 	}
 
 	/* Construct a valid pool object. */
@@ -915,7 +915,7 @@ void tlsf_free(tlsf_pool tlsf, void* ptr)
 void* tlsf_realloc(tlsf_pool tlsf, void* ptr, size_t size)
 {
 	pool_t* pool = tlsf_cast(pool_t*, tlsf);
-	void* p = 0;
+	void* p = NULL;
 
 	/* Zero-size requests are treated as free. */
 	if (ptr && size == 0)
-- 
1.7.10


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH 03/12] qsort: declare strcmp_compar publically
  2012-06-25 17:38 [PATCH] sparse fixes Sascha Hauer
  2012-06-25 17:38 ` [PATCH 01/12] MMC i.MX esdhc: Fix sparse warnings Sascha Hauer
  2012-06-25 17:38 ` [PATCH 02/12] tlsf: Use NULL instead of 0 for returning NULL pointers Sascha Hauer
@ 2012-06-25 17:38 ` Sascha Hauer
  2012-06-25 17:38 ` [PATCH 04/12] Do not use iomem space for dev_get_mem_region Sascha Hauer
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Sascha Hauer @ 2012-06-25 17:38 UTC (permalink / raw)
  To: barebox

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 include/qsort.h |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/qsort.h b/include/qsort.h
index bbb2359..d279dc2 100644
--- a/include/qsort.h
+++ b/include/qsort.h
@@ -4,4 +4,6 @@
 void qsort(void  *base, size_t nel, size_t width,
 	   int (*comp)(const void *, const void *));
 
+int strcmp_compar(const void *p1, const void *p2);
+
 #endif /* __QSORT_H */
-- 
1.7.10


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH 04/12] Do not use iomem space for dev_get_mem_region
  2012-06-25 17:38 [PATCH] sparse fixes Sascha Hauer
                   ` (2 preceding siblings ...)
  2012-06-25 17:38 ` [PATCH 03/12] qsort: declare strcmp_compar publically Sascha Hauer
@ 2012-06-25 17:38 ` Sascha Hauer
  2012-06-25 17:38 ` [PATCH 05/12] define __user empty Sascha Hauer
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Sascha Hauer @ 2012-06-25 17:38 UTC (permalink / raw)
  To: barebox

It is mostly used for mmapping sdram which is no iomem.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/base/driver.c |    6 +++---
 include/driver.h      |    2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/base/driver.c b/drivers/base/driver.c
index 547d684..cb876fa 100644
--- a/drivers/base/driver.c
+++ b/drivers/base/driver.c
@@ -241,15 +241,15 @@ static struct resource *dev_get_resource(struct device_d *dev, int num)
 	return NULL;
 }
 
-void __iomem *dev_get_mem_region(struct device_d *dev, int num)
+void *dev_get_mem_region(struct device_d *dev, int num)
 {
 	struct resource *res;
 
 	res = dev_get_resource(dev, num);
 	if (!res)
-		return res;
+		return NULL;
 
-	return (void __force __iomem *)res->start;
+	return (void __force *)res->start;
 }
 EXPORT_SYMBOL(dev_get_mem_region);
 
diff --git a/include/driver.h b/include/driver.h
index 09dd1e4..470ae2d 100644
--- a/include/driver.h
+++ b/include/driver.h
@@ -183,7 +183,7 @@ static inline const char *dev_name(const struct device_d *dev)
 /*
  * get register base 'num' for a device
  */
-void __iomem *dev_get_mem_region(struct device_d *dev, int num);
+void *dev_get_mem_region(struct device_d *dev, int num);
 
 /*
  * exlusively request register base 'num' for a device
-- 
1.7.10


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH 05/12] define __user empty
  2012-06-25 17:38 [PATCH] sparse fixes Sascha Hauer
                   ` (3 preceding siblings ...)
  2012-06-25 17:38 ` [PATCH 04/12] Do not use iomem space for dev_get_mem_region Sascha Hauer
@ 2012-06-25 17:38 ` Sascha Hauer
  2012-06-25 17:38 ` [PATCH 06/12] ARM i.MX speed: sparse fixes Sascha Hauer
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Sascha Hauer @ 2012-06-25 17:38 UTC (permalink / raw)
  To: barebox

There is no seperate user address space, so do not generate sparse
warnings for this.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/mtd/ubi/ubi-barebox.h |    1 -
 include/linux/compiler.h      |    2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/mtd/ubi/ubi-barebox.h b/drivers/mtd/ubi/ubi-barebox.h
index d23228f..72f29a6 100644
--- a/drivers/mtd/ubi/ubi-barebox.h
+++ b/drivers/mtd/ubi/ubi-barebox.h
@@ -135,7 +135,6 @@ struct kmem_cache { int i; };
 #define GFP_KERNEL			0
 #define GFP_NOFS			1
 
-#define __user
 #define __init
 #define __exit
 
diff --git a/include/linux/compiler.h b/include/linux/compiler.h
index 5be3dab..cc8c4de 100644
--- a/include/linux/compiler.h
+++ b/include/linux/compiler.h
@@ -4,7 +4,7 @@
 #ifndef __ASSEMBLY__
 
 #ifdef __CHECKER__
-# define __user		__attribute__((noderef, address_space(1)))
+# define __user		/* no user address space in barebox */
 # define __kernel	/* default address space */
 # define __safe		__attribute__((safe))
 # define __force	__attribute__((force))
-- 
1.7.10


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH 06/12] ARM i.MX speed: sparse fixes
  2012-06-25 17:38 [PATCH] sparse fixes Sascha Hauer
                   ` (4 preceding siblings ...)
  2012-06-25 17:38 ` [PATCH 05/12] define __user empty Sascha Hauer
@ 2012-06-25 17:38 ` Sascha Hauer
  2012-06-25 17:38 ` [PATCH 07/12] USB ohci: Fix sparse warnings Sascha Hauer
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Sascha Hauer @ 2012-06-25 17:38 UTC (permalink / raw)
  To: barebox

- Add missing #include <mach/clock.h>
- add global functions to mach/clock.h

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/mach-imx/include/mach/clock.h |    2 ++
 arch/arm/mach-imx/speed-imx35.c        |    2 +-
 arch/arm/mach-imx/speed-imx51.c        |    5 +++--
 arch/arm/mach-imx/speed-imx53.c        |    3 ++-
 4 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/arch/arm/mach-imx/include/mach/clock.h b/arch/arm/mach-imx/include/mach/clock.h
index 1082178..060d265 100644
--- a/arch/arm/mach-imx/include/mach/clock.h
+++ b/arch/arm/mach-imx/include/mach/clock.h
@@ -30,6 +30,8 @@ ulong imx_get_lcdclk(void);
 ulong imx_get_i2cclk(void);
 ulong imx_get_mmcclk(void);
 ulong imx_get_cspiclk(void);
+ulong imx_get_ipgclk(void);
+ulong imx_get_usbclk(void);
 
 int imx_clko_set_div(int div);
 void imx_clko_set_src(int src);
diff --git a/arch/arm/mach-imx/speed-imx35.c b/arch/arm/mach-imx/speed-imx35.c
index 1e1c39f..2bdcc07 100644
--- a/arch/arm/mach-imx/speed-imx35.c
+++ b/arch/arm/mach-imx/speed-imx35.c
@@ -84,7 +84,7 @@ unsigned long imx_get_ahbclk(void)
 	return fref / aad->ahb;
 }
 
-static unsigned long imx_get_ipgclk(void)
+unsigned long imx_get_ipgclk(void)
 {
 	ulong clk = imx_get_ahbclk();
 
diff --git a/arch/arm/mach-imx/speed-imx51.c b/arch/arm/mach-imx/speed-imx51.c
index 8d1ecf3..1c3523d 100644
--- a/arch/arm/mach-imx/speed-imx51.c
+++ b/arch/arm/mach-imx/speed-imx51.c
@@ -2,11 +2,12 @@
 #include <io.h>
 #include <asm-generic/div64.h>
 #include <mach/imx51-regs.h>
+#include <mach/clock.h>
 #include <mach/clock-imx51_53.h>
 
 static u32 ccm_readl(u32 ofs)
 {
-	return readl(MX51_CCM_BASE_ADDR + ofs);
+	return readl(IOMEM(MX51_CCM_BASE_ADDR) + ofs);
 }
 
 static unsigned long ckil_get_rate(void)
@@ -142,7 +143,7 @@ unsigned long imx_get_uartclk(void)
 	return parent_rate / (prediv * podf);
 }
 
-static unsigned long imx_get_ahbclk(void)
+unsigned long imx_get_ahbclk(void)
 {
 	u32 reg, div;
 
diff --git a/arch/arm/mach-imx/speed-imx53.c b/arch/arm/mach-imx/speed-imx53.c
index 634341e..653dae3 100644
--- a/arch/arm/mach-imx/speed-imx53.c
+++ b/arch/arm/mach-imx/speed-imx53.c
@@ -2,6 +2,7 @@
 #include <io.h>
 #include <asm-generic/div64.h>
 #include <mach/imx-regs.h>
+#include <mach/clock.h>
 #include "mach/clock-imx51_53.h"
 
 static u32 ccm_readl(u32 ofs)
@@ -139,7 +140,7 @@ unsigned long imx_get_uartclk(void)
 	return parent_rate / (prediv * podf);
 }
 
-static unsigned long imx_get_ahbclk(void)
+unsigned long imx_get_ahbclk(void)
 {
 	u32 reg, div;
 
-- 
1.7.10


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH 07/12] USB ohci: Fix sparse warnings
  2012-06-25 17:38 [PATCH] sparse fixes Sascha Hauer
                   ` (5 preceding siblings ...)
  2012-06-25 17:38 ` [PATCH 06/12] ARM i.MX speed: sparse fixes Sascha Hauer
@ 2012-06-25 17:38 ` Sascha Hauer
  2012-06-25 17:38 ` [PATCH 08/12] net smc911x: Use __iomem for register base Sascha Hauer
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Sascha Hauer @ 2012-06-25 17:38 UTC (permalink / raw)
  To: barebox

- put registers into iomem space
- do not use 0 as NULL pointer
- use dev_request_mem_region()

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/usb/host/ohci-hcd.c |   40 +++++++---------------------------------
 drivers/usb/host/ohci.h     |    2 +-
 2 files changed, 8 insertions(+), 34 deletions(-)

diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c
index 05e4094..f10d827 100644
--- a/drivers/usb/host/ohci-hcd.c
+++ b/drivers/usb/host/ohci-hcd.c
@@ -415,7 +415,7 @@ static void ohci_dump(struct ohci *controller, int verbose)
 
 /* get a transfer request */
 
-int sohci_submit_job(struct urb_priv *urb, struct devrequest *setup)
+static int sohci_submit_job(struct urb_priv *urb, struct devrequest *setup)
 {
 	struct ed *ed;
 	int i, size = 0;
@@ -498,7 +498,7 @@ int sohci_submit_job(struct urb_priv *urb, struct devrequest *setup)
 static inline int sohci_return_job(struct ohci *hc, struct urb_priv *urb)
 {
 #ifdef ENBALE_PIPE_INTERRUPT
-	struct ohci_regs *regs = hc->regs;
+	struct ohci_regs __iomem *regs = hc->regs;
 #endif
 
 	switch (usb_pipetype(urb->pipe)) {
@@ -848,7 +848,7 @@ static void td_fill(struct ohci *ohci, unsigned int info,
 	}
 #endif
 	if (!len)
-		data = 0;
+		data = NULL;
 
 	td->hwINFO = m32_swap(info);
 	td->hwCBP = virt_to_phys((void *)m32_swap((unsigned long)data));
@@ -894,7 +894,7 @@ static void td_submit_job(struct usb_device *dev, unsigned long pipe,
 	if (data_len)
 		data = buffer;
 	else
-		data = 0;
+		data = NULL;
 
 	switch (usb_pipetype(pipe)) {
 	case PIPE_BULK:
@@ -1214,32 +1214,6 @@ static inline void wr_rh_portstat(struct ohci *ohci, int wIndex, __u32 value)
 	writel(value, &ohci->regs->roothub.portstatus[wIndex-1]);
 }
 
-/* request to virtual root hub */
-
-int rh_check_port_status(struct ohci *controller)
-{
-	__u32 temp, ndp, i;
-	int res;
-
-	res = -1;
-	temp = roothub_a(controller);
-	ndp = (temp & RH_A_NDP);
-#ifdef CONFIG_AT91C_PQFP_UHPBUG
-	ndp = (ndp == 2) ? 1 : 0;
-#endif
-	for (i = 0; i < ndp; i++) {
-		temp = roothub_portstatus(controller, i);
-		/* check for a device disconnect */
-		if (((temp & (RH_PS_PESC | RH_PS_CSC)) ==
-			(RH_PS_PESC | RH_PS_CSC)) &&
-			((temp & RH_PS_CCS) == 0)) {
-			res = i;
-			break;
-		}
-	}
-	return res;
-}
-
 static int ohci_submit_rh_msg(struct usb_device *dev, unsigned long pipe,
 		void *buffer, int transfer_len, struct devrequest *cmd)
 {
@@ -1502,7 +1476,7 @@ static int ohci_submit_rh_msg(struct usb_device *dev, unsigned long pipe,
 
 /* common code for handling submit messages - used for all but root hub */
 /* accesses. */
-int submit_common_msg(struct usb_device *dev, unsigned long pipe, void *buffer,
+static int submit_common_msg(struct usb_device *dev, unsigned long pipe, void *buffer,
 		int transfer_len, struct devrequest *setup, int interval,
 		int timeout)
 {
@@ -1721,7 +1695,7 @@ static int hc_start(struct ohci *ohci)
 
 static int hc_interrupt(struct ohci *ohci)
 {
-	struct ohci_regs *regs = ohci->regs;
+	struct ohci_regs __iomem *regs = ohci->regs;
 	int ints;
 	int stat = 0;
 
@@ -1840,7 +1814,7 @@ static int ohci_probe(struct device_d *dev)
 
 	usb_register_host(host);
 
-	ohci->regs = (void *)dev->resource[0].start;
+	ohci->regs = dev_request_mem_region(dev, 0);
 
 	return 0;
 }
diff --git a/drivers/usb/host/ohci.h b/drivers/usb/host/ohci.h
index 9132963..9c9b837 100644
--- a/drivers/usb/host/ohci.h
+++ b/drivers/usb/host/ohci.h
@@ -408,7 +408,7 @@ struct ohci {
 	int disabled;			/* e.g. got a UE, we're hung */
 	unsigned long flags;		/* for HC bugs */
 
-	struct ohci_regs *regs; /* OHCI controller's memory */
+	struct ohci_regs __iomem *regs; /* OHCI controller's memory */
 
 	int ohci_int_load[32];	 /* load of the 32 Interrupt Chains (for load balancing)*/
 	struct ed *ed_rm_list[2];	 /* lists of all endpoints to be removed */
-- 
1.7.10


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH 08/12] net smc911x: Use __iomem for register base
  2012-06-25 17:38 [PATCH] sparse fixes Sascha Hauer
                   ` (6 preceding siblings ...)
  2012-06-25 17:38 ` [PATCH 07/12] USB ohci: Fix sparse warnings Sascha Hauer
@ 2012-06-25 17:38 ` Sascha Hauer
  2012-06-25 17:38 ` [PATCH 09/12] ARM i.MX clocksource: put registers in iomem space Sascha Hauer
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Sascha Hauer @ 2012-06-25 17:38 UTC (permalink / raw)
  To: barebox

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/net/smc911x.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/smc911x.c b/drivers/net/smc911x.c
index 800c188..7dddbbc 100644
--- a/drivers/net/smc911x.c
+++ b/drivers/net/smc911x.c
@@ -691,7 +691,7 @@ static int smc911x_probe(struct device_d *dev)
 	struct smc911x_priv *priv;
 	uint32_t val;
 	int i;
-	void *base;
+	void __iomem *base;
 
 	base = dev_request_mem_region(dev, 0);
 
-- 
1.7.10


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH 09/12] ARM i.MX clocksource: put registers in iomem space
  2012-06-25 17:38 [PATCH] sparse fixes Sascha Hauer
                   ` (7 preceding siblings ...)
  2012-06-25 17:38 ` [PATCH 08/12] net smc911x: Use __iomem for register base Sascha Hauer
@ 2012-06-25 17:38 ` Sascha Hauer
  2012-06-25 17:38 ` [PATCH 10/12] USB gadget fsl: Put registers into " Sascha Hauer
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Sascha Hauer @ 2012-06-25 17:38 UTC (permalink / raw)
  To: barebox

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/mach-imx/clocksource.c |   12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/arch/arm/mach-imx/clocksource.c b/arch/arm/mach-imx/clocksource.c
index 4f5895c..4e77ece 100644
--- a/arch/arm/mach-imx/clocksource.c
+++ b/arch/arm/mach-imx/clocksource.c
@@ -38,7 +38,7 @@
 #include <io.h>
 
 #define GPT(x) __REG(IMX_TIM1_BASE + (x))
-#define timer_base (IMX_TIM1_BASE)
+#define timer_base IOMEM(IMX_TIM1_BASE)
 
 static uint64_t imx_clocksource_read(void)
 {
@@ -120,15 +120,17 @@ core_initcall(clocksource_init);
  */
 void __noreturn reset_cpu (unsigned long addr)
 {
+	void __iomem *wdt = IOMEM(IMX_WDT_BASE);
+
 	/* Disable watchdog and set Time-Out field to 0 */
-	writew(0x0, IMX_WDT_BASE + WDOG_WCR);
+	writew(0x0, wdt + WDOG_WCR);
 
 	/* Write Service Sequence */
-	writew(0x5555, IMX_WDT_BASE + WDOG_WSR);
-	writew(0xaaaa, IMX_WDT_BASE + WDOG_WSR);
+	writew(0x5555, wdt + WDOG_WSR);
+	writew(0xaaaa, wdt + WDOG_WSR);
 
 	/* Enable watchdog */
-	writew(WDOG_WCR_WDE, IMX_WDT_BASE + WDOG_WCR);
+	writew(WDOG_WCR_WDE, wdt + WDOG_WCR);
 
 	while (1);
 	/*NOTREACHED*/
-- 
1.7.10


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH 10/12] USB gadget fsl: Put registers into iomem space
  2012-06-25 17:38 [PATCH] sparse fixes Sascha Hauer
                   ` (8 preceding siblings ...)
  2012-06-25 17:38 ` [PATCH 09/12] ARM i.MX clocksource: put registers in iomem space Sascha Hauer
@ 2012-06-25 17:38 ` Sascha Hauer
  2012-06-25 17:38 ` [PATCH 11/12] fs FAT: fix warning: Using plain integer as NULL pointer Sascha Hauer
  2012-06-25 17:38 ` [PATCH 12/12] of: Fix usage of 0 " Sascha Hauer
  11 siblings, 0 replies; 13+ messages in thread
From: Sascha Hauer @ 2012-06-25 17:38 UTC (permalink / raw)
  To: barebox

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/usb/gadget/fsl_udc.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/gadget/fsl_udc.c b/drivers/usb/gadget/fsl_udc.c
index 5b64ec2..9681812 100644
--- a/drivers/usb/gadget/fsl_udc.c
+++ b/drivers/usb/gadget/fsl_udc.c
@@ -519,7 +519,7 @@ static void dump_msg(const char *label, const u8 * buf, unsigned int length)
 					* 2 + ((windex & USB_DIR_IN) ? 1 : 0))
 #define get_pipe_by_ep(EP)	(ep_index(EP) * 2 + ep_is_in(EP))
 
-static struct usb_dr_device *dr_regs;
+static struct usb_dr_device __iomem *dr_regs;
 static struct fsl_udc *udc_controller = NULL;
 
 static const struct usb_endpoint_descriptor
-- 
1.7.10


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH 11/12] fs FAT: fix warning: Using plain integer as NULL pointer
  2012-06-25 17:38 [PATCH] sparse fixes Sascha Hauer
                   ` (9 preceding siblings ...)
  2012-06-25 17:38 ` [PATCH 10/12] USB gadget fsl: Put registers into " Sascha Hauer
@ 2012-06-25 17:38 ` Sascha Hauer
  2012-06-25 17:38 ` [PATCH 12/12] of: Fix usage of 0 " Sascha Hauer
  11 siblings, 0 replies; 13+ messages in thread
From: Sascha Hauer @ 2012-06-25 17:38 UTC (permalink / raw)
  To: barebox

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 fs/fat/ff.c |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/fs/fat/ff.c b/fs/fat/ff.c
index 2d476ee..66db1d6 100644
--- a/fs/fat/ff.c
+++ b/fs/fat/ff.c
@@ -1043,7 +1043,7 @@ int dir_register (	/* 0:Successful, FR_DENIED:No free entry or too many SFN coll
 
 	if (sn[NS] & NS_LOSS) {
 		/* When LFN is out of 8.3 format, generate a numbered name */
-		fn[NS] = 0; dj->lfn = 0; /* Find only SFN */
+		fn[NS] = 0; dj->lfn = NULL; /* Find only SFN */
 		for (n = 1; n < 100; n++) {
 			gen_numname(fn, sn, lfn, n); /* Generate a numbered name */
 			res = dir_find(dj); /* Check if the name collides with existing SFN */
@@ -1496,7 +1496,7 @@ int follow_path (	/* 0(0): successful, !=0: error code */
 	if ((UINT)*path < ' ') {
 		/* Nul path means the start directory itself */
 		res = dir_sdi(dj, 0);
-		dj->dir = 0;
+		dj->dir = NULL;
 		return res;
 	}
 
@@ -1718,7 +1718,7 @@ int f_open (
 	DEF_NAMEBUF;
 
 
-	fp->fs = 0;		/* Clear file object */
+	fp->fs = NULL;		/* Clear file object */
 
 #ifdef CONFIG_FS_FAT_WRITE
 	mode &= FA_READ | FA_WRITE | FA_CREATE_ALWAYS | FA_OPEN_ALWAYS | FA_CREATE_NEW;
@@ -2059,7 +2059,7 @@ int f_close (
 	/* Flush cached data */
 	res = f_sync(fp);
 	if (res == 0)
-		fp->fs = 0;	/* Discard file object */
+		fp->fs = NULL;	/* Discard file object */
 	return res;
 #endif
 }
@@ -2308,7 +2308,7 @@ int f_getfree (
 	} else {
 		clst = fatfs->n_fatent;
 		sect = fatfs->fatbase;
-		i = 0; p = 0;
+		i = 0; p = NULL;
 		do {
 			if (!i) {
 				res = move_window(fatfs, sect++);
-- 
1.7.10


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH 12/12] of: Fix usage of 0 as NULL pointer
  2012-06-25 17:38 [PATCH] sparse fixes Sascha Hauer
                   ` (10 preceding siblings ...)
  2012-06-25 17:38 ` [PATCH 11/12] fs FAT: fix warning: Using plain integer as NULL pointer Sascha Hauer
@ 2012-06-25 17:38 ` Sascha Hauer
  11 siblings, 0 replies; 13+ messages in thread
From: Sascha Hauer @ 2012-06-25 17:38 UTC (permalink / raw)
  To: barebox

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 common/oftree.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/oftree.c b/common/oftree.c
index 49758a9..677e934 100644
--- a/common/oftree.c
+++ b/common/oftree.c
@@ -207,7 +207,7 @@ int fdt_find_and_setprop(struct fdt_header *fdt, const char *node,
 	if (nodeoff < 0)
 		return nodeoff;
 
-	if ((!create) && (fdt_get_property(fdt, nodeoff, prop, 0) == NULL))
+	if ((!create) && (fdt_get_property(fdt, nodeoff, prop, NULL) == NULL))
 		return 0; /* create flag not set; so exit quietly */
 
 	return fdt_setprop(fdt, nodeoff, prop, val, len);
-- 
1.7.10


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2012-06-25 17:38 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-25 17:38 [PATCH] sparse fixes Sascha Hauer
2012-06-25 17:38 ` [PATCH 01/12] MMC i.MX esdhc: Fix sparse warnings Sascha Hauer
2012-06-25 17:38 ` [PATCH 02/12] tlsf: Use NULL instead of 0 for returning NULL pointers Sascha Hauer
2012-06-25 17:38 ` [PATCH 03/12] qsort: declare strcmp_compar publically Sascha Hauer
2012-06-25 17:38 ` [PATCH 04/12] Do not use iomem space for dev_get_mem_region Sascha Hauer
2012-06-25 17:38 ` [PATCH 05/12] define __user empty Sascha Hauer
2012-06-25 17:38 ` [PATCH 06/12] ARM i.MX speed: sparse fixes Sascha Hauer
2012-06-25 17:38 ` [PATCH 07/12] USB ohci: Fix sparse warnings Sascha Hauer
2012-06-25 17:38 ` [PATCH 08/12] net smc911x: Use __iomem for register base Sascha Hauer
2012-06-25 17:38 ` [PATCH 09/12] ARM i.MX clocksource: put registers in iomem space Sascha Hauer
2012-06-25 17:38 ` [PATCH 10/12] USB gadget fsl: Put registers into " Sascha Hauer
2012-06-25 17:38 ` [PATCH 11/12] fs FAT: fix warning: Using plain integer as NULL pointer Sascha Hauer
2012-06-25 17:38 ` [PATCH 12/12] of: Fix usage of 0 " Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox