Subject: Re: [RFC PATCH net-next v2 2/5] net: add phys ID compare helper to test if two IDs are the same

From: Sergei Shtylyov <[email-masked]>
Date: Thu, 18 Jun 2015 17:11:14 +0300

Hello.

On 6/18/2015 12:53 AM, [email-masked] wrote:

> From: Scott Feldman <[email-masked]>

> Signed-off-by: Scott Feldman <[email-masked]>
> ---
>   include/linux/netdevice.h |    7 +++++++
>   net/switchdev/switchdev.c |    8 ++------
>   2 files changed, 9 insertions(+), 6 deletions(-)

> diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
> index 7be616e1..63090ce 100644
> --- a/include/linux/netdevice.h
> +++ b/include/linux/netdevice.h
> @@ -766,6 +766,13 @@ struct netdev_phys_item_id {
>   	unsigned char id_len;
>   };
>
> +static inline bool netdev_phys_item_id_same(struct netdev_phys_item_id *a,
> +					    struct netdev_phys_item_id *b)
> +{
> +	return ((a->id_len == b->id_len) &&
> +		(memcmp(a->id, b->id, a->id_len) == 0));

    Parens around the *return* expression not needed (and neither the ones 
around ==).

[...]

WBR, Sergei