Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3817565imu; Mon, 14 Jan 2019 09:30:54 -0800 (PST) X-Google-Smtp-Source: ALg8bN5Z41/xtzWcgBYnzY7wA1z2oFl3Sg17NvQCBcT1VsLQTedhZ/k8a55od4GhVVlaGNQmSwgp X-Received: by 2002:a17:902:714c:: with SMTP id u12mr26148889plm.234.1547487053940; Mon, 14 Jan 2019 09:30:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547487053; cv=none; d=google.com; s=arc-20160816; b=yAy1CpH7VRmHGR6nT/c38FzEJDSUFPuDVQhBZZGwraAtgLDyR94LKlEDm4lgijbYUG DFiYK55DMPEcbTjzsCx97mH7Fwf14GCsQ8rsTZJEZVV+d6P80z0G48p5mcvQqwbKBmhd UQM8k8f6F3m/SA8HEXb6uVoO8yP8SpYWcIFBmIqGUmq9KredaiGCL4cRKX9+5f8Dlerz YJV3Mm+bCEovQyavO+Ln0mQBh1sDBKEkJkDY91v49SaOLEp6kyOb2krVlN8hu4+xv6tC PO/D/VJCFPYvfdO/Jymoy+sHze53nSVhchBNF0eM/gmOL7FUzGlZWjBTMdorhUWB5eh9 01sQ== 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:cc:to:from:dkim-signature; bh=+10xgcP3bB3YXfZwVzop4pIXVF8P35unhxy/Ad7dAj8=; b=yupcgXVR3SGX2V43PThjk6u5wNqYYX7rpkNsIUxzPHhgkRWfCXpm1SHJqbtn3e/Nh4 cXWcK84/Ln5kkFBuTdgQteU8LLOMJJbUtTzBdhasU07GTegRT4PjzHUeifs3nAm/VOGc /5kLyNy1mh3qB+i8JpVf+Hcs3/wB8Hgfla2We/d0iE9kv5LnjwTcxzCpvz6IwQBvJik8 IstiX2qui4ZVXVKvPG0RQRGVgW/0DCkupD2g028aOhdgisx2O5DhcjKcIXQ6fnJcopnU 98dWqHogTUP5PqjJqxFVhxEZqmJYkicPjiVCZ3j5qddzV1dTvye31F1Fhbh0uq90wkgZ HMnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@Mellanox.com header.s=selector1 header.b=jflki1wd; 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 69si795544pla.75.2019.01.14.09.30.38; Mon, 14 Jan 2019 09:30:53 -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=jflki1wd; 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 S1726790AbfANR2m (ORCPT + 99 others); Mon, 14 Jan 2019 12:28:42 -0500 Received: from mail-eopbgr80040.outbound.protection.outlook.com ([40.107.8.40]:65056 "EHLO EUR04-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726495AbfANR2l (ORCPT ); Mon, 14 Jan 2019 12:28:41 -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=+10xgcP3bB3YXfZwVzop4pIXVF8P35unhxy/Ad7dAj8=; b=jflki1wdTmQT+DPxYGghlx7PYNVc/KEDinqL1P+zwtXVJQ6iUVgWdyuktF1ey3mim8SL2ZRDbzDC57cTYzCl56xRSHfTi53iTZUGSMxm9ENaoqQ+dWEPUD0QjMXKO95eEOEs+O0oP7rDMmlH0WXWaHJcNQFceW/P/XkEj35iUZ8= Received: from HE1PR05MB4601.eurprd05.prod.outlook.com (20.176.163.138) by HE1PR05MB4634.eurprd05.prod.outlook.com (20.176.163.147) 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:28:34 +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:28:34 +0000 From: Jason Gunthorpe To: Federico Vaga CC: 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: AQHUqT7yMz195OkzB0O1DFW0sNTtuKWtYAuAgAGqlYA= Date: Mon, 14 Jan 2019 17:28:34 +0000 Message-ID: <20190114172827.GG22875@mellanox.com> References: <20190110234805.GN6890@ziepe.ca> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: MWHPR17CA0069.namprd17.prod.outlook.com (2603:10b6:300:93::31) 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;HE1PR05MB4634;6:RL/gwLjDvoUFyqw4m/Pnm59ak5qvpi5tOmjdXma+N65taQEXgCSkuaxlU6rxnKu+wyNz/kc8LZyrdNYIS4I1b4ckc5N0FRm4diyDR4Soa3Wx2y0bsDSSsk2+t2pW+E6NghyEE9WYYkcSfKmXOZ9heAY8a2AVrxLwKXn/N+1Hftsz8986biruYoSPPbGxz3IABlEEOz34yZH5eRqpzgKQVuqyrJXCHwMOvpE12Ip49Vqmb7ox3WqDeFNNbyBwe6oJVuPvVziD6suQWkd8KSCMQi1hio3C1NLzTmXN1duu4jDFWgDUZGB7xE/IAGq+CN3ph7f9NKgukxfaB+zqGdiLdDIC2gBaQO1w+fQhz+SyDjkSXn2L1GcMp2hTvB3NTdrWAOb+tpxzpm5I1JJ2CC5+B3ixGvfvwEfM8JIVELQeb6H+C9NCrK4FY1qwPP5DLNZ7P8VWYe+WSdlZ/T0XMgxyMw==;5:P06IGtAgivHSpEiLDu7Tm5B2paj4QZEzUINGeeBQ/bIbcAJcQvBML9mTETbxvruikMpC7LJu2vHd65GYpxqce3FtU14qZLtzPKO22SWEtZh6+eKX7lDQtQ9TACrW5WTL1zzi8cdHRHUROxkk2V/ADrFNXHDSLZ4C0KhZrC16hZOHwrfm6qWBqsUJSWbVCBQ1ZYB30BUy+h1Z3Xw6BzFcaA==;7:fY4M73h+lEQDjFGeynwTiEe83MYB61hOahKrignf2hSrKkj24T1Cf/x/aAhaSZ5dTb/Z6S2CqWGYj42ERyzKPzpLblhxC0w/v4olK5HHM8bxMeGauFrfn4Dj2pswah9LbHqGJAoN4hMaQZQWP9t1hw== x-ms-office365-filtering-correlation-id: da97e2b9-b7da-4a82-5e89-08d67a45b5fb 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:HE1PR05MB4634; x-ms-traffictypediagnostic: HE1PR05MB4634: x-microsoft-antispam-prvs: x-forefront-prvs: 0917DFAC67 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(396003)(346002)(376002)(39860400002)(136003)(366004)(189003)(199004)(7416002)(36756003)(99286004)(26005)(476003)(2616005)(486006)(11346002)(446003)(7736002)(256004)(14444005)(186003)(2906002)(53936002)(102836004)(6916009)(25786009)(5660300001)(33656002)(86362001)(305945005)(105586002)(97736004)(106356001)(6506007)(6246003)(386003)(66066001)(316002)(68736007)(8936002)(81156014)(229853002)(76176011)(71190400001)(71200400001)(81166006)(14454004)(6486002)(4326008)(6512007)(8676002)(52116002)(6116002)(6436002)(3846002)(1076003)(478600001)(54906003);DIR:OUT;SFP:1101;SCL:1;SRVR:HE1PR05MB4634;H:HE1PR05MB4601.eurprd05.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A: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: nqbfZBOZHid4YS1q6cElPzBjPyGycMQYOyQqGLyv2Re1cQgH6jWyi7rIBc4CQDNAC1KaUux437tnOBhJgXXdZKOw/Q2OnYop7AdIr4DKxWtzjq8Rftwtt0C6eQx6okCCptgHMxllsGNge/q9z/dM4m5FYCfcCXPuuRkKpTMZiR+YHRILH9P/oKF6eUVBP93JmSO5Z8FhRAcNKQAXukqE1Pg/n029E38xZ0asHZhare7rijgLcTVByVZFjz4dXF10OzbmVJYS0/8Ex3ELc1F9479rPYuGshRcKAaaef2mYlNiszSGmqhGZCjBwJjL5FAr2h+mUPDGlA7LZKsARP+jj3e93sbOMjGABydnLURFgRK+OSYormRNkN15hevOa7/VQ4Bv9ziVshSYt8eiNXpENYx+TE2vzH0Jm1j0NFkFtI4= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-ID: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: da97e2b9-b7da-4a82-5e89-08d67a45b5fb X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Jan 2019 17:28:34.3965 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR05MB4634 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jan 13, 2019 at 05:01:39PM +0100, Federico Vaga wrote: > > -17) Don't re-invent the kernel macros > > +17) Using bool > > +-------------- > > + > > +The Linux kernel bool type is an alias for the C99 _Bool type. bool > > values can > > +only evaluate to 0 or 1, and implicit or explicit conversion to bool > > +automatically converts the value to true or false. When using bool > > types the > > +!! construction is not needed, which eliminates a class of bugs. > > + > > +When working with bool values the true and false definitions should be > > used > > +instead of 0 and 1. >=20 > A very minor thing. I would suggest to keep consistent, in the > statement, the mapping between definitions ("true and false [...]") > and their correspondent integer values ("[...] instead of 1 and 0"). >=20 > In few words, I propose to change "0 and 1" into "1 and 0". Hm, sure, seems harmless > > +Similarly for function arguments, many true/false values can be > > consolidated > > +into a single bitwise 'flags' argument and 'flags' can often a more > > readable > > +alternative if the call-sites have naked true/false constants. >=20 > Of course, English is not my primary language, but it looks to me > that here a "be" is missing: "[...] and 'flags' can often a more > readable alternative [...]". yes, sthanks =20 > > +Otherwise limited use of bool in structures and arguments can improve > > +readability. >=20 > I'm going to update the Italian translations for this. Do you want > me to contribute directly to this patch? Otherwise I will send a > dedicated patch later when this one get accepted. =20 I think you should send it as an update I guess? I don't really know the process for translations Jason