Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933824AbcK2O7l (ORCPT ); Tue, 29 Nov 2016 09:59:41 -0500 Received: from mail-sn1nam02on0125.outbound.protection.outlook.com ([104.47.36.125]:44571 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S933196AbcK2O7c (ORCPT ); Tue, 29 Nov 2016 09:59:32 -0500 X-Greylist: delayed 1121 seconds by postgrey-1.27 at vger.kernel.org; Tue, 29 Nov 2016 09:59:32 EST From: Matthew Wilcox To: Randy Dunlap , Matthew Wilcox , "linux-kernel@vger.kernel.org" , Andrew Morton , Konstantin Khlebnikov , Ross Zwisler CC: "linux-mm@kvack.org" , "linux-fsdevel@vger.kernel.org" , "Kirill A . Shutemov" Subject: RE: [PATCH v3 24/33] radix-tree: Add radix_tree_split Thread-Topic: [PATCH v3 24/33] radix-tree: Add radix_tree_split Thread-Index: AQHSSdQRl6e9RLd09UyAkLMsBfrJf6DwA+7g Date: Tue, 29 Nov 2016 14:26:40 +0000 Message-ID: References: <1480369871-5271-1-git-send-email-mawilcox@linuxonhyperv.com> <1480369871-5271-25-git-send-email-mawilcox@linuxonhyperv.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=mawilcox@microsoft.com; x-originating-ip: [45.72.231.245] x-ms-office365-filtering-correlation-id: d662d742-d871-4808-2316-08d41863bc92 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:SN1PR21MB0078; x-microsoft-exchange-diagnostics: 1;SN1PR21MB0078;7:GETPzaDAeuuWnrCHRYQUe0VElIAtOG4lODGK8d0YvTaN4Sz3dBSsR364EzT6aEwQ/+PKEZYIeHt/l9/DH5TL6uz2+9yyX5U6++trg26xorWaYMMbc1o02szKnYmO643n/f7Oo2KtxDIu4eSd1Lf7dnV+2mWnFixOtRAjgAbrvNayS/+b7sKnyX9IcTgXL4lMb3sEDCX6+J1Id+bgnT57P6IjmYkh61pMiQO06N8A69rkHiS+5ZuLczyUhrMeQFnZL8oZk/wTIIyv1WanzfVxo7tZZFt9ddqhs8feCYvMO/+7PDuALflEerH9rAlr+jMcrlY4tGvW/KFr0938jrAIOWHe/cyOzvdYqLpVAPnzqCfBmyBZA2uucNRXCgqk06qDaX6xPNoQ+ZUdCjyftQlSuXH/hidZ/oif+krvGInbZBS1zU6r+0FVz1//7QILca9AIbHDKI5PhM1sE8ty47Cc+AYChEDyHe89Eh4ZRf5n+tM= x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(61425038)(6060326)(6040361)(6045199)(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001)(6055026)(61426038)(61427038)(6061324)(6041248)(20161123555025)(20161123560025)(20161123564025)(20161123562025)(20161123558021)(6072148);SRVR:SN1PR21MB0078;BCL:0;PCL:0;RULEID:;SRVR:SN1PR21MB0078; x-forefront-prvs: 01415BB535 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(7916002)(189002)(199003)(81156014)(81166006)(3846002)(3280700002)(189998001)(4326007)(9686002)(3660700001)(8990500004)(5001770100001)(97736004)(8936002)(10290500002)(5005710100001)(102836003)(10090500001)(6116002)(6506003)(76176999)(50986999)(54356999)(33656002)(99286002)(101416001)(7696004)(106356001)(105586002)(106116001)(229853002)(66066001)(76576001)(39450400002)(5660300001)(8676002)(68736007)(305945005)(2501003)(2950100002)(74316002)(7736002)(38730400001)(92566002)(77096006)(7846002)(2900100001)(39400400001)(39380400001)(2906002)(39410400001)(86362001)(39060400001)(122556002)(86612001);DIR:OUT;SFP:1102;SCL:1;SRVR:SN1PR21MB0078;H:SN1PR21MB0077.namprd21.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Nov 2016 14:26:40.8733 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR21MB0078 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by mail.home.local id uATExiQX030013 Content-Length: 1626 Lines: 27 From: Randy Dunlap [mailto:rdunlap@infradead.org] > > +void radix_tree_iter_replace(struct radix_tree_root *, > > + const struct radix_tree_iter *, void **slot, void *item); > > > +int radix_tree_split(struct radix_tree_root *, unsigned long index, > > + unsigned new_order); > > and above: > > As indicated in CodingStyle: > In function prototypes, include parameter names with their data types. > Although this is not required by the C language, it is preferred in Linux > because it is a simple way to add valuable information for the reader. I think the rule here should be a bit more nuanced. I think it is positively criminal to have an unnamed 'unsigned long' or 'bool' in a function prototype. But what extra information is communicated by adding 'root' after 'struct radix_tree_root *'? I know it's a root, you told me that with the structure name! Obviously sometimes it would be useful, for example if we had a function to move an entry from one radix tree to another, you might want to have 'struct radix_tree_root *old, struct radix_tree_root *new' as two of your parameters. > > int radix_tree_join(struct radix_tree_root *, unsigned long index, > > unsigned new_order, void *); > > Yes, the source file already omits some function prototype parameter names, > so these patches just follow that tradition. It's weird (to me) though that > the existing code even mixes this style in one function prototype (see > immed. above). I agree that void * should probably be named (as new_entry). Naming index and new_order is correct. But again, there's no useful information given by naming root.