From: Christian Borntraeger Subject: [PATCH] virtio_config: fix len calculation of config elements Date: Thu, 29 May 2008 11:08:01 +0200 Message-ID: <200805291108.01604.borntraeger@de.ibm.com> References: <200805271105.00077.borntraeger@de.ibm.com> <200805291027.25369.borntraeger@de.ibm.com> <20080529083004.GQ25504@kernel.dk> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Cc: virtualization@lists.linux-foundation.org, kvm@vger.kernel.org To: Rusty Russell Return-path: Received: from mtagate1.de.ibm.com ([195.212.29.150]:25693 "EHLO mtagate1.de.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751550AbYE2JIL (ORCPT ); Thu, 29 May 2008 05:08:11 -0400 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate1.de.ibm.com (8.13.8/8.13.8) with ESMTP id m4T983I4233790 for ; Thu, 29 May 2008 09:08:03 GMT Received: from d12av03.megacenter.de.ibm.com (d12av03.megacenter.de.ibm.com [9.149.165.213]) by d12nrmr1607.megacenter.de.ibm.com (8.13.8/8.13.8/NCO v8.7) with ESMTP id m4T983Xf2539614 for ; Thu, 29 May 2008 11:08:03 +0200 Received: from d12av03.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av03.megacenter.de.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id m4T982Iw032638 for ; Thu, 29 May 2008 11:08:03 +0200 In-Reply-To: <20080529083004.GQ25504@kernel.dk> Content-Disposition: inline Sender: kvm-owner@vger.kernel.org List-ID: Rusty, This patch is a prereq for the virtio_blk blocksize patch, please apply it first. Adding an u32 value to the virtio_blk_config unconvered a small bug the config space defintions: v is a pointer, to we have to use sizeof(*v) instead of sizeof(v). Signed-off-by: Christian Borntraeger --- include/linux/virtio_config.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Index: kvm/include/linux/virtio_config.h =================================================================== --- kvm.orig/include/linux/virtio_config.h +++ kvm/include/linux/virtio_config.h @@ -99,7 +99,7 @@ static inline bool virtio_has_feature(co * The return value is -ENOENT if the feature doesn't exist. Otherwise * the config value is copied into whatever is pointed to by v. */ #define virtio_config_val(vdev, fbit, offset, v) \ - virtio_config_buf((vdev), (fbit), (offset), (v), sizeof(v)) + virtio_config_buf((vdev), (fbit), (offset), (v), sizeof(*v)) static inline int virtio_config_buf(struct virtio_device *vdev, unsigned int fbit,