From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33148) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c3mxI-00066W-7k for qemu-devel@nongnu.org; Mon, 07 Nov 2016 11:39:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c3mxH-0003L7-FT for qemu-devel@nongnu.org; Mon, 07 Nov 2016 11:39:32 -0500 From: Max Reitz Date: Mon, 7 Nov 2016 17:39:21 +0100 Message-Id: <20161107163921.699-1-mreitz@redhat.com> Subject: [Qemu-devel] [PATCH for-2.8] hbitmap: Fix the serialization granularity's type List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-block@nongnu.org Cc: qemu-devel@nongnu.org, Max Reitz , Fam Zheng , John Snow This function returns a uint64_t, so it should not truncate its result by performing a plain int calculation. Signed-off-by: Max Reitz --- util/hbitmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/hbitmap.c b/util/hbitmap.c index 5d1a21c..c57be76 100644 --- a/util/hbitmap.c +++ b/util/hbitmap.c @@ -401,7 +401,7 @@ uint64_t hbitmap_serialization_granularity(const HBitmap *hb) { /* Require at least 64 bit granularity to be safe on both 64 bit and 32 bit * hosts. */ - return 64 << hb->granularity; + return UINT64_C(64) << hb->granularity; } /* Start should be aligned to serialization granularity, chunk size should be -- 2.10.2