Commit e1da961
mlxsw: core_acl: Avoid defining static variable in header file
The static array 'mlxsw_afk_element_infos' in 'core_acl_flex_keys.h' is
copied to each file that includes the header, but not all use it. This
results in the following warnings when compiling with W=1:
drivers/net/ethernet/mellanox/mlxsw//core_acl_flex_keys.h:76:44:
warning: ‘mlxsw_afk_element_infos’ defined but not used
[-Wunused-const-variable=]
One way to suppress the warning is to mark the array with
'__maybe_unused', but another option is to remove it from the header
file entirely.
Change 'struct mlxsw_afk_element_inst' to store the key to the array
('element') instead of the array value keyed by 'element'. Adjust the
different users accordingly.
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Reviewed-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>1 parent bdb373c commit e1da961
File tree
2 files changed
+47
-39
lines changed- drivers/net/ethernet/mellanox/mlxsw
2 files changed
+47
-39
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
12 | 47 | | |
13 | 48 | | |
14 | 49 | | |
| |||
26 | 61 | | |
27 | 62 | | |
28 | 63 | | |
| 64 | + | |
29 | 65 | | |
30 | 66 | | |
31 | 67 | | |
32 | | - | |
| 68 | + | |
| 69 | + | |
33 | 70 | | |
34 | 71 | | |
35 | | - | |
| 72 | + | |
36 | 73 | | |
37 | 74 | | |
38 | 75 | | |
| |||
116 | 153 | | |
117 | 154 | | |
118 | 155 | | |
119 | | - | |
| 156 | + | |
120 | 157 | | |
121 | 158 | | |
122 | 159 | | |
| |||
301 | 338 | | |
302 | 339 | | |
303 | 340 | | |
304 | | - | |
| 341 | + | |
305 | 342 | | |
306 | 343 | | |
307 | 344 | | |
| |||
409 | 446 | | |
410 | 447 | | |
411 | 448 | | |
412 | | - | |
413 | 449 | | |
| 450 | + | |
| 451 | + | |
414 | 452 | | |
| 453 | + | |
| 454 | + | |
415 | 455 | | |
416 | 456 | | |
417 | 457 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | 72 | | |
105 | 73 | | |
106 | 74 | | |
107 | | - | |
| 75 | + | |
108 | 76 | | |
109 | 77 | | |
110 | 78 | | |
| |||
116 | 84 | | |
117 | 85 | | |
118 | 86 | | |
119 | | - | |
| 87 | + | |
120 | 88 | | |
121 | 89 | | |
122 | 90 | | |
| |||
0 commit comments