Thread (12 messages) flat view 12 messages, 4 authors, 2019-06-18

Re: [PATCH v1 1/6] mm: Section numbers use the type "unsigned long"

From: Michael Ellerman <mpe@ellerman.id.au>
Date: 2019-06-18 12:17:27
Also in: linux-acpi, linux-mm, lkml

Andrew Morton [off-list ref] writes:
On Sat, 15 Jun 2019 10:06:54 +0200 Christophe Leroy [off-list ref] wrote:
quoted
Le 14/06/2019 à 21:00, Andrew Morton a écrit :
quoted
On Fri, 14 Jun 2019 12:01:09 +0200 David Hildenbrand [off-list ref] wrote:
quoted
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 = 0;
+	unsigned long i;

...

-	unsigned int i;
+	unsigned long i;
Maybe I did too much fortran back in the day, but I think the
expectation is that a variable called "i" has type "int".
...
quoted
Codying style says the following, which makes full sense in my opinion:

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.
I always thought `i` was for loop `index` not `integer`.

But I've never written any Fortran :)

cheers
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help