From: james.l.morris@oracle.com (James Morris)
To: linux-security-module@vger.kernel.org
Subject: [PATCH] security: keys: remove redundant assignment to key_ref
Date: Thu, 7 Dec 2017 11:49:42 +1100 (AEDT) [thread overview]
Message-ID: <alpine.LFD.2.20.1712071148310.8348@localhost> (raw)
In-Reply-To: <alpine.DEB.2.20.1712061551310.25998@hadrien>
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 linux-security-module" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
prev parent reply other threads:[~2017-12-07 0:49 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-04 18:14 [PATCH] security: keys: remove redundant assignment to key_ref Colin King
2017-12-05 0:18 ` James Morris
2017-12-06 14:50 ` David Howells
2017-12-06 14:53 ` Julia Lawall
2017-12-07 0:49 ` James Morris [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=alpine.LFD.2.20.1712071148310.8348@localhost \
--to=james.l.morris@oracle.com \
--cc=linux-security-module@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).