lkml.org 
[lkml]   [2008]   [Dec]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] EXPORTFS: handle NULL returns from fh_to_dentry()/fh_to_parent()
Date
J. Bruce Fields <bfields@fieldses.org> wrote:

> + if (!result)
> + result = ERR_PTR(-ESTALE);
> if (IS_ERR(result))
> return result;

This is why I think this is a bad idea. This adds an extra conditional test
and branch. In fact, the way you've done it means you have to do the extra
branch whatever[*]; it might be better to have the if-statement you added
return directly.

[*] assuming gcc doesn't manage to be clever enough to omit the second test if
the first is true.

David


\
 
 \ /
  Last update: 2008-12-09 11:33    [W:0.045 / U:0.180 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site