From: Andrew Morton <akpm@linux-foundation.org>
To: Davidlohr Bueso <davidlohr@hp.com>
Cc: Mathias Krause <minipli@googlemail.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
PaX Team <pageexec@freemail.hu>,
Nadia Derbey <Nadia.Derbey@bull.net>,
Manfred Spraul <manfred@colorfullife.com>
Subject: Re: [PATCH] ipc: constify ipc_ops
Date: Mon, 31 Mar 2014 14:59:29 -0700 [thread overview]
Message-ID: <20140331145929.7fc32c21c884739892c46831@linux-foundation.org> (raw)
In-Reply-To: <1396275156.2507.4.camel@buesod1.americas.hpqcorp.net>
On Mon, 31 Mar 2014 07:12:36 -0700 Davidlohr Bueso <davidlohr@hp.com> wrote:
> > >> --- a/ipc/msg.c
> > >> +++ b/ipc/msg.c
> > >> @@ -306,15 +306,14 @@ static inline int msg_security(struct kern_ipc_perm *ipcp, int msgflg)
> > >> SYSCALL_DEFINE2(msgget, key_t, key, int, msgflg)
> > >> {
> > >> struct ipc_namespace *ns;
> > >> - struct ipc_ops msg_ops;
> > >> + static const struct ipc_ops msg_ops = {
> > >> + .getnew = newque,
> > >> + .associate = msg_security,
> > >
> > > For completeness, please add .more_checks = NULL as well.
> >
> > The C standard already ensures that .more_checks is initialized with
> > NULL. So I don't see any benefit from doing it explicitly.
> > We're not initializing global/static variables holding NULL pointers
> > in the majority of the code base either, so this is just "best
> > practice".
>
> Hence the word _completeness_.
It's unusual to fill in the zeroed fields. We could put it in
explicitly as commentary to tell the reader "this exists - we thought
about it and decided to leave it zero". Which presumably is along the
lines of what you're thinking. Or not ;)
I'm easy either way. I'll shove the patch into my nice pile of
things-to-look-at-after-rc1.
prev parent reply other threads:[~2014-03-31 21:59 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-30 13:35 Mathias Krause
2014-03-30 21:47 ` Davidlohr Bueso
2014-03-31 8:28 ` Mathias Krause
2014-03-31 14:12 ` Davidlohr Bueso
2014-03-31 21:59 ` Andrew Morton [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=20140331145929.7fc32c21c884739892c46831@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=Nadia.Derbey@bull.net \
--cc=davidlohr@hp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=manfred@colorfullife.com \
--cc=minipli@googlemail.com \
--cc=pageexec@freemail.hu \
/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
all inboxes | Powered by JetHome®