[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.20.1701171956290.3645@nanos>
Date: Tue, 17 Jan 2017 20:02:59 +0100 (CET)
From: Thomas Gleixner <tglx@...utronix.de>
To: Borislav Petkov <bp@...en8.de>
cc: X86 ML <x86@...nel.org>, LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 03/13] x86/microcode/AMD: Clean up find_equiv_id()
On Tue, 17 Jan 2017, Borislav Petkov wrote:
> + for (; equiv_table && equiv_table->installed_cpu; equiv_table++)
> + if (sig == equiv_table->installed_cpu)
> + return equiv_table->equiv_cpu;
This would be perfect if you just kept the braces around the for loop.
for (; cond; incr)
do_something();
parses perfectly fine as it matches the expectation of a single line statement
following the for().
for (; cond; incr)
if (othercond)
do_something();
not so much because we expect a single line statement due to the lack of a
opening brace after the for()
for (; cond; incr) {
if (othercond)
do_something();
}
That's how it parses best. The opening brace after the for() tells us: here
comes a multiline statement. And the inner if (othercond) w/o the opening
brace tells: here comes a single line statement.
Reading code/patches very much depends on patterns and structuring. If they
are consistent the reading flow is undisturbed.
Thanks,
tglx
Powered by blists - more mailing lists