On Tue, Sep 12, 2023 at 07:59:30AM -0400, Przemek Kitszel wrote:
> Add DEFINE_FLEX() macro, that helps on-stack allocation of structures
> with trailing flex array member.
> Expose __struct_size() macro which reads size of data allocated
> by DEFINE_FLEX().
>
> Accompany new macros introduction wi
Use DEFINE_FLEX() macro for 1-elem flex array members of ice_switch.c
Signed-off-by: Przemek Kitszel
---
add/remove: 2/2 grow/shrink: 3/6 up/down: 489/-470 (19)
---
drivers/net/ethernet/intel/ice/ice_switch.c | 63 +
1 file changed, 14 insertions(+), 49 deletions(-)
diff --g
Use DEFINE_FLEX() macro for 1-elem flex array use case
of struct ice_aqc_dis_txq_item.
Signed-off-by: Przemek Kitszel
---
add/remove: 0/0 grow/shrink: 1/1 up/down: 9/-18 (-9)
---
drivers/net/ethernet/intel/ice/ice_common.c | 20
1 file changed, 4 insertions(+), 16 deletions(
Use DEFINE_FLEX() macro for 1-elem flex array use case
of struct ice_aqc_add_tx_qgrp.
Signed-off-by: Przemek Kitszel
---
add/remove: 0/2 grow/shrink: 2/2 up/down: 220/-255 (-35)
---
drivers/net/ethernet/intel/ice/ice_lib.c | 23 +--
drivers/net/ethernet/intel/ice/ice_xsk.c |
Use DEFINE_FLEX() macro for constant-num-of-elems (4)
flex array members of ice_ddp.c
Signed-off-by: Przemek Kitszel
---
add/remove: 4/0 grow/shrink: 0/1 up/down: 1195/-878 (317)
---
drivers/net/ethernet/intel/ice/ice_ddp.c | 39 +++-
1 file changed, 11 insertions(+), 28 dele
Remove two arguments of ice_aq_move_sched_elems().
Last of them was always NULL, and @grps_req was always 1.
Assuming @grps_req to be one, allows us to use DEFINE_FLEX() macro,
what removes some need for heap allocations.
Signed-off-by: Przemek Kitszel
---
add/remove: 0/0 grow/shrink: 1/6 up/dow
Replace array+size params of ice_sched_remove_elems:() by just single u32,
as all callers are using it with "1".
This enables moving from heap-based, to stack-based allocation, what is also
more elegant thanks to DEFINE_FLEX() macro.
Signed-off-by: Przemek Kitszel
---
add/remove: 2/2 grow/shrink
Add DEFINE_FLEX() macro for on-stack allocations of structs with
flexible array member.
Expose __struct_size() macro outside of fortify-string.h, as it could be
used to read size of structs allocated by DEFINE_FLEX().
Move __member_size() alongside it.
-Kees
Using underlying array for on-stack st
Add DEFINE_FLEX() macro, that helps on-stack allocation of structures
with trailing flex array member.
Expose __struct_size() macro which reads size of data allocated
by DEFINE_FLEX().
Accompany new macros introduction with actual usage,
in the ice driver - hence targeting for netdev tree.
Obviou