From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37233) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XzN8P-0004KH-5t for qemu-devel@nongnu.org; Fri, 12 Dec 2014 05:07:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XzN8G-0008K1-45 for qemu-devel@nongnu.org; Fri, 12 Dec 2014 05:07:41 -0500 Received: from e06smtp17.uk.ibm.com ([195.75.94.113]:38088) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XzN8F-0008Jq-RP for qemu-devel@nongnu.org; Fri, 12 Dec 2014 05:07:32 -0500 Received: from /spool/local by e06smtp17.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 12 Dec 2014 10:07:30 -0000 Received: from b06cxnps3075.portsmouth.uk.ibm.com (d06relay10.portsmouth.uk.ibm.com [9.149.109.195]) by d06dlp03.portsmouth.uk.ibm.com (Postfix) with ESMTP id 73EBC1B0805F for ; Fri, 12 Dec 2014 10:07:49 +0000 (GMT) Received: from d06av03.portsmouth.uk.ibm.com (d06av03.portsmouth.uk.ibm.com [9.149.37.213]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id sBCA7RVu56885266 for ; Fri, 12 Dec 2014 10:07:27 GMT Received: from d06av03.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av03.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id sBCA7E6p032284 for ; Fri, 12 Dec 2014 03:07:22 -0700 Date: Fri, 12 Dec 2014 11:07:01 +0100 From: Cornelia Huck Message-ID: <20141212110701.0c6d879b.cornelia.huck@de.ibm.com> In-Reply-To: <20141211154623.4a73fef9@oc7435384737.ibm.com> References: <1418304322-7546-1-git-send-email-cornelia.huck@de.ibm.com> <1418304322-7546-5-git-send-email-cornelia.huck@de.ibm.com> <20141211154623.4a73fef9@oc7435384737.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH RFC v6 04/20] virtio: add feature checking helpers List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Thomas Huth Cc: rusty@rustcorp.com.au, mst@redhat.com, qemu-devel@nongnu.org, virtualization@lists.linux-foundation.org On Thu, 11 Dec 2014 15:46:23 +0100 Thomas Huth wrote: > > +static inline bool __virtio_has_feature(uint32_t features, unsigned int fbit) > > +{ > > + assert(fbit < 32); > > + return !!(features & (1 << fbit)); > > +} > > + > > +static inline bool virtio_has_feature(VirtIODevice *vdev, unsigned int fbit) > > +{ > > + return __virtio_has_feature(vdev->guest_features, fbit); > > +} > > + > > I've got to say that I'm a little bit unhappy with the naming of the > functions - and in contrast to the Linux kernel code, I think it is > also quite uncommon in the QEMU sources to use function names with > double underscores at the beginning. > > Could you maybe rename the second function to "virtio_vdev_has_feature" > instead? And then remove the double underscores from the first function? Renamed the functions just like this.