lkml.org 
[lkml]   [2012]   [Sep]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [v2 PATCH 2/2] netprio_cgroup: Use memcpy instead of the for-loop to copy priomap
On 09/12/2012 01:19 PM, David Miller wrote:
> From: "Srivatsa S. Bhat" <srivatsa.bhat@linux.vnet.ibm.com>
> Date: Wed, 12 Sep 2012 11:37:47 +0530
>
>> + memcpy(new_priomap->priomap, old_priomap->priomap,
>> + old_priomap->priomap_len *
>> + sizeof(old_priomap->priomap[0]));
>
> This argument indentation is ridiculous. Try:
>
> memcpy(new_priomap->priomap, old_priomap->priomap,
> old_priomap->priomap_len *
> sizeof(old_priomap->priomap[0]));
>
> Using TABs exclusively for argumentat indentation is not the goal.
>
> Rather, lining the arguments up properly so that they sit at the first
> column after the first line's openning parenthesis is what you should
> be trying to achieve.

OK, will fix it, thanks!

>
> And ignoring whatever stylistic convention we may or may not have, I
> find it impossibly hard to believe that the code quoted above looks
> good even to you.
>

On second thoughts, I think the memcpy in this case will actually be worse
since it will copy the contents in chunks of smaller size than the for-loop.

Or, did you mean to say that this code is plain wrong for some reason?

Regards,
Srivatsa S. Bhat



\
 
 \ /
  Last update: 2012-09-12 11:21    [W:0.078 / U:28.852 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site