Re: [PATCH] video, udlfb: Fix two build warning about 'ignoringreturn value'

From: Liu Yuan
Date: Mon Apr 18 2011 - 06:42:25 EST


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@xxxxxxxxxxxx> 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@xxxxxxxxxx>
>> ---
>> Â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..
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/