[prev in list] [next in list] [prev in thread] [next in thread]
List: linux-keyrings
Subject: Re: [PATCH] security: keys: remove redundant assignment to key_ref
From: James Morris <james.l.morris () oracle ! com>
Date: 2017-12-07 0:49:42
Message-ID: alpine.LFD.2.20.1712071148310.8348 () localhost
[Download RAW message or body]
On Wed, 6 Dec 2017, Julia Lawall wrote:
> > There's a preference in Linux to use:
> >
> > key_ref = ERR_PTR(-error);
> > if (something)
> > goto error;
> >
> > instead because it uses less vertical space. It might originally have been
> > promulgated by Linus, but I don't remember. Though you do have a point - your
> > way makes error handling less subject breakage from code rearrangement.
>
> I have the impression that there are many examples of both approaches.
I thought this was mainly to set a default error condition once and then
some call during the function sets it to zero on success.
--
James Morris
<james.l.morris@oracle.com>
--
To unsubscribe from this list: send the line "unsubscribe keyrings" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic