Skip to content

Commit 4bd145b

Browse files
author
Jeff Kirsher
committed
i40e/i40evf: Convert macro to static inline
Inline functions are preferred over macros when they can be used interchangeably. CC: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> Reported-by: Joe Perches <joe@perches.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
1 parent e51d9b8 commit 4bd145b

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

drivers/net/ethernet/intel/i40e/i40e_type.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,10 @@ struct i40e_hw {
481481
u32 debug_mask;
482482
};
483483

484-
#define i40e_is_vf(_hw) ((_hw)->mac.type == I40E_MAC_VF)
484+
static inline bool i40e_is_vf(struct i40e_hw *hw)
485+
{
486+
return hw->mac.type == I40E_MAC_VF;
487+
}
485488

486489
struct i40e_driver_version {
487490
u8 major_version;

drivers/net/ethernet/intel/i40evf/i40e_type.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,10 @@ struct i40e_hw {
475475
u32 debug_mask;
476476
};
477477

478-
#define i40e_is_vf(_hw) ((_hw)->mac.type == I40E_MAC_VF)
478+
static inline bool i40e_is_vf(struct i40e_hw *hw)
479+
{
480+
return hw->mac.type == I40E_MAC_VF;
481+
}
479482

480483
struct i40e_driver_version {
481484
u8 major_version;

0 commit comments

Comments
 (0)