From: Joe Perches <joe@perches.com>
To: Petri Gynther <pgynther@google.com>, linux-wireless@vger.kernel.org
Cc: kvalo@codeaurora.org, davem@davemloft.net, akarwar@marvell.com
Subject: Re: [PATCH 1/2] etherdevice: add is_zero_ether_addr_unaligned()
Date: Fri, 12 Aug 2016 21:11:59 -0700 [thread overview]
Message-ID: <1471061519.3467.7.camel@perches.com> (raw)
In-Reply-To: <1471057200-58166-1-git-send-email-pgynther@google.com>
On Fri, 2016-08-12 at 19:59 -0700, Petri Gynther wrote:
> Add a generic routine to test if possibly unaligned to u16
> Ethernet address is a zero address.
[]
> diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h
[]
> +static inline bool is_zero_ether_addr_unaligned(const u8 *addr)
> +{
> +#if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS)
> + return is_zero_ether_addr(addr);
> +#else
> + return (addr[0] | addr[1] | addr[2] | addr[3] | addr[4] | addr[5]) == 0;
> +#endif
Because the return is bool, the == 0 is unnecessary.
next prev parent reply other threads:[~2016-08-13 4:12 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-13 2:59 [PATCH 1/2] etherdevice: add is_zero_ether_addr_unaligned() Petri Gynther
2016-08-13 3:00 ` [PATCH 2/2] mwifiex: fix unaligned read in mwifiex_config_scan() Petri Gynther
2016-08-16 17:47 ` Petri Gynther
2016-09-08 16:10 ` Amitkumar Karwar
2016-09-08 18:01 ` Kalle Valo
2016-09-26 11:19 ` [2/2] " Kalle Valo
2016-08-13 4:11 ` Joe Perches [this message]
2016-08-13 4:40 ` [PATCH 1/2] etherdevice: add is_zero_ether_addr_unaligned() Petri Gynther
2016-08-13 4:59 ` Joe Perches
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1471061519.3467.7.camel@perches.com \
--to=joe@perches.com \
--cc=akarwar@marvell.com \
--cc=davem@davemloft.net \
--cc=kvalo@codeaurora.org \
--cc=linux-wireless@vger.kernel.org \
--cc=pgynther@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.