All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paul Moore <pmoore@redhat.com>
To: David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH] cipso: simplify cipso_v4_translate() when !CONFIG_NETLABEL
Date: Wed, 20 Nov 2013 14:59:33 -0500	[thread overview]
Message-ID: <2049996.Ospk96ghpo@sifl> (raw)
In-Reply-To: <20131120.145511.1303114952026497883.davem@davemloft.net>

On Wednesday, November 20, 2013 02:55:11 PM David Miller wrote:
> From: Paul Moore <pmoore@redhat.com>
> Date: Wed, 20 Nov 2013 14:45:19 -0500
> 
> > Looking at the original conditional:
> >  if ((tag_len == 0) || (opt[opt_iter + 1] > (opt_len - opt_iter))
> > 
> > ... and the replacement:
> >  if ((tag_len == 0) || (tag_len > (opt_len - opt_iter)))
> > 
> > ... we notice that "(opt[opt_iter + 1] > (opt_len - opt_iter))" has been
> > replaced with "(tag_len > (opt_len - opt_iter))", substituting 'tag_len'
> > for 'opt[opt_iter + 1]'.  This is acceptable because the the first
> > statement in> 
> > the for loop is:
> >  tag_len = opt[opt_iter + 1]
> > 
> > ... which matches the substitution in the conditional.  I'm not sure how
> > much more explicit I can be about this change, it is really pretty minor.
>
> Then, two things:
> 
> 1) This is a cleanup, and therefore not suitable for submission right now
>    because the net-next tree is closed.

I wasn't expecting it to go into the current merge window, I was just sending 
it out now so you'd have it for when things started moving again.  Think of it 
as spreading the pain out a bit.
 
> 2) A more suitable commit log message would have been "Don't needlessly
>    recompute 'opt[opt_iter + 1]' as we already have it stored in tag_len".
> 
>    Then anyone who reads this commit message can say "yes, obviously this
>    is a correct change and matches what the patch is doing"

Fair enough.  Do you want a resubmit with your wording once the merge window 
closes?

> Thanks.

-- 
paul moore
security and virtualization @ redhat

  reply	other threads:[~2013-11-20 19:59 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-20 19:25 [PATCH] cipso: simplify cipso_v4_translate() when !CONFIG_NETLABEL Paul Moore
2013-11-20 19:34 ` David Miller
2013-11-20 19:45   ` Paul Moore
2013-11-20 19:55     ` David Miller
2013-11-20 19:59       ` Paul Moore [this message]
2013-11-20 20:06         ` David Miller
2013-11-20 20:09           ` Paul Moore

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=2049996.Ospk96ghpo@sifl \
    --to=pmoore@redhat.com \
    --cc=davem@davemloft.net \
    --cc=netdev@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.