[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <AANLkTin_w2geQjW-nF4qjiPyD0=KXYswhGQE2cR-KJax@mail.gmail.com>
Date: Fri, 15 Oct 2010 14:22:03 -0700
From: Harvey Harrison <harvey.harrison@...il.com>
To: Stephen Hemminger <shemminger@...tta.com>
Cc: Shreyas Bhatewara <sbhatewara@...are.com>,
"David S. Miller" <davem@...emloft.net>,
"VMware, Inc." <pv-drivers@...are.com>, netdev@...r.kernel.org
Subject: Re: [PATCH net-next] vmxnet3: make bit twiddle routines inline
On Fri, Oct 15, 2010 at 2:06 PM, Stephen Hemminger
<shemminger@...tta.com> wrote:
> +static inline void set_flag_le16(__le16 *data, u16 flag)
> +{
> + *data = cpu_to_le16(le16_to_cpu(*data) | flag);
> +}
> +
Instead of swapping twice on BE machines, why not:
*data |= cpu_to_le16(flag);
Which may even get done away with at compile time if flag is a constant.
Similarly for the others.
Cheers,
Harvey
--
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