There is a regular need in the kernel to provide a way to declare having a dynamically sized set of trailing elements in a structure. Kernel code should always use “flexible array members”[1] for these cases. The older style of one-element or zero-length arrays should no longer be used[2]. [1] https://en.wikipedia.org/wiki/Flexible_array_member [2] https://www.kernel.org/doc/html/v5.9/process/deprecated.html#zero-length-and-one-element-arrays
Unified · Split
| @@ -5823,7 +5823,7 @@ struct mlx5_ifc_alloc_modify_header_context_in_bits { · 5822 unmodified lines | ||
| 5823 | 5823 | u8 reserved_at_68[0x10]; |
| 5824 | 5824 | u8 num_of_actions[0x8]; |
| 5825 | 5825 | |
| 5826 | − union mlx5_ifc_set_add_copy_action_in_auto_bits actions[0]; | |
| 5826 | + union mlx5_ifc_set_add_copy_action_in_auto_bits actions[]; | |
| 5827 | 5827 | }; |
| 5828 | 5828 | |
| 5829 | 5829 | struct mlx5_ifc_dealloc_modify_header_context_out_bits { |
| @@ -9761,7 +9761,7 @@ struct mlx5_ifc_mcda_reg_bits { · 3931 unmodified lines | ||
| 9761 | 9761 | |
| 9762 | 9762 | u8 reserved_at_60[0x20]; |
| 9763 | 9763 | |
| 9764 | − u8 data[0][0x20]; | |
| 9764 | + u8 data[][0x20]; | |
| 9765 | 9765 | }; |
| 9766 | 9766 | |
| 9767 | 9767 | enum { |