mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/2] gpio-ml-ioh: cleanup __iomem annotation usage
@ 2012-01-15  9:57 Németh Márton
  2012-01-16 16:12 ` Grant Likely
  0 siblings, 1 reply; 2+ messages in thread
From: Németh Márton @ 2012-01-15  9:57 UTC (permalink / raw)
  To: Grant Likely, Linus Walleij; +Cc: LKML

From: Márton Németh <nm127@freemail.hu>

The __iomem annotation is to be used together with pointers used
in iowrite32() but not for pointers returned by kzalloc().
For more details see [1] and [2].

This patch will remove the following sparse warning (i.e. when
copiling with "make C=1"):
 * warning: incorrect type in assignment (different address spaces)

References:
[1] A new I/O memory access mechanism (Sep 15, 2004)
    http://lwn.net/Articles/102232/

[2] Being more anal about iospace accesses (Sep 15, 2004)
    http://lwn.net/Articles/102240/

Signed-off-by: Márton Németh <nm127@freemail.hu>
---
 drivers/gpio/gpio-ml-ioh.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpio/gpio-ml-ioh.c b/drivers/gpio/gpio-ml-ioh.c
index 461958f..25da40a 100644
--- a/drivers/gpio/gpio-ml-ioh.c
+++ b/drivers/gpio/gpio-ml-ioh.c
@@ -248,7 +248,7 @@ static void ioh_gpio_setup(struct ioh_gpio *chip, int num_port)
 static int ioh_irq_type(struct irq_data *d, unsigned int type)
 {
 	u32 im;
-	u32 *im_reg;
+	void __iomem *im_reg;
 	u32 ien;
 	u32 im_pos;
 	int ch;
@@ -412,7 +412,7 @@ static int __devinit ioh_gpio_probe(struct pci_dev *pdev,
 	int i, j;
 	struct ioh_gpio *chip;
 	void __iomem *base;
-	void __iomem *chip_save;
+	void *chip_save;
 	int irq_base;

 	ret = pci_enable_device(pdev);
@@ -521,7 +521,7 @@ static void __devexit ioh_gpio_remove(struct pci_dev *pdev)
 	int err;
 	int i;
 	struct ioh_gpio *chip = pci_get_drvdata(pdev);
-	void __iomem *chip_save;
+	void *chip_save;

 	chip_save = chip;

-- 
1.7.2.5


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

* Re: [PATCH 1/2] gpio-ml-ioh: cleanup __iomem annotation usage
  2012-01-15  9:57 [PATCH 1/2] gpio-ml-ioh: cleanup __iomem annotation usage Németh Márton
@ 2012-01-16 16:12 ` Grant Likely
  0 siblings, 0 replies; 2+ messages in thread
From: Grant Likely @ 2012-01-16 16:12 UTC (permalink / raw)
  To: Németh Márton; +Cc: Linus Walleij, LKML

On Sun, Jan 15, 2012 at 10:57:34AM +0100, Németh Márton wrote:
> From: Márton Németh <nm127@freemail.hu>
> 
> The __iomem annotation is to be used together with pointers used
> in iowrite32() but not for pointers returned by kzalloc().
> For more details see [1] and [2].
> 
> This patch will remove the following sparse warning (i.e. when
> copiling with "make C=1"):
>  * warning: incorrect type in assignment (different address spaces)
> 
> References:
> [1] A new I/O memory access mechanism (Sep 15, 2004)
>     http://lwn.net/Articles/102232/
> 
> [2] Being more anal about iospace accesses (Sep 15, 2004)
>     http://lwn.net/Articles/102240/
> 
> Signed-off-by: Márton Németh <nm127@freemail.hu>

Applied all 4.  Thanks

g.

> ---
>  drivers/gpio/gpio-ml-ioh.c |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpio/gpio-ml-ioh.c b/drivers/gpio/gpio-ml-ioh.c
> index 461958f..25da40a 100644
> --- a/drivers/gpio/gpio-ml-ioh.c
> +++ b/drivers/gpio/gpio-ml-ioh.c
> @@ -248,7 +248,7 @@ static void ioh_gpio_setup(struct ioh_gpio *chip, int num_port)
>  static int ioh_irq_type(struct irq_data *d, unsigned int type)
>  {
>  	u32 im;
> -	u32 *im_reg;
> +	void __iomem *im_reg;
>  	u32 ien;
>  	u32 im_pos;
>  	int ch;
> @@ -412,7 +412,7 @@ static int __devinit ioh_gpio_probe(struct pci_dev *pdev,
>  	int i, j;
>  	struct ioh_gpio *chip;
>  	void __iomem *base;
> -	void __iomem *chip_save;
> +	void *chip_save;
>  	int irq_base;
> 
>  	ret = pci_enable_device(pdev);
> @@ -521,7 +521,7 @@ static void __devexit ioh_gpio_remove(struct pci_dev *pdev)
>  	int err;
>  	int i;
>  	struct ioh_gpio *chip = pci_get_drvdata(pdev);
> -	void __iomem *chip_save;
> +	void *chip_save;
> 
>  	chip_save = chip;
> 
> -- 
> 1.7.2.5
> 

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

end of thread, other threads:[~2012-01-16 16:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-15  9:57 [PATCH 1/2] gpio-ml-ioh: cleanup __iomem annotation usage Németh Márton
2012-01-16 16:12 ` Grant Likely

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

all inboxes | Powered by JetHome®