Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1560941
| Path | csiph.com!eternal-september.org!feeder.eternal-september.org!aioe.org!news.servidellagleba.it!bofh.it!news.nic.it!robomod |
|---|---|
| From | Thomas Gleixner <tglx@linutronix.de> |
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 03/13] x86/microcode/AMD: Clean up find_equiv_id() |
| Date | Tue, 17 Jan 2017 20:10:02 +0100 |
| Message-ID | <t0HiO-2uu-31@gated-at.bofh.it> (permalink) |
| References | <t0FTI-1vq-27@gated-at.bofh.it> <t0G3o-1zz-25@gated-at.bofh.it> <t0Gd4-1D8-33@gated-at.bofh.it> <t0GZr-295-13@gated-at.bofh.it> |
| User-Agent | Alpine 2.20 (DEB 67 2015-01-07) |
| MIME-Version | 1.0 |
| Content-Type | text/plain; charset=US-ASCII |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 35 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | X86 ML <x86@kernel.org>, LKML <linux-kernel@vger.kernel.org> |
| X-Original-Date | Tue, 17 Jan 2017 20:02:59 +0100 (CET) |
| X-Original-Message-ID | <alpine.DEB.2.20.1701171956290.3645@nanos> |
| X-Original-References | <20170117173734.14251-1-bp@alien8.de> <20170117173734.14251-4-bp@alien8.de> <alpine.DEB.2.20.1701171851310.3495@nanos> <20170117184927.fecw3m6cm6rb3p3j@pd.tnic> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1560941 |
Show key headers only | View raw
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
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 03/13] x86/microcode/AMD: Clean up find_equiv_id() Borislav Petkov <bp@alien8.de> - 2017-01-17 18:50 +0100
Re: [PATCH 03/13] x86/microcode/AMD: Clean up find_equiv_id() Thomas Gleixner <tglx@linutronix.de> - 2017-01-17 19:00 +0100
Re: [PATCH 03/13] x86/microcode/AMD: Clean up find_equiv_id() Borislav Petkov <bp@alien8.de> - 2017-01-17 19:50 +0100
Re: [PATCH 03/13] x86/microcode/AMD: Clean up find_equiv_id() Thomas Gleixner <tglx@linutronix.de> - 2017-01-17 20:10 +0100
Re: [PATCH 03/13] x86/microcode/AMD: Clean up find_equiv_id() Borislav Petkov <bp@alien8.de> - 2017-01-18 00:20 +0100
csiph-web