From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rusty Russell Subject: Re: [PATCH v5 03/14] KVM: ARM: Initial skeleton to compile KVM support Date: Wed, 16 Jan 2013 13:26:01 +1030 Message-ID: <877gndzvi6.fsf@rustcorp.com.au> References: <20130108183811.46302.58543.stgit@ubuntu> <20130108183855.46302.40539.stgit@ubuntu> <20130114162415.GF23505@n2100.arm.linux.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, Marc Zyngier , Marcelo Tosatti , Rusty Russell To: Christoffer Dall , Russell King - ARM Linux Return-path: Received: from ozlabs.org ([203.10.76.45]:54174 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756398Ab3APDkE (ORCPT ); Tue, 15 Jan 2013 22:40:04 -0500 In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: Christoffer Dall writes: > On Mon, Jan 14, 2013 at 11:24 AM, Russell King - ARM Linux > wrote: >> On Tue, Jan 08, 2013 at 01:38:55PM -0500, Christoffer Dall wrote: >>> + /* -ENOENT for unknown features, -EINVAL for invalid combinations. */ >>> + for (i = 0; i < sizeof(init->features)*8; i++) { >>> + if (init->features[i / 32] & (1 << (i % 32))) { >> >> Isn't this an open-coded version of test_bit() ? > > indeed, nicely spotted: BTW, I wrote it that was out of excessive paranoia: it's a userspace API, and test_bit() won't be right on 64 bit BE systems. Cheers, Rusty.