From patchwork Tue Sep 29 10:58:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 263128 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=unavailable 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 A97EBC4741F for ; Tue, 29 Sep 2020 12:04:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5641C2074B for ; Tue, 29 Sep 2020 12:04:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601381075; bh=30aueBxnLewts4sm1SeRzuk0NwIdhEbuLDPo3L7enzg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=GJ0BFmgxnV0pczOhf06WeBmVCXkICSWnqRvBXMGzkXJI5Srkdt45jyHT9guIXPIBW eiqkmYaWXc0IzKqGTwFrBq8iNqVzKa0kHMD1qt8m9qhI0rh04sUbrnVo31kOGb2Jxp CpuAvG5t7WkTmNtWo93pXWLk5XMuywC2qH67wrKw= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731744AbgI2MER (ORCPT ); Tue, 29 Sep 2020 08:04:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:58806 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730312AbgI2Lhu (ORCPT ); Tue, 29 Sep 2020 07:37:50 -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 BFEBA206E5; Tue, 29 Sep 2020 11:37:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601379470; bh=30aueBxnLewts4sm1SeRzuk0NwIdhEbuLDPo3L7enzg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sXouKY5S2niotCguDVPzw8zVCKdU0HwGmbxza7qI1jI4PsZ8MRTB2jXv0ch+1CvII UGF+mAR1fFVyxO4jCI6Tcf+fUVQfaynmK8PxrNydiwNRDRPc4TNsVU/2yQiGsTn14w 8/bpPouIL1/wUUYimvGKilciMfyYhfoAgvuWa9p4= 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 5.4 177/388] tracing: Use address-of operator on section symbols Date: Tue, 29 Sep 2020 12:58:28 +0200 Message-Id: <20200929110019.053622499@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200929110010.467764689@linuxfoundation.org> References: <20200929110010.467764689@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@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 9007f5edbb207..db8162b34ef64 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c @@ -9146,7 +9146,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();