Files
OrangePi_CM5/include/linux
Tom Herbert b8a4ddb2e8 net/mlx5: Add MLX5_ARRAY_SET64 to fix BUILD_BUG_ON
I am hitting this in mlx5:

drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c: In function
reclaim_pages_cmd.clone.0:
drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c:346: error: call
to __compiletime_assert_346 declared with attribute error:
BUILD_BUG_ON failed: __mlx5_bit_off(manage_pages_out, pas[i]) % 64
drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c: In function give_pages:
drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c:291: error: call
to __compiletime_assert_291 declared with attribute error:
BUILD_BUG_ON failed: __mlx5_bit_off(manage_pages_in, pas[i]) % 64

Problem is that this is doing a BUILD_BUG_ON on a non-constant
expression because of trying to take offset of pas[i] in the
structure.

Fix is to create MLX5_ARRAY_SET64 that takes an additional argument
that is the field index to separate between BUILD_BUG_ON on the array
constant field and the indexed field to assign the value to.
There are two callers of MLX5_SET64 that are trying to get a variable
offset, change those to call MLX5_ARRAY_SET64 passing 'pas' and 'i'
as the arguments to use in the offset check and the indexed value
assignment.

Fixes: a533ed5e17 ("net/mlx5: Pages management commands via mlx5 ifc")
Signed-off-by: Tom Herbert <tom@herbertland.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-10-13 10:13:24 -04:00
..
…
…
…
…
…
…
2016-09-10 17:31:39 +05:30
2016-10-03 23:22:47 -04:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2016-09-14 09:18:06 -06:00
…
…
2016-09-29 01:35:35 -04:00
…
…
…
…
…
…
2016-08-11 09:41:35 -06:00
…
…
…
…
…
…
…
…
…
…
2016-09-27 21:20:53 -04:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2016-10-07 18:46:30 -07:00
…
…
…
…
…
…
…
2016-09-16 09:34:15 +01:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2016-09-16 12:44:20 +02:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2016-09-24 10:48:18 +02:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2016-09-16 09:34:15 +01:00
…
…
2016-09-14 09:18:09 -06:00
…
…
…
…
…
2016-09-20 23:20:32 +02:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2016-09-15 16:49:39 +02:00
…
…
…
…
…
…
…
2016-09-14 12:57:43 -07:00
…
…
…
…
…
…
…
…
…
…
…
2016-09-27 12:33:47 +02:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2016-08-28 23:32:41 -04:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2016-09-27 21:52:00 -04:00
…
…
…
…
…
…
2016-09-08 15:01:10 -07:00
2016-09-08 15:01:10 -07:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2016-09-20 04:43:36 -04:00
…
…
…
…
…
…
2016-09-08 22:15:25 -07:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2016-09-06 18:30:20 +02:00
…
2016-08-28 23:44:55 -04:00
…
…
…
…
…
…
…
…
2016-10-05 18:23:36 -04:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2016-10-07 18:46:27 -07:00
…
…
…
…
…
…
…
…
…
…
2016-09-21 00:23:00 -04:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2016-09-30 10:54:03 +02:00
…
…
2016-08-29 08:13:21 -06:00
…
…
…
…
…
…
…
…