lkml.org 
[lkml]   [2006]   [Aug]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectQuestion about handling return value of device_create_file function
Hi,

I have noticed that sparse generates a lot of "ignoring return value
of 'device_create_file'" warnings.

(cat sparse.txt | grep -c "device_create_file"
1231 :)

I want to fix this warnings, but I'm wondering how to properly handle
return value of device_create_file function.

The shortest way.

int foo()
{
int error;

[..]

error = device_create_file(&bar, &bas)

if (error)
return error;
}

A bit longer way.

int foo()
{
int error;

[..]

error = device_create_file(&bar, &bas)

if (error) {
subsystem_remove_device(bar);
return error;
}
}

Any hints?

Regards,
Michal

--
Michal K. K. Piotrowski
LTG - Linux Testers Group
(http://www.stardust.webpages.pl/ltg/wiki/)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-08-18 15:21    [W:0.059 / U:0.300 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site