Re: patch splitting

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Mar 29, 2017 at 08:55:02PM -0400, valdis.kletnieks@xxxxxx 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.

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux