From: valdis.kletnieks@vt.edu (valdis.kletnieks at vt.edu) Date: Wed, 29 Mar 2017 20:55:02 -0400 Subject: patch splitting In-Reply-To: <20170330002240.GH25014@eros> References: <20170330002240.GH25014@eros> Message-ID: <62981.1490835302@turing-police.cc.vt.edu> To: kernelnewbies@lists.kernelnewbies.org List-Id: kernelnewbies.lists.kernelnewbies.org 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()"? -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 484 bytes Desc: not available Url : http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20170329/9422ca32/attachment.bin