From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Michael S. Tsirkin" Subject: [PATCHv2 14/14] vhost: fix 64 bit features Date: Fri, 20 May 2011 02:12:46 +0300 Message-ID: <4045f98f2b0ab9b1d62468e6b66328c236b89f4d.1305846412.git.mst__37492.9315098145$1305848003$gmane$org@redhat.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: virtualization-bounces@lists.linux-foundation.org Errors-To: virtualization-bounces@lists.linux-foundation.org Cc: Krishna Kumar , Carsten Otte , lguest@lists.ozlabs.org, Shirley Ma , kvm@vger.kernel.org, linux-s390@vger.kernel.org, netdev@vger.kernel.org, habanero@linux.vnet.ibm.com, Heiko Carstens , linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, steved@us.ibm.com, Christian Borntraeger , Tom Lendacky , Martin Schwidefsky , linux390@de.ibm.com List-Id: virtualization@lists.linuxfoundation.org Update vhost_has_feature to make it work correctly for bit > 32. Signed-off-by: Michael S. Tsirkin --- drivers/vhost/vhost.h | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/vhost/vhost.h b/drivers/vhost/vhost.h index 8e03379..64889d2 100644 --- a/drivers/vhost/vhost.h +++ b/drivers/vhost/vhost.h @@ -123,7 +123,7 @@ struct vhost_dev { struct vhost_memory __rcu *memory; struct mm_struct *mm; struct mutex mutex; - unsigned acked_features; + u64 acked_features; struct vhost_virtqueue *vqs; int nvqs; struct file *log_file; @@ -176,14 +176,14 @@ enum { (1ULL << VIRTIO_NET_F_MRG_RXBUF), }; -static inline int vhost_has_feature(struct vhost_dev *dev, int bit) +static inline bool vhost_has_feature(struct vhost_dev *dev, int bit) { - unsigned acked_features; + u64 acked_features; /* TODO: check that we are running from vhost_worker or dev mutex is * held? */ acked_features = rcu_dereference_index_check(dev->acked_features, 1); - return acked_features & (1 << bit); + return acked_features & (1ull << bit); } #endif -- 1.7.5.53.gc233e