linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Paul Mundt <lethal@linux-sh.org>
To: Liu Yuan <namei.unix@gmail.com>
Cc: linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] video, udlfb: Fix two build warning about 'ignoring return value'
Date: Mon, 18 Apr 2011 08:46:34 +0000	[thread overview]
Message-ID: <20110418084634.GC32457@linux-sh.org> (raw)
In-Reply-To: <1302769070-21670-1-git-send-email-namei.unix@gmail.com>

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..

  reply	other threads:[~2011-04-18  8:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-14  8:17 [PATCH] video, udlfb: Fix two build warning about 'ignoring return value' Liu Yuan
2011-04-18  8:46 ` Paul Mundt [this message]
2011-04-18 10:42   ` [PATCH] video, udlfb: Fix two build warning about 'ignoring Liu Yuan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110418084634.GC32457@linux-sh.org \
    --to=lethal@linux-sh.org \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=namei.unix@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).