All of lore.kernel.org
 help / color / mirror / Atom feed
From: me@tobin.cc (Tobin C. Harding)
To: kernelnewbies@lists.kernelnewbies.org
Subject: patch splitting
Date: Thu, 30 Mar 2017 11:59:05 +1100	[thread overview]
Message-ID: <20170330005905.GA8841@eros> (raw)
In-Reply-To: <62981.1490835302@turing-police.cc.vt.edu>

On Wed, Mar 29, 2017 at 08:55:02PM -0400, valdis.kletnieks at vt.edu wrote:
> On Thu, 30 Mar 2017 11:22:40 +1100, "Tobin C. Harding" said:
> > Is it easier to review this change for correctness if it is three
> > patches or one?
> >
> > TLDR;
> > +	struct wpa_key_t *key = &priv->wpa.key[index];
> >
> > -	memcpy(&priv->wpa.key[index].rx_seq[0], enc->rx_seq, IW_ENCODE_SEQ_MAX_SIZE);
> > +	memcpy(key->rx_seq, enc->rx_seq, IW_ENCODE_SEQ_MAX_SIZE);
> 
> One patch for one thing.
> 
> > Brief description of steps:
> > 1. Add local pointer variable, defined to correct memory location.
> > 2. Use newly defined local variable where suitable.
> > 3. Remove unnecessary address operator (reasoning specified below).
> 
> So, is this 3 things?  Or one thing:
> 
> "Simplify overly-complex first argument to memcpy()"?


Thanks Valdis, very well explained.

Tobin.

      reply	other threads:[~2017-03-30  0:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-30  0:22 patch splitting Tobin C. Harding
2017-03-30  0:55 ` valdis.kletnieks at vt.edu
2017-03-30  0:59   ` Tobin C. Harding [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=20170330005905.GA8841@eros \
    --to=me@tobin.cc \
    --cc=kernelnewbies@lists.kernelnewbies.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.