From patchwork Tue Feb 28 17:59:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Uros Bizjak X-Patchwork-Id: 13155108 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CAA2BC64ED6 for ; Tue, 28 Feb 2023 18:00:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229571AbjB1SAB (ORCPT ); Tue, 28 Feb 2023 13:00:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43244 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229732AbjB1R77 (ORCPT ); Tue, 28 Feb 2023 12:59:59 -0500 Received: from mail-ed1-x52c.google.com (mail-ed1-x52c.google.com [IPv6:2a00:1450:4864:20::52c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4992732CF8; Tue, 28 Feb 2023 09:59:58 -0800 (PST) Received: by mail-ed1-x52c.google.com with SMTP id s26so43395745edw.11; Tue, 28 Feb 2023 09:59:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=rCbSLcdXBN5AxQderjzc9KOZWeLSCuHpmkG/hHKOcd0=; b=eYsO0tzXVT9DSPdr8vKN3Ghl3EqOSD9x1DTMZRsCOR0FJ4UZKCiYX12kJmceKf3DZf M2OUsQt0PXCsJoET3L6ScIeOjUJVhHAuNuXibClNU3w6LI9xoCwmOvDRoVGQXhMk2ejX 0oRHaekdYj8tFPEfyeN1PicIkmt1VboM/iT3LAQvI5OgmlQzwtgayM9gKc5/Tti7Ejoq EfAr5RI1bbwnobUpTIOIOwIaGqJ+mj8PBcKimw3xO02qU/ZRLIYB49oUETH/VwkE0lBX 9x3lA9gaFY3Ww08G+pYtV7dDUd1TMGtv3/wQBdDIP9ZTmQ+qvU3aANIOCoVe+sUJPDP2 cvFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=rCbSLcdXBN5AxQderjzc9KOZWeLSCuHpmkG/hHKOcd0=; b=Z4xcVJyZdgIEoOCIgsHHSe6qEnoJ0tKq09F1YeidOH+OsHGvd0yuk7EdqLEGcTpeEz sNLlBe5wYb6WC8WbGSRQWoWu+Hbw4SnngcFaKHJUciouKJ1qPYeB7Fi7ccqdoeKtwcb/ W4yWlazUH5XEOM2PDeTKf6i/9za59rJsocvH6eZ00Kgt4BPy9aRGgIiflLnUeZwT7LTv QESV2hMYcdTcZC5ylXhiYAMwoVQA+fgaBDHNIOKauDtnoYZ2ByxVfh5br7OBJjIIbCzA TCFtBLIjVJgczB0srQcSPHo8h9OITRHYdQBbR42mJ1AHmuesu+G1bd5MkId3gKUYefhc dLMA== X-Gm-Message-State: AO0yUKV7S3w1/mC7SVxk71fqNNL3Q6jFJTRRZBvu9HNFHhLBv8RlEzkY QxHCzQhsT9QfR5CGTO9CwiKdCq9FEgUQncDS X-Google-Smtp-Source: AK7set+TlzEl0ATCLJWDp/KAFz9dRaGmYNUb4pLi02Ym0ZQIUjfVADzCEhfcZXrLcuefKzE8w57KAg== X-Received: by 2002:a17:906:24c2:b0:877:a9d2:e5e9 with SMTP id f2-20020a17090624c200b00877a9d2e5e9mr3510567ejb.42.1677607197518; Tue, 28 Feb 2023 09:59:57 -0800 (PST) Received: from localhost.localdomain ([46.248.82.114]) by smtp.gmail.com with ESMTPSA id m5-20020a170906234500b008d9c518a318sm4869725eja.142.2023.02.28.09.59.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Feb 2023 09:59:57 -0800 (PST) From: Uros Bizjak To: linux-trace-kernel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Uros Bizjak , Steven Rostedt , Masami Hiramatsu Subject: [PATCH 1/3] ring_buffer: Change some static functions to void Date: Tue, 28 Feb 2023 18:59:27 +0100 Message-Id: <20230228175929.7534-2-ubizjak@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230228175929.7534-1-ubizjak@gmail.com> References: <20230228175929.7534-1-ubizjak@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-trace-kernel@vger.kernel.org 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. Cc: Steven Rostedt Cc: Masami Hiramatsu Signed-off-by: Uros Bizjak Reviewed-by: Masami Hiramatsu (Google) --- 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; } /**