Thread (8 messages) 8 messages, 5 authors, 2021-07-08

Re: [PATCH V7 01/18] perf/core: Use static_call to optimize perf_guest_info_callbacks

From: Joe Perches <joe@perches.com>
Date: 2021-07-02 16:42:38
Also in: kvm, kvmarm, linux-riscv, lkml, xen-devel

Possibly related (same subject, not in this thread)

On Fri, 2021-07-02 at 18:19 +0200, Peter Zijlstra wrote:
On Fri, Jul 02, 2021 at 09:00:22AM -0700, Joe Perches wrote:
quoted
On Fri, 2021-07-02 at 13:22 +0200, Peter Zijlstra wrote:
quoted
On Tue, Jun 22, 2021 at 05:42:49PM +0800, Zhu Lingshan wrote:
quoted
diff --git a/arch/x86/events/core.c b/arch/x86/events/core.c
[]
quoted
quoted
+	if (perf_guest_cbs && perf_guest_cbs->handle_intel_pt_intr)
+		static_call_update(x86_guest_handle_intel_pt_intr,
+				   perf_guest_cbs->handle_intel_pt_intr);
+}
Coding style wants { } on that last if().
That's just your personal preference.
As a maintainer, those carry weight, also that's tip rules:

  https://lore.kernel.org/lkml/20181107171149.165693799@linutronix.de/ (local)
Right, definitely so.

But merely referencing 'coding style' is ambiguous at best.

btw:

ASCII commonly refers to '{' and '}', the curly brackets, to be braces
and '[' and ']', the square brackets, to be brackets.

It might be clearer to use that terminology.

belts and braces, etc...

cheers, Joe

----------------

+Bracket rules
+^^^^^^^^^^^^^
+
+Brackets should be omitted only if the statement which follows 'if', 'for',
+'while' etc. is truly a single line::
+
+	if (foo)
+		do_something();
+
+The following is not considered to be a single line statement even
+though C does not require brackets::
+
+	for (i = 0; i < end; i++)
+		if (foo[i])
+			do_something(foo[i]);
+
+Adding brackets around the outer loop enhances the reading flow::
+
+	for (i = 0; i < end; i++) {
+		if (foo[i])
+			do_something(foo[i]);
+	}



_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help