From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_2 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EBB48C34051 for ; Wed, 19 Feb 2020 14:34:50 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id B81AF2465D for ; Wed, 19 Feb 2020 14:34:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B81AF2465D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=goodmis.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 56CC36B0006; Wed, 19 Feb 2020 09:34:50 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 51DE36B0007; Wed, 19 Feb 2020 09:34:50 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4334D6B0008; Wed, 19 Feb 2020 09:34:50 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0099.hostedemail.com [216.40.44.99]) by kanga.kvack.org (Postfix) with ESMTP id 2D3546B0006 for ; Wed, 19 Feb 2020 09:34:50 -0500 (EST) Received: from smtpin12.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id CB2CF180AD817 for ; Wed, 19 Feb 2020 14:34:49 +0000 (UTC) X-FDA: 76507123098.12.hill99_816de814f1545 X-HE-Tag: hill99_816de814f1545 X-Filterd-Recvd-Size: 3146 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf24.hostedemail.com (Postfix) with ESMTP for ; Wed, 19 Feb 2020 14:34:49 +0000 (UTC) Received: from gandalf.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5D62C24656; Wed, 19 Feb 2020 14:34:47 +0000 (UTC) Date: Wed, 19 Feb 2020 09:34:45 -0500 From: Steven Rostedt To: Nathan Chancellor Cc: Masahiro Yamada , Michal Marek , Arnd Bergmann , Ingo Molnar , Jason Baron , Catalin Marinas , Andrew Morton , linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org, linux-arch@vger.kernel.org, linux-mm@kvack.org, clang-built-linux@googlegroups.com Subject: Re: [PATCH 3/6] tracing: Wrap section comparison in tracer_alloc_buffers with COMPARE_SECTIONS Message-ID: <20200219093445.386f1c09@gandalf.local.home> In-Reply-To: <20200219045423.54190-4-natechancellor@gmail.com> References: <20200219045423.54190-1-natechancellor@gmail.com> <20200219045423.54190-4-natechancellor@gmail.com> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Tue, 18 Feb 2020 21:54:20 -0700 Nathan Chancellor wrote: > Clang warns: > > ../kernel/trace/trace.c:9335:33: warning: array comparison always > evaluates to true [-Wtautological-compare] > if (__stop___trace_bprintk_fmt != __start___trace_bprintk_fmt) > ^ > 1 warning generated. > > These are not true arrays, they are linker defined symbols, which are > just addresses so there is not a real issue here. Use the > COMPARE_SECTIONS macro to silence this warning by casting the linker > defined symbols to unsigned long, which keeps the logic the same. > > Link: https://github.com/ClangBuiltLinux/linux/issues/765 > Signed-off-by: Nathan Chancellor > --- > kernel/trace/trace.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c > index c797a15a1fc7..e1f3b16e457b 100644 > --- a/kernel/trace/trace.c > +++ b/kernel/trace/trace.c > @@ -9332,7 +9332,7 @@ __init static int tracer_alloc_buffers(void) > goto out_free_buffer_mask; > > /* Only allocate trace_printk buffers if a trace_printk exists */ > - if (__stop___trace_bprintk_fmt != __start___trace_bprintk_fmt) > + if (COMPARE_SECTIONS(__stop___trace_bprintk_fmt, !=, __start___trace_bprintk_fmt)) Sorry, but this is really ugly and unreadable. Please find some other solution to fix this. NAK-by: Steven Rostedt -- Steve > /* Must be called before global_trace.buffer is allocated */ > trace_printk_init_buffers(); >