Thread (6 messages) 6 messages, 2 authors, 2023-03-02

Re: [PATCH v2 2/3] ring_buffer: Change some static functions to bool

From: Steven Rostedt <rostedt@goodmis.org>
Date: 2023-03-02 17:44:02
Also in: lkml

On Thu,  2 Mar 2023 17:41:28 +0100
Uros Bizjak [off-list ref] wrote:
-static int
+static bool
 rb_insert_pages(struct ring_buffer_per_cpu *cpu_buffer)
 {
 	struct list_head *pages = &cpu_buffer->new_pages;
-	int retries, success;
+	int retries;
 	unsigned long flags;
+	bool success;
Nit, but I prefer to keep the "upside-down xmas-tree" format:

That is, instead of:

  	struct list_head *pages = &cpu_buffer->new_pages;
	int retries;
 	unsigned long flags;
	bool success;

Have

  	struct list_head *pages = &cpu_buffer->new_pages;
 	unsigned long flags;
	bool success;
	int retries;

It's easier to read, and looks cleaner.

-- Steve
 
 	/* Can be called at early boot up, where interrupts must not been enabled */
 	raw_spin_lock_irqsave(&cpu_buffer->reader_lock, flags);
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help