Thread (21 messages) 21 messages, 6 authors, 2017-02-06

Re: [net-next 1/8] net/mlx5: Fixed static checker warnings

From: Or Gerlitz <hidden>
Date: 2017-02-01 16:39:49

On Wed, Feb 1, 2017 at 1:17 PM, David Laight [off-list ref] wrote:
From: Saeed Mahameed
quoted
Sent: 31 January 2017 20:59
From: Or Gerlitz <redacted>

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.
...
quoted
+                     MLX5_SET(fte_match_set_lyr_2_4, headers_c, first_prio, (u8)mask->vlan_priority);
Ugg nasty casts...
...
quoted
 #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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help