Message ID | 20180611011501.10235-2-f4bug@amsat.org |
---|---|
State | New |
Headers | show
Return-Path: <qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=<UNKNOWN>) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=amsat.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="MfCmF95V"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 413w843Nrgz9rvt for <incoming@patchwork.ozlabs.org>; Mon, 11 Jun 2018 11:16:18 +1000 (AEST) Received: from localhost ([::1]:45664 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>) id 1fSBRP-0004VQ-2B for incoming@patchwork.ozlabs.org; Sun, 10 Jun 2018 21:16:15 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42379) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <philippe.mathieu.daude@gmail.com>) id 1fSBQe-0004Td-RB for qemu-devel@nongnu.org; Sun, 10 Jun 2018 21:15:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <philippe.mathieu.daude@gmail.com>) id 1fSBQd-0002IF-SA for qemu-devel@nongnu.org; Sun, 10 Jun 2018 21:15:28 -0400 Received: from mail-qt0-x244.google.com ([2607:f8b0:400d:c0d::244]:34821) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from <philippe.mathieu.daude@gmail.com>) id 1fSBQd-0002Hz-IQ; Sun, 10 Jun 2018 21:15:27 -0400 Received: by mail-qt0-x244.google.com with SMTP id s9-v6so18863770qtg.2; Sun, 10 Jun 2018 18:15:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=BTVCmLBIzAQs2Xn/yJmNLX7DQneA5MVNx58ZgswTROc=; b=MfCmF95VJID497RFK9WqX6uJd4J8M4Ftlrbs5sIEuzfvUCIEh3IR3yKpgYkd/MM4uU aMlm/tjfYZDLEQlZ64UAFyfZWStQMG4XW/fGmpCwEH5RpWNm04niLEOZaYg+V4BRU6Ay XU00iMLIrX2Xd2JWS9Pxl7PzY/71k7ZU0VCFNKfecpZp7E9JLw0ALEXCOllFZK8j8CqL 2fnxYlS+8I567H33cMC00G2MrgZkT0/4yHQ30zUSpwibWwNiUhM9G3P9BbOVq5bhM3+s r0kadONHfQU7P58VCkVaqGH4VN1aJ9LU1ecO6G5y6TewW4Zev6RXBMXELHnpWdTTYD86 e9cg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=BTVCmLBIzAQs2Xn/yJmNLX7DQneA5MVNx58ZgswTROc=; b=j5OBMjtEQvqGEFzVq/p/jH4FZUq5LJw4z5QTt3wWVNtwn7Rk9ZWo/Yy0z/fuZ64zDI PB21NqtoINqOaSvYBFSlUY+AegLCAtbwyRoGid3IB8u+GJXxNIMRvnNIzYpvAzyLmefc VJbnt2wouxnOH10ojEnK86QeRoWz3SD0BoCkVvIrUdw8dbq9nkVNOuhgPdZrjYK7V6pk tqZu6sSxJVclwNCrcDZEf5ZiimIZmLbHwP9RR0ELngaxUdfK4ZhxLMwlF46zjHbYIPI+ h+8hK3mFMZ0wpyBAs/F2q54P/81llKqKMGldqQPVrCA1cMNmx8+SfNd32Gi0TCLXsejO lH3w== X-Gm-Message-State: APt69E1EGtrqwqTSw8sxXeiBJTuQU/KoEOb0g3i1itaoHLnTh9T3k09t dDrKLJQKNH6aK9vNjpqM6WA= X-Google-Smtp-Source: ADUXVKJnvPyu+CkMByfmiE6fseAsMLschGTWnSdkvwjVwXPglsw060As5bgCd7iF2NCw88LCSCoGBg== X-Received: by 2002:a0c:e74c:: with SMTP id g12-v6mr13504237qvn.203.1528679727125; Sun, 10 Jun 2018 18:15:27 -0700 (PDT) Received: from x1.local ([138.117.48.222]) by smtp.gmail.com with ESMTPSA id o5-v6sm28237223qtm.60.2018.06.10.18.15.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 10 Jun 2018 18:15:26 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= <f4bug@amsat.org> To: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>, Thomas Huth <thuth@redhat.com>, Stefan Weil <sw@weilnetz.de> Date: Sun, 10 Jun 2018 22:14:22 -0300 Message-Id: <20180611011501.10235-2-f4bug@amsat.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180611011501.10235-1-f4bug@amsat.org> References: <20180611011501.10235-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::244 Subject: [Qemu-devel] [PATCH v4 01/40] include: Add IEC binary prefixes in "qemu/units.h" X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <http://lists.nongnu.org/archive/html/qemu-devel/> List-Post: <mailto:qemu-devel@nongnu.org> List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help> List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Cc: qemu-trivial@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= <f4bug@amsat.org>, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" <qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org> |
Series |
Use the IEC binary prefix definitions
|
expand
|
On 06/10/2018 03:14 PM, Philippe Mathieu-Daudé wrote: > +#define KiB (1ULL << 10) > +#define MiB (1ULL << 20) > +#define GiB (1ULL << 30) > +#define TiB (1ULL << 40) > +#define PiB (1ULL << 50) > +#define EiB (1ULL << 60) Is there any particular reason to force these to be unsigned? Or, for that matter, 64-bit (at least for the first 3). I ask because this changes the types of some of the expressions in which you use these. r~
diff --git a/include/qemu/units.h b/include/qemu/units.h new file mode 100644 index 0000000000..e3a39ed59e --- /dev/null +++ b/include/qemu/units.h @@ -0,0 +1,20 @@ +/* + * IEC binary prefixes definitions + * + * Copyright (C) 2015 Nikunj A Dadhania, IBM Corporation + * Copyright (C) 2018 Philippe Mathieu-Daudé <f4bug@amsat.org> + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#ifndef QEMU_UNITS_H +#define QEMU_UNITS_H + +#define KiB (1ULL << 10) +#define MiB (1ULL << 20) +#define GiB (1ULL << 30) +#define TiB (1ULL << 40) +#define PiB (1ULL << 50) +#define EiB (1ULL << 60) + +#endif
Loosely based on 076b35b5a56. Suggested-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> --- I suppose the following warning is irrelevant: WARNING: 1 added file, does MAINTAINERS need updating include/qemu/units.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 include/qemu/units.h