From: Thomas Gleixner <tglx@linutronix.de>
To: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Ingo Molnar <mingo@kernel.org>,
x86@kernel.org, linux-kernel@vger.kernel.org,
Steven Rostedt <rostedt@goodmis.org>,
Linus Torvalds <torvalds@linux-foundation.org>,
Peter Zijlstra <peterz@infradead.org>,
Jason Baron <jbaron@akamai.com>, Borislav Petkov <bp@suse.de>
Subject: Re: [PATCH v2 1/2] jump_label: Explicitly disable jump labels in __init code
Date: Sat, 17 Feb 2018 21:13:06 +0100 (CET) [thread overview]
Message-ID: <alpine.DEB.2.21.1802172108240.2087@nanos.tec.linutronix.de> (raw)
In-Reply-To: <20180217134035.67jzcc5rwtyyufix@treble>
On Sat, 17 Feb 2018, Josh Poimboeuf wrote:
> On Sat, Feb 17, 2018 at 11:38:48AM +0100, Ingo Molnar wrote:
> >
> > * Josh Poimboeuf <jpoimboe@redhat.com> wrote:
> >
> > > +/* Disable any jump label entries in __init code */
> > > +void __init jump_label_invalidate_init(void)
> > > +{
> > > + struct jump_entry *iter_start = __start___jump_table;
> > > + struct jump_entry *iter_stop = __stop___jump_table;
> > > + struct jump_entry *iter;
> > > +
> > > + for (iter = iter_start; iter < iter_stop; iter++)
> > > + if (iter->code >= (unsigned long)_sinittext &&
> > > + iter->code < (unsigned long)_einittext)
> > > + iter->code = 0;
> > > +}
> > > +
> > > +/* Disable any jump label entries in module init code */
> > > static void jump_label_invalidate_module_init(struct module *mod)
> > > {
> > > struct jump_entry *iter_start = mod->jump_entries;
> > > struct jump_entry *iter_stop = iter_start + mod->num_jump_entries;
> > > struct jump_entry *iter;
> > >
> > > - for (iter = iter_start; iter < iter_stop; iter++) {
> > > + for (iter = iter_start; iter < iter_stop; iter++)
> > > if (within_module_init(iter->code, mod))
> > > iter->code = 0;
> > > - }
> >
> > Why did you remove the curly braces? They are canonical kernel style for
> > multi-line statements.
>
> Personally I prefer the more compact version, but I have no problem
> changing it.
Yes, it's certainly a matter of taste. Here is the reason why myself and
others prefer the version with braces:
https://marc.info/?l=linux-kernel&m=148467980905537&w=2
Thanks,
tglx
next prev parent reply other threads:[~2018-02-17 20:13 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-16 16:31 [PATCH v2 0/2] jump_label: Robustify jump label patching Josh Poimboeuf
2018-02-16 16:31 ` [PATCH v2 1/2] jump_label: Explicitly disable jump labels in __init code Josh Poimboeuf
2018-02-16 16:55 ` Jason Baron
2018-02-16 17:57 ` [PATCH] extable: Make init_kernel_text() global Josh Poimboeuf
2018-02-16 18:03 ` Steven Rostedt
2018-02-17 10:38 ` [PATCH v2 1/2] jump_label: Explicitly disable jump labels in __init code Ingo Molnar
2018-02-17 13:40 ` Josh Poimboeuf
2018-02-17 20:13 ` Thomas Gleixner [this message]
2018-02-18 13:05 ` Ingo Molnar
2018-02-18 13:15 ` Ingo Molnar
2018-02-16 16:31 ` [PATCH v2 2/2] jump_label: Warn on failed jump_label patch Josh Poimboeuf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=alpine.DEB.2.21.1802172108240.2087@nanos.tec.linutronix.de \
--to=tglx@linutronix.de \
--cc=bp@suse.de \
--cc=jbaron@akamai.com \
--cc=jpoimboe@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=torvalds@linux-foundation.org \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®