From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49093) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YJ2Me-00077h-8b for qemu-devel@nongnu.org; Wed, 04 Feb 2015 10:59:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YJ2MZ-0001XE-Qt for qemu-devel@nongnu.org; Wed, 04 Feb 2015 10:59:40 -0500 Received: from mx1.redhat.com ([209.132.183.28]:59340) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YJ2MZ-0001X9-KW for qemu-devel@nongnu.org; Wed, 04 Feb 2015 10:59:35 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t14FxYPW004152 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Wed, 4 Feb 2015 10:59:34 -0500 Message-ID: <54D241E5.1080707@redhat.com> Date: Wed, 04 Feb 2015 10:59:33 -0500 From: Max Reitz MIME-Version: 1.0 References: <1418647857-3589-1-git-send-email-mreitz@redhat.com> <1418647857-3589-12-git-send-email-mreitz@redhat.com> <20150204135345.GD5641@noname.redhat.com> In-Reply-To: <20150204135345.GD5641@noname.redhat.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v5 11/26] qcow2: More helpers for refcount modification List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: qemu-devel@nongnu.org, Stefan Hajnoczi On 2015-02-04 at 08:53, Kevin Wolf wrote: > Am 15.12.2014 um 13:50 hat Max Reitz geschrieben: >> Add helper functions for getting and setting refcounts in a refcount >> array for any possible refcount order, and choose the correct one during >> refcount initialization. >> >> Signed-off-by: Max Reitz >> Reviewed-by: Eric Blake >> Reviewed-by: Stefan Hajnoczi > Hm... Wouldn't it be better to have a single generic implementation that > is based on uint64_t* and calculates the right shifts and bitmasks on > the fly? Please do try. I tried it, and what I came up with were horrible unreadable abominations. I think you can do better, but I don't know whether it'll look better than this apparent code duplications. Max