Message ID | 1418124170-7495-14-git-send-email-jeffrey.t.kirsher@intel.com |
---|---|
State | Changes Requested, archived |
Delegated to: | David Miller |
Headers | show |
Hello. On 12/09/2014 02:22 PM, Jeff Kirsher wrote: > Inline functions are preferred over macros when they can be used > interchangeably. > Reported-by: Joe Perches <joe@perches.com> > Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> > --- > drivers/net/ethernet/intel/i40e/i40e_type.h | 5 ++++- > drivers/net/ethernet/intel/i40evf/i40e_type.h | 5 ++++- > 2 files changed, 8 insertions(+), 2 deletions(-) > diff --git a/drivers/net/ethernet/intel/i40e/i40e_type.h b/drivers/net/ethernet/intel/i40e/i40e_type.h > index 844421f..618cce2 100644 > --- a/drivers/net/ethernet/intel/i40e/i40e_type.h > +++ b/drivers/net/ethernet/intel/i40e/i40e_type.h > @@ -481,7 +481,10 @@ struct i40e_hw { > u32 debug_mask; > }; > > -#define i40e_is_vf(_hw) ((_hw)->mac.type == I40E_MAC_VF) > +static inline bool i40e_is_vf(struct i40e_hw *hw) > +{ > + return (hw->mac.type == I40E_MAC_VF); Parens not needed. [...] > diff --git a/drivers/net/ethernet/intel/i40evf/i40e_type.h b/drivers/net/ethernet/intel/i40evf/i40e_type.h > index d8175cd..6b6fcf6 100644 > --- a/drivers/net/ethernet/intel/i40evf/i40e_type.h > +++ b/drivers/net/ethernet/intel/i40evf/i40e_type.h > @@ -475,7 +475,10 @@ struct i40e_hw { > u32 debug_mask; > }; > > -#define i40e_is_vf(_hw) ((_hw)->mac.type == I40E_MAC_VF) > +static inline bool i40e_is_vf(struct i40e_hw *hw) > +{ > + return (hw->mac.type == I40E_MAC_VF); Likewise. [...] WBR, Sergei -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/drivers/net/ethernet/intel/i40e/i40e_type.h b/drivers/net/ethernet/intel/i40e/i40e_type.h index 844421f..618cce2 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_type.h +++ b/drivers/net/ethernet/intel/i40e/i40e_type.h @@ -481,7 +481,10 @@ struct i40e_hw { u32 debug_mask; }; -#define i40e_is_vf(_hw) ((_hw)->mac.type == I40E_MAC_VF) +static inline bool i40e_is_vf(struct i40e_hw *hw) +{ + return (hw->mac.type == I40E_MAC_VF); +} struct i40e_driver_version { u8 major_version; diff --git a/drivers/net/ethernet/intel/i40evf/i40e_type.h b/drivers/net/ethernet/intel/i40evf/i40e_type.h index d8175cd..6b6fcf6 100644 --- a/drivers/net/ethernet/intel/i40evf/i40e_type.h +++ b/drivers/net/ethernet/intel/i40evf/i40e_type.h @@ -475,7 +475,10 @@ struct i40e_hw { u32 debug_mask; }; -#define i40e_is_vf(_hw) ((_hw)->mac.type == I40E_MAC_VF) +static inline bool i40e_is_vf(struct i40e_hw *hw) +{ + return (hw->mac.type == I40E_MAC_VF); +} struct i40e_driver_version { u8 major_version;
Inline functions are preferred over macros when they can be used interchangeably. Reported-by: Joe Perches <joe@perches.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> --- drivers/net/ethernet/intel/i40e/i40e_type.h | 5 ++++- drivers/net/ethernet/intel/i40evf/i40e_type.h | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-)