[Intel-wired-lan] [PATCH S11 04/16] ice: sizeof(<type>) should be avoided

Bowers, AndrewX andrewx.bowers at intel.com
Thu Feb 14 22:51:40 UTC 2019


> -----Original Message-----
> From: Intel-wired-lan [mailto:intel-wired-lan-bounces at osuosl.org] On
> Behalf Of Anirudh Venkataramanan
> Sent: Friday, February 8, 2019 12:51 PM
> To: intel-wired-lan at lists.osuosl.org
> Subject: [Intel-wired-lan] [PATCH S11 04/16] ice: sizeof(<type>) should be
> avoided
> 
> From: Bruce Allan <bruce.w.allan at intel.com>
> 
> With sizeof(), it is preferable to use the variable of type <type> instead of
> sizeof(<type>).
> 
> There are multiple places where a temporary variable is used to hold a 'size'
> value which is then used for a subsequent alloc/memset. Get rid of the
> temporary variable by calculating size as part of the alloc/memset statement.
> 
> Also remove unnecessary type-cast.
> 
> Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
> Signed-off-by: Anirudh Venkataramanan
> <anirudh.venkataramanan at intel.com>
> ---
> [Anirudh Venkataramanan <anirudh.venkataramanan at intel.com> fixed
> checkpatch errors] [Anirudh Venkataramanan
> <anirudh.venkataramanan at intel.com> edited commit message]
> ---
>  drivers/net/ethernet/intel/ice/ice_ethtool.c | 15 +++++++--------
>  drivers/net/ethernet/intel/ice/ice_lib.c     | 10 +++++-----
>  drivers/net/ethernet/intel/ice/ice_main.c    | 23 +++++++++++------------
>  drivers/net/ethernet/intel/ice/ice_sched.c   |  9 ++++-----
>  drivers/net/ethernet/intel/ice/ice_switch.c  |  2 +-
>  drivers/net/ethernet/intel/ice/ice_txrx.c    | 24 ++++++++++--------------
>  6 files changed, 38 insertions(+), 45 deletions(-)

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




More information about the Intel-wired-lan mailing list