From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752197AbbFAK36 (ORCPT ); Mon, 1 Jun 2015 06:29:58 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41214 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751332AbbFAK3s (ORCPT ); Mon, 1 Jun 2015 06:29:48 -0400 Date: Mon, 1 Jun 2015 12:29:43 +0200 From: "Michael S. Tsirkin" To: Greg Kurz Cc: Rusty Russell , Thomas Huth , kvm@vger.kernel.org, linux-api@vger.kernel.org, linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, David Miller Subject: Re: [PATCH v6 2/8] tun: add tun_is_little_endian() helper Message-ID: <20150601122910-mutt-send-email-mst@redhat.com> References: <20150424122211.19156.97626.stgit@bahia.local> <20150424122435.19156.18985.stgit@bahia.local> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150424122435.19156.18985.stgit@bahia.local> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 24, 2015 at 02:24:38PM +0200, Greg Kurz wrote: > Signed-off-by: Greg Kurz Dave, could you please ack merging this through the virtio tree? > --- > drivers/net/tun.c | 9 +++++++-- > 1 file changed, 7 insertions(+), 2 deletions(-) > > diff --git a/drivers/net/tun.c b/drivers/net/tun.c > index 857dca4..3c3d6c0 100644 > --- a/drivers/net/tun.c > +++ b/drivers/net/tun.c > @@ -206,14 +206,19 @@ struct tun_struct { > u32 flow_count; > }; > > +static inline bool tun_is_little_endian(struct tun_struct *tun) > +{ > + return tun->flags & TUN_VNET_LE; > +} > + > static inline u16 tun16_to_cpu(struct tun_struct *tun, __virtio16 val) > { > - return __virtio16_to_cpu(tun->flags & TUN_VNET_LE, val); > + return __virtio16_to_cpu(tun_is_little_endian(tun), val); > } > > static inline __virtio16 cpu_to_tun16(struct tun_struct *tun, u16 val) > { > - return __cpu_to_virtio16(tun->flags & TUN_VNET_LE, val); > + return __cpu_to_virtio16(tun_is_little_endian(tun), val); > } > > static inline u32 tun_hashfn(u32 rxhash) > > _______________________________________________ > Virtualization mailing list > Virtualization@lists.linux-foundation.org > https://lists.linuxfoundation.org/mailman/listinfo/virtualization