Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp3198448ybi; Mon, 17 Jun 2019 18:59:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqwh1ham7BaZkl1vjeF8vxS6pAWNoTHI3EWaM9EQpaivQw3/lf2ShMefa037f1977OOQGQ8g X-Received: by 2002:a63:e018:: with SMTP id e24mr312222pgh.361.1560823150073; Mon, 17 Jun 2019 18:59:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560823150; cv=none; d=google.com; s=arc-20160816; b=yYHCqqjyeT5yTgoOetm/FLuoOdzy5nc3Rx/Aoz/v5ckTG7nsl69jXtsgKpXtEVsuG2 CabR9JPDJGRq0H+2BfY2z7vmQgnvx8froWcOWY2Ow8gCmtal+sQ8l0hgJfypDpCst+BA d5GPvad6ad7KYsAVwGgMdvxyw//a/wD9II8ZbS30AGFaaLfsT+VJbrLXlwslHkave92r vD8uTln4WjgWWy+BXA/rLn2f8CuS7vfjnjSiyHRDWPqCZvWrckiIQR+ouVMuCdtO7Quv rL0/AirdM7pEwumTIIsD+9WqsDWsOQhy4YQ6C7s5SgpLCa9bGyPzAqRWvlz+C4z4VGsJ 2Y1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=VTUp3lJXWg+ihQkx1C1dvmpL8lCmz0McBGzG7Q2Bhhc=; b=q14a1h2ysdOIaX9D83smcl+u6i+XjzkUgNZSbRAEruzqpS5N4j/FIprONOqlPQJ996 60bUu+Hsp5Dhiibke9IkRVQ8SiYyx+DyhYYAhTkwtBwR87bI430hjdqlGKuToACASRzm IRyqhcn3OifxpDqKj1lM6venY1izPVOzA8UTmu3rvxGTNLPCEmipLhJMzS6v1ZK8JtDL TYwqK7jq8EmOU7tOfurtDtia3X+ZJ7FoK+BPOk79i24DfE2RojkN7ZDIa0ECC6j8WxIo lU4PpWnu8h5n+2szIZPtK00rVp35gngJ3wSptH85/m5ubXjHWLrNKKelGvLow4aEri7c zvWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=OE+Xgpgt; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u6si12915723pga.360.2019.06.17.18.58.54; Mon, 17 Jun 2019 18:59:10 -0700 (PDT) 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=@kernel.org header.s=default header.b=OE+Xgpgt; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726834AbfFRB6A (ORCPT + 99 others); Mon, 17 Jun 2019 21:58:00 -0400 Received: from mail.kernel.org ([198.145.29.99]:34356 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726047AbfFRB57 (ORCPT ); Mon, 17 Jun 2019 21:57:59 -0400 Received: from localhost.localdomain (c-73-223-200-170.hsd1.ca.comcast.net [73.223.200.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 52D602080C; Tue, 18 Jun 2019 01:57:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1560823079; bh=8eJzG0QkG+7iwVlI/t7yW6Fig5RNCmwWmykPQq2nGgA=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=OE+XgpgtZhH0f75UQlTQL3rSRdRRP05S+vKJvMay+8BmyMAjkXZLwJC6z89WkLyWv 6xTZtwGGzs/c3VHzQzw94somd65KvS6zN7TbnwRgUQ+WTFBiYdGcHlHPlJeDB/vFEn R7E5dmgyl20XVW7R8vwXalARxFtvIQNepfCrhC/4= Date: Mon, 17 Jun 2019 18:57:57 -0700 From: Andrew Morton To: Christophe Leroy Cc: David Hildenbrand , Stephen Rothwell , Michal Hocko , Mel Gorman , Baoquan He , linux-mm@kvack.org, Greg Kroah-Hartman , "Rafael J. Wysocki" , linux-kernel@vger.kernel.org, Wei Yang , linux-acpi@vger.kernel.org, Mike Rapoport , Arun KS , Johannes Weiner , Pavel Tatashin , Dan Williams , linuxppc-dev@lists.ozlabs.org, Vlastimil Babka , Oscar Salvador Subject: Re: [PATCH v1 1/6] mm: Section numbers use the type "unsigned long" Message-Id: <20190617185757.b57402b465caff0cf6f85320@linux-foundation.org> In-Reply-To: <701e8feb-cbf8-04c1-758c-046da9394ac1@c-s.fr> References: <20190614100114.311-1-david@redhat.com> <20190614100114.311-2-david@redhat.com> <20190614120036.00ae392e3f210e7bc9ec6960@linux-foundation.org> <701e8feb-cbf8-04c1-758c-046da9394ac1@c-s.fr> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 15 Jun 2019 10:06:54 +0200 Christophe Leroy wrote: >=20 >=20 > Le 14/06/2019 =E0 21:00, Andrew Morton a =E9crit=A0: > > On Fri, 14 Jun 2019 12:01:09 +0200 David Hildenbrand = wrote: > >=20 > >> We are using a mixture of "int" and "unsigned long". Let's make this > >> consistent by using "unsigned long" everywhere. We'll do the same with > >> memory block ids next. > >> > >> ... > >> > >> - int i, ret, section_count =3D 0; > >> + unsigned long i; > >> > >> ... > >> > >> - unsigned int i; > >> + unsigned long i; > >=20 > > Maybe I did too much fortran back in the day, but I think the > > expectation is that a variable called "i" has type "int". > >=20 > > This? > >=20 > >=20 > >=20 > > s/unsigned long i/unsigned long section_nr/ >=20 > From my point of view you degrade readability by doing that. >=20 > section_nr_to_pfn(mem->start_section_nr + section_nr); >=20 > Three times the word 'section_nr' in one line, is that worth it ? Gives=20 > me headache. >=20 > Codying style says the following, which makes full sense in my opinion: >=20 > LOCAL variable names should be short, and to the point. If you have > some random integer loop counter, it should probably be called ``i``. > Calling it ``loop_counter`` is non-productive, if there is no chance of it > being mis-understood. Well. It did say "integer". Calling an unsigned long `i' is flat out misleading. > What about just naming it 'nr' if we want to use something else than 'i' ? Sure, that works.