lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5487482B.1030609@cogentembedded.com>
Date:	Tue, 09 Dec 2014 22:06:19 +0300
From:	Sergei Shtylyov <sergei.shtylyov@...entembedded.com>
To:	Jeff Kirsher <jeffrey.t.kirsher@...el.com>, davem@...emloft.net
CC:	netdev@...r.kernel.org, nhorman@...hat.com, sassmann@...hat.com,
	jogreene@...hat.com
Subject: Re: [net-next 13/13] i40e/i40evf: Convert macro to static inline

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@...ches.com>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@...el.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@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ