Re: Linux kernel, possible useless continue
- From: Rainer Weikusat <rainer.weikusat@xxxxxxxxx>
- Date: Tue, 20 Mar 2007 13:29:33 +0100
"Bin Chen" <binary.chen@xxxxxxxxx> writes:
Rainer Weikusat <rainer.weiku...@xxxxxxxxx> wrote:
[...]
pgd = pgd_base + pgd_index(PAGE_OFFSET);
pgd_end = pgd_base + PTRS_PER_PGD;
pfn = 0;
do {
pmd = one_md_table_init(pgd);
pmd_end = pmd + PTRS_PER_PMD;
do {
/* pte_t init code */
} while (pfn < max_low_pfn && ++pmd < pmd_end);
} while (++pgd < pgd_end && pfn < max_low_pfn);
while (pgd < pgd_end) one_md_table_init(pgd++);
OTOH, that would trigger several political correctness alerts ...
So in conclusion, the author's purpose is still to avoid another
indention?
The author's intention was likely to express the algorithm given above
with some accidental contortion (like incrementing pointers and
counters or unifiying two 'semantically different' loops into one loop
whose effective body changes at runtime).
That you and the entity calling itself Ulrich Eckhardt apparently
believe that a different algorithm would be translated into
a) identical machine code
b) identical machine code plus some superfluous instructions
c) better machine code
d) anything somebody else may come up with
is not relevant at the source code level. That's why it is called
_source code_, ie something supposed to contain a high-level
description of what is supposed to happen, which a compiler can peruse
to generate some machine code with (hopefully) the desired effect.
Independently of your's and Mr Eckhardt's (unsubstantiated) beliefs
about compilers, source code should not contain noise statements,
because they will confuse an eventual reader.
Always a nice quote in this respect:
A program is a sort of publication. It's meant to be read by
the programmer, another programmer (perhaps yourself a few
days, weeks or years later), and lastly a machine. The
machine doesn't care how pretty the program is - if the
program compiles, the machine's happy - but people do, and
they should.
<URL:http://www.lysator.liu.se/c/pikestyle.html>
.
- Follow-Ups:
- Re: Linux kernel, possible useless continue
- From: Ulrich Eckhardt
- Re: Linux kernel, possible useless continue
- References:
- Linux kernel, possible useless continue
- From: Bin Chen
- Re: Linux kernel, possible useless continue
- From: Ulrich Eckhardt
- Re: Linux kernel, possible useless continue
- From: Iwo Mergler
- Re: Linux kernel, possible useless continue
- From: Rainer Weikusat
- Re: Linux kernel, possible useless continue
- From: Bin Chen
- Linux kernel, possible useless continue
- Prev by Date: Re: Linux kernel, possible useless continue
- Next by Date: Re: Linux kernel, possible useless continue
- Previous by thread: Re: Linux kernel, possible useless continue
- Next by thread: Re: Linux kernel, possible useless continue
- Index(es):
Relevant Pages
|