[Intel-wired-lan] [PATCH 1/2] ice: avoid unnecessary single-member variable-length structs

Bowers, AndrewX andrewx.bowers at intel.com
Wed Jul 1 16:55:56 UTC 2020


> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces at osuosl.org> On Behalf Of
> Tony Nguyen
> Sent: Monday, June 29, 2020 5:28 PM
> To: intel-wired-lan at lists.osuosl.org
> Subject: [Intel-wired-lan] [PATCH 1/2] ice: avoid unnecessary single-member
> variable-length structs
> 
> From: Bruce Allan <bruce.w.allan at intel.com>
> 
> There are a number of structures that consist of a one-element array as the
> only struct member.  Some of those are unused so remove them. Others are
> used to index into a buffer/array consisting of a variable number of a
> different data or structure type.  Those are unnecessary since we can use
> simple pointer arithmetic or index directly into the buffer to access individual
> elements of the buffer/array.
> 
> Additional code cleanups were done near areas affected by this change.
> 
> Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
> Signed-off-by: Tony Nguyen <anthony.l.nguyen at intel.com>
> ---
>  .../net/ethernet/intel/ice/ice_adminq_cmd.h   | 39 +-----------
>  drivers/net/ethernet/intel/ice/ice_common.c   | 29 ++++-----
>  drivers/net/ethernet/intel/ice/ice_common.h   |  2 +-
>  drivers/net/ethernet/intel/ice/ice_dcb.c      |  4 +-
>  drivers/net/ethernet/intel/ice/ice_sched.c    | 61 ++++++++-----------
>  drivers/net/ethernet/intel/ice/ice_sched.h    |  2 +-
>  drivers/net/ethernet/intel/ice/ice_switch.c   | 14 ++---
>  7 files changed, 51 insertions(+), 100 deletions(-)


Tested-by: Andrew Bowers <andrewx.bowers at intel.com>




More information about the Intel-wired-lan mailing list