Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3809860imu; Mon, 14 Jan 2019 09:22:46 -0800 (PST) X-Google-Smtp-Source: ALg8bN5MKw/GW13niT/yFmCWAbO4VZc8NMRXUB+DTMksJUBxLO8KknrpFRgNjsT3ZO289YRizdwK X-Received: by 2002:a17:902:a601:: with SMTP id u1mr26311414plq.77.1547486566837; Mon, 14 Jan 2019 09:22:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547486566; cv=none; d=google.com; s=arc-20160816; b=OMES53pdMkFZV9olmU47RMnXfHTDUJEpRGLg0Z4RYZ5G4bVclAMY0N1AzKAGj0HeEO 2uyu3TFcbDK433FebvX+/N9leIptTTvqYpwzb6JIYCu09W1bQv/RUGG5o7O1mkeoSgCC ULARVYIvcUolEkLm4Mr4Kh0TkKHpZ0WNHuWFXRs/5wyMe7q6AcBbdgPq5nITcgCm3R5b PYhOmB1470yCAiGChp8R+G0TU7BfbpgYqXS1GB41gizpmp1THsnFl3xijVWQgCR2OuIk BjMA0IKDtBkryVAkVhFrFAxOFXkKmHsulb0p/Sa6+li8wT3YdXKcDfcHAeDfXujNhGxa /mFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-id:spamdiagnosticmetadata:spamdiagnosticoutput :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:to:from:dkim-signature; bh=6XcuNSCDF56wQ6uFJEwLiijDZB4Zk52vqZUhFrSKmHE=; b=GhrjwP1ON7xMeb9ub+7hci3PskDiDIMvW3NinzwXlj4ALVpt1l3sSTabSE1YKH4gwH 9Erxvyibr508yHUMHM/yH3qCOEL0Q5v30WdMzDryOhXsrqJ98KD73MH4wtIuJhZg+dbd JHygtPYMZMu259SKqtARQLQYXFQsHQHh6J+Uk33Mg9s5TtXq+wgkQmySitjKMrDYXebk pnO8qtlwIowhyobgyxhIajahagHudlgal6HKqGqjDi19w+OsAkgQlNtFGBhTcRztM3U9 t0dtZv3zopFXownAp77/5AiF3JU8wpj9sgmC/rSAsBWTjC8ZUQX7NyvoRcuYLu2IpMfb J/uQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@Mellanox.com header.s=selector1 header.b=WHIH13y6; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=mellanox.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w185si678500pgd.518.2019.01.14.09.22.31; Mon, 14 Jan 2019 09:22:46 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@Mellanox.com header.s=selector1 header.b=WHIH13y6; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=mellanox.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726802AbfANRUz (ORCPT + 99 others); Mon, 14 Jan 2019 12:20:55 -0500 Received: from mail-eopbgr80052.outbound.protection.outlook.com ([40.107.8.52]:59872 "EHLO EUR04-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726673AbfANRUz (ORCPT ); Mon, 14 Jan 2019 12:20:55 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=6XcuNSCDF56wQ6uFJEwLiijDZB4Zk52vqZUhFrSKmHE=; b=WHIH13y6CYHPRUNCkcKgEItQmaQ4YWhqHkIICxEyUtR4sK8dFEKBK2FOWY7XCM/NY5kcM+vRhU1KqG2jn0IaAR9HhkyHmy/2iqgg6TnP0ptTgY51yRu+5oEb48M6A+rGRjY5vLvWJhGxWr1MBhuEWlvQz6tL/M/kelOJ+sRrGh8= Received: from HE1PR05MB4601.eurprd05.prod.outlook.com (20.176.163.138) by HE1PR05MB3387.eurprd05.prod.outlook.com (10.170.246.161) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1516.18; Mon, 14 Jan 2019 17:20:50 +0000 Received: from HE1PR05MB4601.eurprd05.prod.outlook.com ([fe80::75a0:a89d:1227:7ed3]) by HE1PR05MB4601.eurprd05.prod.outlook.com ([fe80::75a0:a89d:1227:7ed3%5]) with mapi id 15.20.1516.019; Mon, 14 Jan 2019 17:20:50 +0000 From: Jason Gunthorpe To: Joey Pabalinas , Joe Perches , Gal Pressman , Bart Van Assche , Stephen Warren , Tariq Toukan , "xavier.huwei@huawei.com" , "netdev@vger.kernel.org" , "linux-rdma@vger.kernel.org" , Doug Ledford , Stephen Warren , Christoph Hellwig , Andrew Morton , Linus Torvalds , "linux-doc@vger.kernel.org" , Jonathan Corbet , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH v4] coding-style: Clarify the expectations around bool Thread-Topic: [PATCH v4] coding-style: Clarify the expectations around bool Thread-Index: AQHUqT7yMz195OkzB0O1DFW0sNTtuKWqU/gAgAS0gAA= Date: Mon, 14 Jan 2019 17:20:49 +0000 Message-ID: <20190114172044.GE22875@mellanox.com> References: <20190110234805.GN6890@ziepe.ca> <20190111172940.zufmrhvukqo5hkat@gmail.com> In-Reply-To: <20190111172940.zufmrhvukqo5hkat@gmail.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: MWHPR11CA0025.namprd11.prod.outlook.com (2603:10b6:300:115::11) To HE1PR05MB4601.eurprd05.prod.outlook.com (2603:10a6:7:99::10) authentication-results: spf=none (sender IP is ) smtp.mailfrom=jgg@mellanox.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [174.3.196.123] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;HE1PR05MB3387;6:REOL4wVuaX+GUY5bHtX9TV2lGhO5LBowaDe7gE8fIocEsdRSdiYmM3IYCuPSXp25qVDHLQVZ12yQdEBdFd/EZVPHH8sLoXzjKYss1in0iZAQohYKF54/O76B7TpmeDMv10YtQT5QBLV+6UCZCux57LJcww3PE5YdVyL2kVM912lO2ydVoHbL+NFnE1Dn6jDY0upJaIyCbQtIa2eJqdQIhEt0AIqOTJ0UacS9axSsa4G2ByDFMTOmbF6icIYee97xdtZQkNjgNhVS/fV3g2fjSjSrDbrDmH8dAGLYqgRIyIRxQ2vhPEkYYy9cCsy9c9HjY09LHTaVtoEF2zlo7fca0Wbnmrd3pAOA4cc2CCGA84u2QZbCIxgTvTKSqOtK77V3EO/lKL7w+I7Fvxhb3PZYogOmJnW568KjEHOP6UPauXVMQvS2wrudaRKAgP7Rule2KlkJsyQ52Wpr7coCPPpHgw==;5:obu8W8lM87BEMfKUHtllIAaDTNeYwg/0yF+z2hYNO8MAPetVQ//oFLzrk7ferv9hxZAxqZheO+OnuCdwBZd2Cp35H4VBN4Gcpd8v0GG0OrQHU/vSXRarmdhqFlap1bkbCfmCMiCewQLTE5TkDhDTkrF3VB+Phiesw08lZVj7CxyoxqhD32KkAi/4ttm3IkrFuu+orVK7pp0VMjYIwbjWww==;7:G/2/NmGy4pQBEQNWCaVRHK0UDqBJqZgDUrXIM/PqL3IWfxj4ZVdS3IHi16VwJeybNC0KZAbn4n3pAKWVNSubKv/KpRBK0uqpaUlq2y2MObPAyidc+abzfI0bCzPjei6oH6H1om/SLq70hKDkJ0VDeg== x-ms-office365-filtering-correlation-id: e452320e-8d92-436b-9068-08d67a44a0ca x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600109)(711020)(4618075)(2017052603328)(7153060)(7193020);SRVR:HE1PR05MB3387; x-ms-traffictypediagnostic: HE1PR05MB3387: x-microsoft-antispam-prvs: x-forefront-prvs: 0917DFAC67 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(136003)(366004)(376002)(39860400002)(346002)(396003)(199004)(189003)(2616005)(476003)(11346002)(478600001)(446003)(2501003)(486006)(39060400002)(97736004)(33656002)(53936002)(2906002)(6512007)(7736002)(305945005)(14454004)(66066001)(6246003)(36756003)(25786009)(8676002)(81156014)(81166006)(256004)(14444005)(71200400001)(71190400001)(229853002)(76176011)(52116002)(6486002)(6436002)(105586002)(106356001)(5660300001)(99286004)(7416002)(386003)(102836004)(316002)(68736007)(6506007)(110136005)(1076003)(6116002)(26005)(2201001)(186003)(86362001)(3846002)(8936002)(921003)(1121003);DIR:OUT;SFP:1101;SCL:1;SRVR:HE1PR05MB3387;H:HE1PR05MB4601.eurprd05.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: Z2ZYaowOHWQWkrt5vYwS5KOVvmowcBJvD6FVN0D1w9GK5jd9PT8869GP+8AY9GlYz654Pz+Y0JI3ZEInbAkkm6fjkxLt6ZJ2OYZ3dBtjtAZA+jZrOutjdHH/AJtDKXtfQAG+vP2rsPsDBKQ9XMg0sINIWXlGRoEf3P52uV5oQaP3PHHVw3z+O5XkQO9t6BxYMHA3miPiOIt4rsz7sRWrxk+ckxnDOQHF+K/sFg80xEm63uDU+pxRs8na3s8RzSSCylM4LvRG8ZjnwUKXybh3RdngLlHjTSzgRqvKhHsq59D2NcYThpLaZ4/JUq99OfOkQydSupPR+rBAbCmrSRpTU/YrmR2SUG/nVsdYfDuvbAGL+4XuwANs2AFymZ3+KOhUT7G2Wez0FKcOFzeLVv7I7Qo8jX076Te51adAwAcVq08= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-ID: <420A43F343C15F47AEEDD50D202BF142@eurprd05.prod.outlook.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: e452320e-8d92-436b-9068-08d67a44a0ca X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Jan 2019 17:20:49.3468 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR05MB3387 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 11, 2019 at 07:29:40AM -1000, Joey Pabalinas wrote: > On Thu, Jan 10, 2019 at 11:48:13PM +0000, Jason Gunthorpe wrote: > > There has been some confusion since checkpatch started warning about bo= ol > > use in structures, and people have been avoiding using it. > >=20 > > Many people feel there is still a legitimate place for bool in structur= es, > > so provide some guidance on bool usage derived from the entire thread t= hat > > spawned the checkpatch warning. >=20 > Hey Jason, >=20 > I very much agree that the bool expectations could be much clearer, and t= his > patch is a nice step in that direction! Just a couple small nitpicks: >=20 > > +Do not use bool if cache line layout or size of the value matters, its= size > > +and alignment varies based on the compiled architecture. Structures th= at are > > +optimized for alignment and size should not use bool. >=20 > +Do not use bool if cache line layout or size of the value matters, as it= s size > ^ > | > Adding an "as" makes the sentence flow a bit cleaner: -------------- >=20 > > +into a single bitwise 'flags' argument and 'flags' can often a more re= adable > > +alternative if the call-sites have naked true/false constants. >=20 > +into a single bitwise 'flags' argument and 'flags' can often be a more r= eadable > ^ > | > Missing a "be" here: ----------------------------------------- >=20 > Ack from me after those two corrections. >=20 > Reviewed-by: Joey Pabalinas done, thanks Jason