lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAKh23Fn2-P3QAntShpjBV027POgYfxmCFh3H3KZ5dSpUpa+4yQ@mail.gmail.com>
Date:	Mon, 14 Apr 2014 15:09:26 -0700
From:	Iyappan Subramanian <isubramanian@....com>
To:	David Miller <davem@...emloft.net>
Cc:	netdev@...r.kernel.org, devicetree@...r.kernel.org,
	gregkh@...uxfoundation.org, linux-kernel@...r.kernel.org,
	linux-arm-kernel@...ts.infradead.org,
	"jcm@...hat.com" <jcm@...hat.com>, patches <patches@....com>,
	Ravi Patel <rapatel@....com>, Keyur Chudgar <kchudgar@....com>
Subject: Re: [PATCH v2 4/4] drivers: net: Add APM X-Gene SoC ethernet driver support.

Hi David,

Thanks for the review comments.  Please find my responses inline.

Thanks,
Iyappan

On Sat, Apr 12, 2014 at 1:55 PM, David Miller <davem@...emloft.net> wrote:
> From: Iyappan Subramanian <isubramanian@....com>
> Date: Fri, 11 Apr 2014 20:06:24 -0700
>
>> This patch adds network driver for APM X-Gene SoC ethernet.
>>
>> Signed-off-by: Iyappan Subramanian <isubramanian@....com>
>> Signed-off-by: Ravi Patel <rapatel@....com>
>> Signed-off-by: Keyur Chudgar <kchudgar@....com>
>
> This driver is going to take a long to review and get to the point
> where it can be integrated upstream, I'm just trying to set your
> expectations properly.
Okay.
>
>> +inline void set_desc(struct xgene_enet_desc *desc, enum desc_info_index index,
>> +                  u64 val)
>> +{
>
> The "inline" tag is not necessary, let the compiler figure it out.
Okay.  I will remove inline keyword from the code.
>
>> +     u8 word_index = desc_info[index].word_index;
>> +     u8 start_bit = desc_info[index].start_bit;
>> +     u8 len = desc_info[index].len;
>> +
>> +     u64 mask = GENMASK_ULL((start_bit + len - 1), start_bit);
>> +     ((u64 *)desc)[word_index] = (((u64 *)desc)[word_index] & ~mask)
>> +         | (((u64) val << start_bit) & mask);
>
> This looks horrible for several reasons.
>
> First of all, do not put empty lines in the middle of a set of
> local variable declarations.
>
> But do put a single empty line after the last local variable, and
> before the actual code of the function starts.
>
> Get rid of all of this excessive casting.  Tell the compiler what you're
> actually doing, pass 'desc' in as "void *" and use local "u64 *" pointers
> (to which 'desc' is assigned to) if you must.
I will fix this in the next patch.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ