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=-18.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT 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 4CD3EC4727C for ; Tue, 29 Sep 2020 11:04:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0719A21941 for ; Tue, 29 Sep 2020 11:04:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601377472; bh=zmCezSv8mK+yb4xuSGtAO17x+Idcop8nimvbwBBa0Lo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=LLUVN2s6QZO/YGQKXvHXhLf4lhhS8gmKiz7/RlEMMTIjS6nWy4/gzp26lDq+OAeqC AmuOR9BWpQDhUWBXVS8J7JXFPLvU447EhtFleQFpvrxKkLqZ9zxC7SQllSZAhATxev VrnbBwuz0RN8E3xk0NI8g/KvS6NTCJOu8kijr7SE= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728620AbgI2LEa (ORCPT ); Tue, 29 Sep 2020 07:04:30 -0400 Received: from mail.kernel.org ([198.145.29.99]:40458 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728586AbgI2LEV (ORCPT ); Tue, 29 Sep 2020 07:04:21 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (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 DD87920C09; Tue, 29 Sep 2020 11:04:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601377460; bh=zmCezSv8mK+yb4xuSGtAO17x+Idcop8nimvbwBBa0Lo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YugSKQyI63fWC5kBp5UlfPCKtQ5MedCooLv1pxUrpERYJcpqGQQPbePhFaMs6vaDF dAo9yL16qU+MKMeGGtAbKQWR7DAo1h+v7+ArCQmZwziLWiHMhYuBc7kqCC7ZZq98eU qn9R0CICi4rtIydSRxN1y8nesK1J95DhwqFDhknA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Nick Desaulniers , Nathan Chancellor , "Steven Rostedt (VMware)" , Sasha Levin Subject: [PATCH 4.4 44/85] tracing: Use address-of operator on section symbols Date: Tue, 29 Sep 2020 13:00:11 +0200 Message-Id: <20200929105930.436488959@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200929105928.198942536@linuxfoundation.org> References: <20200929105928.198942536@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Nathan Chancellor [ Upstream commit bf2cbe044da275021b2de5917240411a19e5c50d ] 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. Using the address of operator silences the warning and does not change the runtime result of the check (tested with some print statements compiled in with clang + ld.lld and gcc + ld.bfd in QEMU). Link: http://lkml.kernel.org/r/20200220051011.26113-1-natechancellor@gmail.com Link: https://github.com/ClangBuiltLinux/linux/issues/893 Suggested-by: Nick Desaulniers Signed-off-by: Nathan Chancellor Signed-off-by: Steven Rostedt (VMware) Signed-off-by: Sasha Levin --- 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 17ea5f9d36b48..e4a0c0308b507 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c @@ -7263,7 +7263,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 (&__stop___trace_bprintk_fmt != &__start___trace_bprintk_fmt) /* Must be called before global_trace.buffer is allocated */ trace_printk_init_buffers(); -- 2.25.1