From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50908) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bpCbJ-0006ZJ-Lo for qemu-devel@nongnu.org; Wed, 28 Sep 2016 07:00:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bpCbF-0003mj-HK for qemu-devel@nongnu.org; Wed, 28 Sep 2016 07:00:33 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43126) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bpCbF-0003ly-BN for qemu-devel@nongnu.org; Wed, 28 Sep 2016 07:00:29 -0400 Date: Wed, 28 Sep 2016 12:00:25 +0100 From: "Daniel P. Berrange" Message-ID: <20160928110025.GL21583@redhat.com> Reply-To: "Daniel P. Berrange" References: <1474994958-6007-1-git-send-email-felipe@nutanix.com> <1484304137.546185.1474996345417.JavaMail.zimbra@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] io: Fix double shift usages on QIOChannel features List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Felipe Franciosi Cc: =?utf-8?Q?Marc-Andr=C3=A9?= Lureau , Marc-Andre Lureau , Paolo Bonzini , "qemu-devel@nongnu.org" On Wed, Sep 28, 2016 at 10:55:33AM +0000, Felipe Franciosi wrote: > Hi Marc, >=20 > > On 27 Sep 2016, at 18:12, Marc-Andr=C3=A9 Lureau = wrote: > >=20 > > Hi > >=20 > > ----- Original Message ----- > >> When QIOChannels were introduced in 666a3af9, the feature bits were > >> defined shifted. However, when using them, the code was shifting the= m > >> again. The incorrect use was consistent until 74b6ce43, where > >> QIO_CHANNEL_FEATURE_LISTEN was defined shifted but tested unshifted. > >>=20 > >=20 > > And by luck, QIO_CHANNEL_FEATURE_LISTEN =3D=3D (1 << QIO_CHANNEL_FEAT= URE_LISTEN), so it works :) >=20 > Can you elaborate on that? Maybe I'm missing something obvious, but > I'm confused as to how they are equivalent. They're not equivalent QIO_CHANNEL_FEATURE_LISTEN is (1 << 2) which evaulates to 4 and 4 !=3D (1 << 4). Regards, Daniel --=20 |: http://berrange.com -o- http://www.flickr.com/photos/dberrange= / :| |: http://libvirt.org -o- http://virt-manager.or= g :| |: http://entangle-photo.org -o- http://search.cpan.org/~danberr= / :|