From patchwork Mon May 11 17:11:44 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark McLoughlin X-Patchwork-Id: 27054 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@bilbo.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from ozlabs.org (ozlabs.org [203.10.76.45]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mx.ozlabs.org", Issuer "CA Cert Signing Authority" (verified OK)) by bilbo.ozlabs.org (Postfix) with ESMTPS id C5FA3B6F56 for ; Tue, 12 May 2009 03:12:19 +1000 (EST) Received: by ozlabs.org (Postfix) id B24BCDDD04; Tue, 12 May 2009 03:12:19 +1000 (EST) Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id 48CD8DDDA2 for ; Tue, 12 May 2009 03:12:19 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753664AbZEKRMF (ORCPT ); Mon, 11 May 2009 13:12:05 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753525AbZEKRME (ORCPT ); Mon, 11 May 2009 13:12:04 -0400 Received: from mail28.svc.cra.dublin.eircom.net ([159.134.118.224]:33745 "HELO mail28.svc.cra.dublin.eircom.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1751885AbZEKRMA (ORCPT ); Mon, 11 May 2009 13:12:00 -0400 Received: (qmail 92669 messnum 3432611 invoked from network[83.70.64.178/83-70-64-178-dynamic.b-ras1.srl.dublin.eircom.net]); 11 May 2009 17:11:57 -0000 Received: from 83-70-64-178-dynamic.b-ras1.srl.dublin.eircom.net (HELO blaa.localdomain) (83.70.64.178) by mail28.svc.cra.dublin.eircom.net (qp 92669) with SMTP; 11 May 2009 17:11:57 -0000 Received: by blaa.localdomain (Postfix, from userid 500) id 8BEF88820A; Mon, 11 May 2009 18:11:47 +0100 (IST) From: Mark McLoughlin To: Rusty Russell Cc: netdev@vger.kernel.org, Dor Laor , Avi Kivity , virtualization@lists.linux-foundation.org, Mark McLoughlin Subject: [PATCH 1/3] virtio: teach virtio_has_feature() about transport features Date: Mon, 11 May 2009 18:11:44 +0100 Message-Id: <1242061906-16226-1-git-send-email-markmc@redhat.com> X-Mailer: git-send-email 1.6.0.6 In-Reply-To: <1242061838.25337.8.camel@blaa> References: <1242061838.25337.8.camel@blaa> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Drivers don't add transport features to their table, so we shouldn't check these with virtio_check_driver_offered_feature(). We could perhaps add an ->offered_feature() virtio_config_op, but that perhaps that would be overkill for a consitency check like this. Signed-off-by: Mark McLoughlin --- include/linux/virtio_config.h | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/include/linux/virtio_config.h b/include/linux/virtio_config.h index bf8ec28..e4ba694 100644 --- a/include/linux/virtio_config.h +++ b/include/linux/virtio_config.h @@ -99,7 +99,9 @@ static inline bool virtio_has_feature(const struct virtio_device *vdev, if (__builtin_constant_p(fbit)) BUILD_BUG_ON(fbit >= 32); - virtio_check_driver_offered_feature(vdev, fbit); + if (fbit < VIRTIO_TRANSPORT_F_START) + virtio_check_driver_offered_feature(vdev, fbit); + return test_bit(fbit, vdev->features); }