All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] video, udlfb: Fix two build warning about 'ignoring return value'
@ 2011-04-14  8:17 ` Liu Yuan
  0 siblings, 0 replies; 6+ messages in thread
From: Liu Yuan @ 2011-04-14  8:17 UTC (permalink / raw)
  To: Paul Mundt; +Cc: open list:FRAMEBUFFER LAYER, open list

From: Liu Yuan <tailai.ly@taobao.com>

Build warning:
...
drivers/video/udlfb.c:1590: warning: ignoring return value of ‘device_create_file’, declared with attribute warn_unused_result
drivers/video/udlfb.c:1592: warning: ignoring return value of ‘device_create_bin_file’, declared with attribute warn_unused_result

So add two checks to get rid of 'em.

Signed-off-by: Liu Yuan <tailai.ly@taobao.com>
---
 drivers/video/udlfb.c |   15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/drivers/video/udlfb.c b/drivers/video/udlfb.c
index 68041d9..55d6de6 100644
--- a/drivers/video/udlfb.c
+++ b/drivers/video/udlfb.c
@@ -1586,10 +1586,19 @@ static int dlfb_usb_probe(struct usb_interface *interface,
 		goto error;
 	}
 
-	for (i = 0; i < ARRAY_SIZE(fb_device_attrs); i++)
-		device_create_file(info->dev, &fb_device_attrs[i]);
+	for (i = 0; i < ARRAY_SIZE(fb_device_attrs); i++) {
+		retval = device_create_file(info->dev, &fb_device_attrs[i]);
+		if (retval) {
+			pr_err("device_create_file failed %d\n", retval);
+			goto error;
+		}
+	}
 
-	device_create_bin_file(info->dev, &edid_attr);
+	retval = device_create_bin_file(info->dev, &edid_attr);
+	if (retval) {
+		pr_err("device_create_bin_file failed %d\n", retval);
+		goto error;
+	}
 
 	pr_info("DisplayLink USB device /dev/fb%d attached. %dx%d resolution."
 			" Using %dK framebuffer memory\n", info->node,
-- 
1.7.1


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

* [PATCH] video, udlfb: Fix two build warning about 'ignoring return value'
@ 2011-04-14  8:17 ` Liu Yuan
  0 siblings, 0 replies; 6+ messages in thread
From: Liu Yuan @ 2011-04-14  8:17 UTC (permalink / raw)
  To: Paul Mundt; +Cc: open list:FRAMEBUFFER LAYER, open list

From: Liu Yuan <tailai.ly@taobao.com>

Build warning:
...
drivers/video/udlfb.c:1590: warning: ignoring return value of ‘device_create_file’, declared with attribute warn_unused_result
drivers/video/udlfb.c:1592: warning: ignoring return value of ‘device_create_bin_file’, declared with attribute warn_unused_result

So add two checks to get rid of 'em.

Signed-off-by: Liu Yuan <tailai.ly@taobao.com>
---
 drivers/video/udlfb.c |   15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/drivers/video/udlfb.c b/drivers/video/udlfb.c
index 68041d9..55d6de6 100644
--- a/drivers/video/udlfb.c
+++ b/drivers/video/udlfb.c
@@ -1586,10 +1586,19 @@ static int dlfb_usb_probe(struct usb_interface *interface,
 		goto error;
 	}
 
-	for (i = 0; i < ARRAY_SIZE(fb_device_attrs); i++)
-		device_create_file(info->dev, &fb_device_attrs[i]);
+	for (i = 0; i < ARRAY_SIZE(fb_device_attrs); i++) {
+		retval = device_create_file(info->dev, &fb_device_attrs[i]);
+		if (retval) {
+			pr_err("device_create_file failed %d\n", retval);
+			goto error;
+		}
+	}
 
-	device_create_bin_file(info->dev, &edid_attr);
+	retval = device_create_bin_file(info->dev, &edid_attr);
+	if (retval) {
+		pr_err("device_create_bin_file failed %d\n", retval);
+		goto error;
+	}
 
 	pr_info("DisplayLink USB device /dev/fb%d attached. %dx%d resolution."
 			" Using %dK framebuffer memory\n", info->node,
-- 
1.7.1


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

* Re: [PATCH] video, udlfb: Fix two build warning about 'ignoring return value'
  2011-04-14  8:17 ` Liu Yuan
@ 2011-04-18  8:46   ` Paul Mundt
  -1 siblings, 0 replies; 6+ messages in thread
From: Paul Mundt @ 2011-04-18  8:46 UTC (permalink / raw)
  To: Liu Yuan; +Cc: linux-fbdev, linux-kernel

On Thu, Apr 14, 2011 at 04:17:50PM +0800, Liu Yuan wrote:
> Build warning:
> ...
> drivers/video/udlfb.c:1590: warning: ignoring return value of ???device_create_file???, declared with attribute warn_unused_result
> drivers/video/udlfb.c:1592: warning: ignoring return value of ???device_create_bin_file???, declared with attribute warn_unused_result
> 
> So add two checks to get rid of 'em.
> 
> Signed-off-by: Liu Yuan <tailai.ly@taobao.com>
> ---
>  drivers/video/udlfb.c |   15 ++++++++++++---
>  1 files changed, 12 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/video/udlfb.c b/drivers/video/udlfb.c
> index 68041d9..55d6de6 100644
> --- a/drivers/video/udlfb.c
> +++ b/drivers/video/udlfb.c
> @@ -1586,10 +1586,19 @@ static int dlfb_usb_probe(struct usb_interface *interface,
>  		goto error;
>  	}
>  
> -	for (i = 0; i < ARRAY_SIZE(fb_device_attrs); i++)
> -		device_create_file(info->dev, &fb_device_attrs[i]);
> +	for (i = 0; i < ARRAY_SIZE(fb_device_attrs); i++) {
> +		retval = device_create_file(info->dev, &fb_device_attrs[i]);
> +		if (retval) {
> +			pr_err("device_create_file failed %d\n", retval);
> +			goto error;
> +		}
> +	}
>  
> -	device_create_bin_file(info->dev, &edid_attr);
> +	retval = device_create_bin_file(info->dev, &edid_attr);
> +	if (retval) {
> +		pr_err("device_create_bin_file failed %d\n", retval);
> +		goto error;
> +	}
>  

While this will get rid of the warnings, it doesn't take care of cleaning
up the created files in the error case..

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

* Re: [PATCH] video, udlfb: Fix two build warning about 'ignoring return value'
@ 2011-04-18  8:46   ` Paul Mundt
  0 siblings, 0 replies; 6+ messages in thread
From: Paul Mundt @ 2011-04-18  8:46 UTC (permalink / raw)
  To: Liu Yuan; +Cc: linux-fbdev, linux-kernel

On Thu, Apr 14, 2011 at 04:17:50PM +0800, Liu Yuan wrote:
> Build warning:
> ...
> drivers/video/udlfb.c:1590: warning: ignoring return value of ???device_create_file???, declared with attribute warn_unused_result
> drivers/video/udlfb.c:1592: warning: ignoring return value of ???device_create_bin_file???, declared with attribute warn_unused_result
> 
> So add two checks to get rid of 'em.
> 
> Signed-off-by: Liu Yuan <tailai.ly@taobao.com>
> ---
>  drivers/video/udlfb.c |   15 ++++++++++++---
>  1 files changed, 12 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/video/udlfb.c b/drivers/video/udlfb.c
> index 68041d9..55d6de6 100644
> --- a/drivers/video/udlfb.c
> +++ b/drivers/video/udlfb.c
> @@ -1586,10 +1586,19 @@ static int dlfb_usb_probe(struct usb_interface *interface,
>  		goto error;
>  	}
>  
> -	for (i = 0; i < ARRAY_SIZE(fb_device_attrs); i++)
> -		device_create_file(info->dev, &fb_device_attrs[i]);
> +	for (i = 0; i < ARRAY_SIZE(fb_device_attrs); i++) {
> +		retval = device_create_file(info->dev, &fb_device_attrs[i]);
> +		if (retval) {
> +			pr_err("device_create_file failed %d\n", retval);
> +			goto error;
> +		}
> +	}
>  
> -	device_create_bin_file(info->dev, &edid_attr);
> +	retval = device_create_bin_file(info->dev, &edid_attr);
> +	if (retval) {
> +		pr_err("device_create_bin_file failed %d\n", retval);
> +		goto error;
> +	}
>  

While this will get rid of the warnings, it doesn't take care of cleaning
up the created files in the error case..

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

* Re: [PATCH] video, udlfb: Fix two build warning about 'ignoring return value'
  2011-04-18  8:46   ` Paul Mundt
@ 2011-04-18 10:42     ` Liu Yuan
  -1 siblings, 0 replies; 6+ messages in thread
From: Liu Yuan @ 2011-04-18 10:42 UTC (permalink / raw)
  To: Paul Mundt; +Cc: linux-fbdev, linux-kernel

Ah, thanks for pointing it out. I'll prepare v2 patch for it.

Thanks,
Yuan

On Mon, Apr 18, 2011 at 4:46 PM, Paul Mundt <lethal@linux-sh.org> wrote:
> On Thu, Apr 14, 2011 at 04:17:50PM +0800, Liu Yuan wrote:
>> Build warning:
>> ...
>> drivers/video/udlfb.c:1590: warning: ignoring return value of ???device_create_file???, declared with attribute warn_unused_result
>> drivers/video/udlfb.c:1592: warning: ignoring return value of ???device_create_bin_file???, declared with attribute warn_unused_result
>>
>> So add two checks to get rid of 'em.
>>
>> Signed-off-by: Liu Yuan <tailai.ly@taobao.com>
>> ---
>>  drivers/video/udlfb.c |   15 ++++++++++++---
>>  1 files changed, 12 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/video/udlfb.c b/drivers/video/udlfb.c
>> index 68041d9..55d6de6 100644
>> --- a/drivers/video/udlfb.c
>> +++ b/drivers/video/udlfb.c
>> @@ -1586,10 +1586,19 @@ static int dlfb_usb_probe(struct usb_interface *interface,
>>               goto error;
>>       }
>>
>> -     for (i = 0; i < ARRAY_SIZE(fb_device_attrs); i++)
>> -             device_create_file(info->dev, &fb_device_attrs[i]);
>> +     for (i = 0; i < ARRAY_SIZE(fb_device_attrs); i++) {
>> +             retval = device_create_file(info->dev, &fb_device_attrs[i]);
>> +             if (retval) {
>> +                     pr_err("device_create_file failed %d\n", retval);
>> +                     goto error;
>> +             }
>> +     }
>>
>> -     device_create_bin_file(info->dev, &edid_attr);
>> +     retval = device_create_bin_file(info->dev, &edid_attr);
>> +     if (retval) {
>> +             pr_err("device_create_bin_file failed %d\n", retval);
>> +             goto error;
>> +     }
>>
>
> While this will get rid of the warnings, it doesn't take care of cleaning
> up the created files in the error case..
>

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

* Re: [PATCH] video, udlfb: Fix two build warning about 'ignoring
@ 2011-04-18 10:42     ` Liu Yuan
  0 siblings, 0 replies; 6+ messages in thread
From: Liu Yuan @ 2011-04-18 10:42 UTC (permalink / raw)
  To: Paul Mundt; +Cc: linux-fbdev, linux-kernel

Ah, thanks for pointing it out. I'll prepare v2 patch for it.

Thanks,
Yuan

On Mon, Apr 18, 2011 at 4:46 PM, Paul Mundt <lethal@linux-sh.org> wrote:
> On Thu, Apr 14, 2011 at 04:17:50PM +0800, Liu Yuan wrote:
>> Build warning:
>> ...
>> drivers/video/udlfb.c:1590: warning: ignoring return value of ???device_create_file???, declared with attribute warn_unused_result
>> drivers/video/udlfb.c:1592: warning: ignoring return value of ???device_create_bin_file???, declared with attribute warn_unused_result
>>
>> So add two checks to get rid of 'em.
>>
>> Signed-off-by: Liu Yuan <tailai.ly@taobao.com>
>> ---
>>  drivers/video/udlfb.c |   15 ++++++++++++---
>>  1 files changed, 12 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/video/udlfb.c b/drivers/video/udlfb.c
>> index 68041d9..55d6de6 100644
>> --- a/drivers/video/udlfb.c
>> +++ b/drivers/video/udlfb.c
>> @@ -1586,10 +1586,19 @@ static int dlfb_usb_probe(struct usb_interface *interface,
>>               goto error;
>>       }
>>
>> -     for (i = 0; i < ARRAY_SIZE(fb_device_attrs); i++)
>> -             device_create_file(info->dev, &fb_device_attrs[i]);
>> +     for (i = 0; i < ARRAY_SIZE(fb_device_attrs); i++) {
>> +             retval = device_create_file(info->dev, &fb_device_attrs[i]);
>> +             if (retval) {
>> +                     pr_err("device_create_file failed %d\n", retval);
>> +                     goto error;
>> +             }
>> +     }
>>
>> -     device_create_bin_file(info->dev, &edid_attr);
>> +     retval = device_create_bin_file(info->dev, &edid_attr);
>> +     if (retval) {
>> +             pr_err("device_create_bin_file failed %d\n", retval);
>> +             goto error;
>> +     }
>>
>
> While this will get rid of the warnings, it doesn't take care of cleaning
> up the created files in the error case..
>

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

end of thread, other threads:[~2011-04-18 10:42 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-14  8:17 [PATCH] video, udlfb: Fix two build warning about 'ignoring return value' Liu Yuan
2011-04-14  8:17 ` Liu Yuan
2011-04-18  8:46 ` Paul Mundt
2011-04-18  8:46   ` Paul Mundt
2011-04-18 10:42   ` Liu Yuan
2011-04-18 10:42     ` [PATCH] video, udlfb: Fix two build warning about 'ignoring Liu Yuan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.