Re: [PATCH] EXPORTFS: handle NULL returns from fh_to_dentry()/fh_to_parent()

From: David Howells
Date: Tue Dec 09 2008 - 05:31:13 EST


J. Bruce Fields <bfields@xxxxxxxxxxxx> 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
--
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/