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]
Date:   Wed, 1 Feb 2017 18:39:48 +0200
From:   Or Gerlitz <gerlitz.or@...il.com>
To:     David Laight <David.Laight@...lab.com>
Cc:     Saeed Mahameed <saeedm@...lanox.com>,
        "David S. Miller" <davem@...emloft.net>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        Or Gerlitz <ogerlitz@...lanox.com>,
        Matan Barak <matanb@...lanox.com>
Subject: Re: [net-next 1/8] net/mlx5: Fixed static checker warnings

On Wed, Feb 1, 2017 at 1:17 PM, David Laight <David.Laight@...lab.com> wrote:
> From: Saeed Mahameed
>> Sent: 31 January 2017 20:59
>> From: Or Gerlitz <ogerlitz@...lanox.com>
>>
>> For some reason, sparse doesn't like using an expression of type (!x)
>> with a bitwise | and &.  In order to mitigate that, we use a local
>> variable.
>>
>> Since getting a typeof(bitfield) is incorrect, we cast such cases.
> ...
>> +                     MLX5_SET(fte_match_set_lyr_2_4, headers_c, first_prio, (u8)mask->vlan_priority);
>
> Ugg nasty casts...
> ...
>>  #define MLX5_SET(typ, p, fld, v) do { \
>> +     typeof(v) _v = v; \
> ..
>
> Why not just 'unsigned int _v = v;

Yeah, basically we could have allocate (use) the max size and assign.
We preferred to allocate the specific instance size and use this, as using t
he required size is cleaner.

Or.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ