linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* linux-next: build warning after merge of the mfd tree
@ 2010-03-03  5:22 Stephen Rothwell
  2010-03-03  9:33 ` sch_gpio: fix compilation warning "ignoring return value of gpiochip_remove" Denis Turischev
  0 siblings, 1 reply; 3+ messages in thread
From: Stephen Rothwell @ 2010-03-03  5:22 UTC (permalink / raw)
  To: Samuel Ortiz; +Cc: linux-next, linux-kernel, Denis Turischev

[-- Attachment #1: Type: text/plain, Size: 829 bytes --]

Hi Sam,

After merging the mfd tree, today's linux-next build (x86_64 allmodconfig)
produced these warnings:

drivers/gpio/sch_gpio.c: In function 'sch_gpio_probe':
drivers/gpio/sch_gpio.c:232: warning: ignoring return value of 'gpiochip_remove', declared with attribute warn_unused_result
drivers/gpio/sch_gpio.c: In function 'sch_gpio_remove':
drivers/gpio/sch_gpio.c:245: warning: ignoring return value of 'gpiochip_remove', declared with attribute warn_unused_result
drivers/gpio/sch_gpio.c:246: warning: ignoring return value of 'gpiochip_remove', declared with attribute warn_unused_result

Introduced by commit 4faabcde03a89836169f1437127226f4b0714070 ("gpio: add
Intel SCH GPIO controller driver").

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]

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

* sch_gpio: fix compilation warning "ignoring return value of gpiochip_remove"
  2010-03-03  5:22 linux-next: build warning after merge of the mfd tree Stephen Rothwell
@ 2010-03-03  9:33 ` Denis Turischev
  2010-03-05 18:11   ` Samuel Ortiz
  0 siblings, 1 reply; 3+ messages in thread
From: Denis Turischev @ 2010-03-03  9:33 UTC (permalink / raw)
  To: linux-kernel; +Cc: Stephen Rothwell, Samuel Ortiz, linux-next, Mike Rapoport

Signed-off-by: Denis Turischev <denis@compulab.co.il>
---
 drivers/gpio/sch_gpio.c |   25 +++++++++++++++++++++----
 1 files changed, 21 insertions(+), 4 deletions(-)

diff --git a/drivers/gpio/sch_gpio.c b/drivers/gpio/sch_gpio.c
index 761071a..a89c02d 100644
--- a/drivers/gpio/sch_gpio.c
+++ b/drivers/gpio/sch_gpio.c
@@ -229,7 +229,12 @@ static int __devinit sch_gpio_probe(struct platform_device *pdev)
 	return 0;

 err_sch_gpio_resume:
-	gpiochip_remove(&sch_gpio_core);
+	err = gpiochip_remove(&sch_gpio_core);
+	if (err) {
+		dev_err(&pdev->dev, "%s failed, %d\n",
+				"gpiochip_remove()", err);
+		return err;
+	}

 err_sch_gpio_core:
 	release_region(res->start, resource_size(res));
@@ -240,11 +245,23 @@ err_sch_gpio_core:

 static int __devexit sch_gpio_remove(struct platform_device *pdev)
 {
+	int err_c, err_r;
 	struct resource *res;
 	if (gpio_ba) {
-		gpiochip_remove(&sch_gpio_core);
-		gpiochip_remove(&sch_gpio_resume);
-
+		err_c = gpiochip_remove(&sch_gpio_core);
+		
+		err_r = gpiochip_remove(&sch_gpio_resume);
+
+		if (err_c) {
+			dev_err(&pdev->dev, "%s failed, %d\n",
+					"gpiochip_remove()", err_c);
+			return err_c;
+		}
+		if (err_r) {
+			dev_err(&pdev->dev, "%s failed, %d\n",
+					"gpiochip_remove()", err_r);
+			return err_r;
+		}
 		res = platform_get_resource(pdev, IORESOURCE_IO, 0);

 		release_region(res->start, resource_size(res));
-- 
1.6.3.3

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

* Re: sch_gpio: fix compilation warning "ignoring return value of gpiochip_remove"
  2010-03-03  9:33 ` sch_gpio: fix compilation warning "ignoring return value of gpiochip_remove" Denis Turischev
@ 2010-03-05 18:11   ` Samuel Ortiz
  0 siblings, 0 replies; 3+ messages in thread
From: Samuel Ortiz @ 2010-03-05 18:11 UTC (permalink / raw)
  To: Denis Turischev; +Cc: linux-kernel, Stephen Rothwell, linux-next, Mike Rapoport

Hi Denis,

On Wed, Mar 03, 2010 at 11:33:29AM +0200, Denis Turischev wrote:
> Signed-off-by: Denis Turischev <denis@compulab.co.il>
I modified this patch as you were leaking some resources releasing.

Cheers,
Samuel.

> ---
>  drivers/gpio/sch_gpio.c |   25 +++++++++++++++++++++----
>  1 files changed, 21 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpio/sch_gpio.c b/drivers/gpio/sch_gpio.c
> index 761071a..a89c02d 100644
> --- a/drivers/gpio/sch_gpio.c
> +++ b/drivers/gpio/sch_gpio.c
> @@ -229,7 +229,12 @@ static int __devinit sch_gpio_probe(struct platform_device *pdev)
>  	return 0;
> 
>  err_sch_gpio_resume:
> -	gpiochip_remove(&sch_gpio_core);
> +	err = gpiochip_remove(&sch_gpio_core);
> +	if (err) {
> +		dev_err(&pdev->dev, "%s failed, %d\n",
> +				"gpiochip_remove()", err);
> +		return err;
> +	}
> 
>  err_sch_gpio_core:
>  	release_region(res->start, resource_size(res));
> @@ -240,11 +245,23 @@ err_sch_gpio_core:
> 
>  static int __devexit sch_gpio_remove(struct platform_device *pdev)
>  {
> +	int err_c, err_r;
>  	struct resource *res;
>  	if (gpio_ba) {
> -		gpiochip_remove(&sch_gpio_core);
> -		gpiochip_remove(&sch_gpio_resume);
> -
> +		err_c = gpiochip_remove(&sch_gpio_core);
> +		
> +		err_r = gpiochip_remove(&sch_gpio_resume);
> +
> +		if (err_c) {
> +			dev_err(&pdev->dev, "%s failed, %d\n",
> +					"gpiochip_remove()", err_c);
> +			return err_c;
> +		}
> +		if (err_r) {
> +			dev_err(&pdev->dev, "%s failed, %d\n",
> +					"gpiochip_remove()", err_r);
> +			return err_r;
> +		}
>  		res = platform_get_resource(pdev, IORESOURCE_IO, 0);
> 
>  		release_region(res->start, resource_size(res));
> -- 
> 1.6.3.3
> 

-- 
Intel Open Source Technology Centre
http://oss.intel.com/

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

end of thread, other threads:[~2010-03-05 18:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-03  5:22 linux-next: build warning after merge of the mfd tree Stephen Rothwell
2010-03-03  9:33 ` sch_gpio: fix compilation warning "ignoring return value of gpiochip_remove" Denis Turischev
2010-03-05 18:11   ` Samuel Ortiz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).