On Mon, 31 Mar 2014 07:12:36 -0700 Davidlohr Bueso <davidl...@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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to