mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
To: Uros Bizjak <ubizjak@gmail.com>
Cc: linux-trace-kernel@vger.kernel.org, linux-kernel@vger.kernel.org,
	Steven Rostedt <rostedt@goodmis.org>,
	Masami Hiramatsu <mhiramat@kernel.org>
Subject: Re: [PATCH 1/3] ring_buffer: Change some static functions to void
Date: Wed, 1 Mar 2023 07:55:19 +0900	[thread overview]
Message-ID: <20230301075519.dbf770fed0476e2b6ecdad37@kernel.org> (raw)
In-Reply-To: <20230228175929.7534-2-ubizjak@gmail.com>

On Tue, 28 Feb 2023 18:59:27 +0100
Uros Bizjak <ubizjak@gmail.com> wrote:

> The results of some static functions are not used. Change the
> type of these function to void and remove unnecessary returns.
> 
> No functional change intended.

NAK, instead of dropping the errors, please handle it on the caller side.

Thank you,

> 
> Cc: Steven Rostedt <rostedt@goodmis.org>
> Cc: Masami Hiramatsu <mhiramat@kernel.org>
> Signed-off-by: Uros Bizjak <ubizjak@gmail.com>
> ---
>  kernel/trace/ring_buffer.c | 22 +++++++---------------
>  1 file changed, 7 insertions(+), 15 deletions(-)
> 
> diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c
> index af50d931b020..05fdc92554df 100644
> --- a/kernel/trace/ring_buffer.c
> +++ b/kernel/trace/ring_buffer.c
> @@ -1569,15 +1569,12 @@ static void rb_tail_page_update(struct ring_buffer_per_cpu *cpu_buffer,
>  	}
>  }
>  
> -static int rb_check_bpage(struct ring_buffer_per_cpu *cpu_buffer,
> +static void rb_check_bpage(struct ring_buffer_per_cpu *cpu_buffer,
>  			  struct buffer_page *bpage)
>  {
>  	unsigned long val = (unsigned long)bpage;
>  
> -	if (RB_WARN_ON(cpu_buffer, val & RB_FLAG_MASK))
> -		return 1;
> -
> -	return 0;
> +	RB_WARN_ON(cpu_buffer, val & RB_FLAG_MASK);
>  }
>  
>  /**
> @@ -1587,30 +1584,28 @@ static int rb_check_bpage(struct ring_buffer_per_cpu *cpu_buffer,
>   * As a safety measure we check to make sure the data pages have not
>   * been corrupted.
>   */
> -static int rb_check_pages(struct ring_buffer_per_cpu *cpu_buffer)
> +static void rb_check_pages(struct ring_buffer_per_cpu *cpu_buffer)
>  {
>  	struct list_head *head = rb_list_head(cpu_buffer->pages);
>  	struct list_head *tmp;
>  
>  	if (RB_WARN_ON(cpu_buffer,
>  			rb_list_head(rb_list_head(head->next)->prev) != head))
> -		return -1;
> +		return;
>  
>  	if (RB_WARN_ON(cpu_buffer,
>  			rb_list_head(rb_list_head(head->prev)->next) != head))
> -		return -1;
> +		return;
>  
>  	for (tmp = rb_list_head(head->next); tmp != head; tmp = rb_list_head(tmp->next)) {
>  		if (RB_WARN_ON(cpu_buffer,
>  				rb_list_head(rb_list_head(tmp->next)->prev) != tmp))
> -			return -1;
> +			return;
>  
>  		if (RB_WARN_ON(cpu_buffer,
>  				rb_list_head(rb_list_head(tmp->prev)->next) != tmp))
> -			return -1;
> +			return;
>  	}
> -
> -	return 0;
>  }
>  
>  static int __rb_allocate_pages(struct ring_buffer_per_cpu *cpu_buffer,
> @@ -4500,7 +4495,6 @@ rb_update_read_stamp(struct ring_buffer_per_cpu *cpu_buffer,
>  	default:
>  		RB_WARN_ON(cpu_buffer, 1);
>  	}
> -	return;
>  }
>  
>  static void
> @@ -4531,7 +4525,6 @@ rb_update_iter_read_stamp(struct ring_buffer_iter *iter,
>  	default:
>  		RB_WARN_ON(iter->cpu_buffer, 1);
>  	}
> -	return;
>  }
>  
>  static struct buffer_page *
> @@ -4946,7 +4939,6 @@ rb_reader_unlock(struct ring_buffer_per_cpu *cpu_buffer, bool locked)
>  {
>  	if (likely(locked))
>  		raw_spin_unlock(&cpu_buffer->reader_lock);
> -	return;
>  }
>  
>  /**
> -- 
> 2.39.2
> 


-- 
Masami Hiramatsu (Google) <mhiramat@kernel.org>

  reply	other threads:[~2023-02-28 22:55 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-28 17:59 [PATCH 0/3] Improve trace/ring_buffer.c Uros Bizjak
2023-02-28 17:59 ` [PATCH 1/3] ring_buffer: Change some static functions to void Uros Bizjak
2023-02-28 22:55   ` Masami Hiramatsu [this message]
2023-03-01  8:46     ` Uros Bizjak
2023-03-01 16:34       ` Steven Rostedt
2023-03-02 23:57         ` Masami Hiramatsu
2023-02-28 17:59 ` [PATCH 2/3] ring_buffer: Change some static functions to bool Uros Bizjak
2023-02-28 17:59 ` [PATCH 3/3] ring_buffer: Use try_cmpxchg instead of cmpxchg Uros Bizjak
2023-02-28 21:43   ` Steven Rostedt
2023-03-01  9:37     ` Uros Bizjak
2023-03-01 15:49       ` Joel Fernandes
2023-03-01 15:50         ` Joel Fernandes
2023-03-01 16:18       ` Steven Rostedt
2023-03-01 16:28         ` Steven Rostedt
2023-03-01 17:57           ` Uros Bizjak
2023-03-01 18:08           ` Uros Bizjak
2023-03-01 17:16         ` Uros Bizjak
2023-03-01 18:18           ` Steven Rostedt
2023-03-01 18:28             ` Steven Rostedt
2023-03-01 18:37               ` Uros Bizjak
2023-02-28 19:35 ` [PATCH 0/3] Improve trace/ring_buffer.c Steven Rostedt
2023-03-01  8:35   ` Uros Bizjak

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=20230301075519.dbf770fed0476e2b6ecdad37@kernel.org \
    --to=mhiramat@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=ubizjak@gmail.com \
    /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

Powered by JetHome