On Sun, 1 Oct 2006, Jeff Garzik wrote:
Davide Libenzi wrote:On Sun, 1 Oct 2006, Jeff Garzik wrote:I'm not sure there are countless occurrences with PTR_ERR(). The line is
While reviewing the 'may be used uninitialized' bogus gcc warnings,But that saved one line of code, and there are countless occurences in the
I noticed that an error code assignment was only needed if an error had
actually occured.
kernel of such code pattern ;)
incorrect (but harmless) if inode is a valid pointer...
I just tried a `find /usr/src/linux-2.6.16/ -type f -exec grep -H -C 2 PTR_ERR {} \;`
and looked at the cases where the error variable is assigned in any case before the test. Same code pattern as, like:
error = -EFAULT;
if (copy_from_user(...))
goto kaboom;