From patchwork Thu Jan 3 21:33:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leonid Bloch X-Patchwork-Id: 10747813 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9664714DE for ; Thu, 3 Jan 2019 21:35:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 86D3121E5A for ; Thu, 3 Jan 2019 21:35:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7ADA522A65; Thu, 3 Jan 2019 21:35:18 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 09B9A21E5A for ; Thu, 3 Jan 2019 21:35:17 +0000 (UTC) Received: from localhost ([127.0.0.1]:58007 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gfAe5-0005ps-3N for patchwork-qemu-devel@patchwork.kernel.org; Thu, 03 Jan 2019 16:35:17 -0500 Received: from eggs.gnu.org ([208.118.235.92]:56668) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gfAcs-0004iP-HG for qemu-devel@nongnu.org; Thu, 03 Jan 2019 16:34:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gfAcn-0003NB-In for qemu-devel@nongnu.org; Thu, 03 Jan 2019 16:34:02 -0500 Received: from mail-eopbgr770130.outbound.protection.outlook.com ([40.107.77.130]:25600 helo=NAM02-SN1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gfAcn-0003Mi-BI; Thu, 03 Jan 2019 16:33:57 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janustech.onmicrosoft.com; s=selector1-janustech-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=6aiQ01cpLk7/zrLOYSjnEtfh15br6OKEMqx6/+bZiB8=; b=KDhd/rPDfIAUb8/U9N8PIQbYzZdswNUDKW0/SrD/tY5ZJSZKZGar+1flzGgyrXNorvPitETMCix+Y2/90Z/5MxjjHWMGxbZzb9X6FR7L5PcL4y/y01B719l4w8j5i9x9B+XYLZvVShzflCCexzJAdjqo3jfYMwdf/PoNu24GV4M= Received: from CY1PR07MB2619.namprd07.prod.outlook.com (10.167.16.145) by CY1PR07MB2475.namprd07.prod.outlook.com (10.167.11.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1495.6; Thu, 3 Jan 2019 21:33:54 +0000 Received: from CY1PR07MB2619.namprd07.prod.outlook.com ([fe80::64b4:97dd:3f6f:c474]) by CY1PR07MB2619.namprd07.prod.outlook.com ([fe80::64b4:97dd:3f6f:c474%3]) with mapi id 15.20.1471.021; Thu, 3 Jan 2019 21:33:54 +0000 From: Leonid Bloch To: "qemu-devel@nongnu.org" Thread-Topic: [PATCH v2 0/1] include: Auto-generate the sizes lookup table Thread-Index: AQHUo6wGbetVVHRm9EiR0+YMCT6jNg== Date: Thu, 3 Jan 2019 21:33:53 +0000 Message-ID: <20190103213320.2653-1-lbloch@janustech.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: LNXP265CA0042.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:5c::30) To CY1PR07MB2619.namprd07.prod.outlook.com (2a01:111:e400:c637::17) authentication-results: spf=none (sender IP is ) smtp.mailfrom=lbloch@janustech.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [212.199.57.192] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; CY1PR07MB2475; 6:BZ5pcUbpcLBHaQ7hiX4wbLc3z9FAxJNeuSmgv6Gkyec+tryddUH6KHgoeh86Hkas9bu5LVT6azij4RXSyC9BwKrGlh/7ZfAf4ekxGCQMAVk0QftqAlHEO5Fywg7ZSbsNbFpM7+v2xbpSyI0kPA+ejZZbkmKmfn+n3pbC1RzSy66aRcMZDAkn4fTdm1oWXPtGTOcQIRPH3s8b9QDkQ2NaZuJ8bBC6Wecf/liyFn5/LcLsnw+hzl4QRGz3fGbmXH8diMzhrWXJ8corQ5vCnGcBmUV/RKU+xF2VVcQEc7p85ty8/ApU6aNkL/Ep2aTHnz2yW4xI5sWt5p0EgbFFJRZCf45ByXv7UFqgfjNWUG9A88ognxGS5PuAdAoXDuf6zIbQnV3rKYesSXMxjqJwncLjo7Fu6IysxwI4XMOApfuWG35opXQVyouJU8aXJTEL9dla6R439ulOhiuF4xpLUJOE1A==; 5:mof1ZNRGmakt9/mOaVcPX7AQwOrCmF8OUKouvScmhmYsybG7riwc6bwT66Ewd/OHXoYwUcSPNgm0d9mHaCo+McsR25Z/adMDu8kIfadoz1jgHsz0LDD9ebmknDBWFMwIvFYVn6hkHKCFcVxDjOAl3b23PWkqlf9t8vuYqZoOW0XMMBjNPf5JRcli+cilylkHMsZ5h1z/wBQgIlwDmgHYlQ==; 7:DcT6TsqmOrWteam8O0hX/JBiVQyZhjJf/kQSGwB2MlxmTI6d22vp1fBnOEzXgR2VxSrX2XBAlX3LrsMLuwxK92kcGdN3yxFAGJuh7+2F5ISpPWSZBJkVq48REKcjEi09pyWAjapk2KETpcFEKv2EcA== x-ms-office365-filtering-correlation-id: a37f59ea-ba05-49ab-d336-08d671c32884 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(7021145)(8989299)(5600109)(711020)(4534185)(7022145)(4603075)(4627221)(201702281549075)(8990200)(7048125)(7024125)(7027125)(7023125)(2017052603328)(7153060)(7193020); SRVR:CY1PR07MB2475; x-ms-traffictypediagnostic: CY1PR07MB2475: x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(3230021)(908002)(999002)(5005026)(6040522)(8220060)(2401047)(8121501046)(3002001)(3231475)(944501520)(52105112)(10201501046)(93006095)(93001095)(6041310)(20161123562045)(20161123560045)(20161123558120)(20161123564045)(2016111802025)(6043046)(201708071742011)(7699051)(76991095); SRVR:CY1PR07MB2475; BCL:0; PCL:0; RULEID:; SRVR:CY1PR07MB2475; x-forefront-prvs: 0906E83A25 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(376002)(396003)(366004)(39830400003)(346002)(136003)(189003)(199004)(6486002)(5660300001)(305945005)(186003)(6436002)(966005)(8936002)(71190400001)(14454004)(476003)(105586002)(54906003)(106356001)(486006)(97736004)(86362001)(53936002)(316002)(6512007)(6306002)(1076003)(66066001)(36756003)(4326008)(508600001)(2616005)(386003)(256004)(2351001)(2906002)(6116002)(6916009)(26005)(81166006)(81156014)(5640700003)(99286004)(71200400001)(102836004)(2501003)(3846002)(8676002)(68736007)(6506007)(52116002)(25786009)(7736002); DIR:OUT; SFP:1102; SCL:1; SRVR:CY1PR07MB2475; H:CY1PR07MB2619.namprd07.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: janustech.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: bjT0jCL4UlqQmivyhfw3ctjUsLGUhcYXp70RS1vEaNBFx0326KhMNbttxsfagAsGnVh+wW/5SSKbOK4Weu3mvkTfZe/eMezvn3ariUJ18xyw/luRxYNs8n/Cvi+bDIzr8N0iqMRBjg0irohIVtQNNd6ksyCEmq/KgcbfHP2+fX9BGWuVlIZ9mWiGgtjodpXwGParqgTwakFsywBeKu6saWuvxhWg8tm82HDUbFWErC9hVOO3EwJi5rBUm8pZh9B2LKoha51sr55luoNlvPLYXgNUThNgOCGT7G82ZDbwi+B+PKVpm0Cck8BsHCzzEdPT spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: janustech.com X-MS-Exchange-CrossTenant-Network-Message-Id: a37f59ea-ba05-49ab-d336-08d671c32884 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Jan 2019 21:33:53.9555 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 34eb020e-3cf3-43a1-afeb-f5cf1310628e X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR07MB2475 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 40.107.77.130 Subject: [Qemu-devel] [PATCH v2 0/1] include: Auto-generate the sizes lookup table X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Alberto Garcia , "qemu-block@nongnu.org" , Stefan Weil , Markus Armbruster , Max Reitz , Leonid Bloch , =?iso-8859-1?q?Philippe_Mathieu-Daud=E9?= Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Following the conversations here: https://patchwork.kernel.org/patch/10665157 and here: https://patchwork.kernel.org/patch/10666975 Making the lookup table for power-of-two sizes auto-generated, instead of being hard-coded into the units.h file. I'm not sure if the changes I've made to Makefile here are "standard". Please correct me if that's not the case. Sorry it took so much time - I was busy with something completely different. Regards, Leonid. --- Differences from v1: * The generated header moved from $(SRC_PATH)/include/qemu/sizes.h to pow2_sizes.h in the build directory. * The commit message mentions the commit which is partially reverted by the current commit. * Small changes in the comments of the generated header file. Leonid Bloch (1): include: Auto-generate the sizes lookup table .gitignore | 1 + Makefile | 5 +++ block/qcow2.h | 2 +- block/vdi.c | 1 + include/qemu/units.h | 73 -------------------------------------------- scripts/gen-sizes.sh | 66 +++++++++++++++++++++++++++++++++++++++ 6 files changed, 74 insertions(+), 74 deletions(-) create mode 100755 scripts/gen-sizes.sh