From patchwork Tue Oct 3 19:34:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 148044 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2a8e:b0:403:3b70:6f57 with SMTP id in14csp2308006vqb; Tue, 3 Oct 2023 12:35:33 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEDENj6UI+wfnKUpWhPjK1n0atd6zRzRzUJQuuDArX0deYe8MxnW9zSx467gXA+/An5EtzR X-Received: by 2002:a17:902:db0d:b0:1c7:61a1:9688 with SMTP id m13-20020a170902db0d00b001c761a19688mr713326plx.7.1696361733667; Tue, 03 Oct 2023 12:35:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696361733; cv=none; d=google.com; s=arc-20160816; b=GcxU5Z3/VYSsOFK+GOoxGI8J/dfrrf21vAQcQoy9JB6/jyj5ydUqj/fK1psZleN5I3 XTfsdcIJa329GHa+x0J2nT0yVpQDwcvq3ha4Puz+YkpGtASdxREsVnZUIfasZWT+8oqJ XFG01oVJVk79PfJ2g9JDD+yAlLlBgSjodtqlBU4k54h6dIOqzaIkrCBaKYfyx11LEY4g rREIFTmvFe7EcJTBuu481Yd1cJHEK0MIj5s5l5ysCcgKVH7Zcgurfa//BiN3hcffSIzJ UX367/3uPm292RVMTAgz45SLtekNULRJG3jmJ+0Bku1MmRf8Uo3x8zzX59Jzm1bUzWHQ F2dg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=sMSuIBX68wCUaN9OMC0iJXW11FBBQZmVSrB0umTnwnA=; fh=xN4mgWB/ZZ3A3rD+CV71pGTVB8EMVa7oKU4RLzOuupk=; b=XuOCXlQsL5BEQ/uthcgA4+NvVENnklWoaPsHUBBh7y7S31S6l/x/N35a12G9CVaQ95 /2AsKmyvJ8roA2EXKjBnc+6AsLoWqv6HP2dxP9KqlZXBz817WbIXaiRXdaQ1i5xcSfDg ADfxqUpRKa0CCiErOQaoZ69iSJCmhdIqUKHk0nPVEkQzPxFqZEBZu7jhKDLMwE/MsmA4 sAJ7tb/JwGowCCHU6sVBGs3HU0Zsrjx4OaoQXAXXzHVfjUaoSRUtm6MvvoSOj4BE8eYe gCCeSMyOa1umSkRIijr74xTQpIfjDByfsu2E2Ul7xIU45L/Y1/8o0l/Nrio0SdtLJ8hY f8bg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=kX+EjTk5; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id q13-20020a170902a3cd00b001c60de17b50si1935112plb.182.2023.10.03.12.35.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Oct 2023 12:35:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=kX+EjTk5; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 2AB5A807C5C7; Tue, 3 Oct 2023 12:35:27 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240878AbjJCTfB (ORCPT + 17 others); Tue, 3 Oct 2023 15:35:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43236 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240962AbjJCTe7 (ORCPT ); Tue, 3 Oct 2023 15:34:59 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9AC05BF; Tue, 3 Oct 2023 12:34:56 -0700 (PDT) Date: Tue, 03 Oct 2023 19:34:54 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1696361695; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=sMSuIBX68wCUaN9OMC0iJXW11FBBQZmVSrB0umTnwnA=; b=kX+EjTk5lvv2J8+GRWmzKd/T0sTYU/rHd9Il0MzWQH4JCu23KFdZWICShuTXL0c5G4QZgm zsgNF1YBEXWHV6JJleulLkOuebXcTScPAnZQVuzyVKeKg593YO8Hh1zySahb8NOsJd1Jjg tECnLLlJxnbdrjrBLyE9vZ3HZ0TXNYq4LKtOpnRVsCt/qwOY86H56QSHZGhPa50v4u7E2w C/rschhnluYDdDKGUkz2aFZ7DDmGqrRCIpkwPkNmg/MwO3h/mlAoCt+U1Rr/glSnZNbYl0 o/kbt2UX+LZqHt7an8UIZmj/8qa2x7zjUlQFmpFuHQ48njKHt4RJyZQ00lSTmw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1696361695; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=sMSuIBX68wCUaN9OMC0iJXW11FBBQZmVSrB0umTnwnA=; b=RU3to7Rf32EWwrVEtaqin8qdVuk7WNTMCDNvlA+e/plT06k+aG8as7ilH0dpgsveP4X01n q0mnsScVJoESvNDg== From: "tip-bot2 for David Reaver" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: perf/core] perf/x86/rapl: Fix "Using plain integer as NULL pointer" Sparse warning Cc: David Reaver , Ingo Molnar , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20230801155651.108076-1-me@davidreaver.com> References: <20230801155651.108076-1-me@davidreaver.com> MIME-Version: 1.0 Message-ID: <169636169438.3135.16959912732564389921.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Tue, 03 Oct 2023 12:35:27 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778764201382855455 X-GMAIL-MSGID: 1778764201382855455 The following commit has been merged into the perf/core branch of tip: Commit-ID: 618e77d77494bfd6273256d43eafe4368445c745 Gitweb: https://git.kernel.org/tip/618e77d77494bfd6273256d43eafe4368445c745 Author: David Reaver AuthorDate: Tue, 01 Aug 2023 08:56:51 -07:00 Committer: Ingo Molnar CommitterDate: Tue, 03 Oct 2023 21:25:56 +02:00 perf/x86/rapl: Fix "Using plain integer as NULL pointer" Sparse warning Change 0 to NULL when initializing the test field of perf_msr structs to avoid the following sparse warnings: make C=2 arch/x86/events/rapl.o CHECK arch/x86/events/rapl.c ... arch/x86/events/rapl.c:540:59: warning: Using plain integer as NULL pointer arch/x86/events/rapl.c:542:59: warning: Using plain integer as NULL pointer arch/x86/events/rapl.c:543:59: warning: Using plain integer as NULL pointer arch/x86/events/rapl.c:544:59: warning: Using plain integer as NULL pointer Signed-off-by: David Reaver Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20230801155651.108076-1-me@davidreaver.com --- arch/x86/events/rapl.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/x86/events/rapl.c b/arch/x86/events/rapl.c index 6d3e738..c2c37fb 100644 --- a/arch/x86/events/rapl.c +++ b/arch/x86/events/rapl.c @@ -533,11 +533,11 @@ static struct perf_msr intel_rapl_spr_msrs[] = { * - want to use same event codes across both architectures */ static struct perf_msr amd_rapl_msrs[] = { - [PERF_RAPL_PP0] = { 0, &rapl_events_cores_group, 0, false, 0 }, + [PERF_RAPL_PP0] = { 0, &rapl_events_cores_group, NULL, false, 0 }, [PERF_RAPL_PKG] = { MSR_AMD_PKG_ENERGY_STATUS, &rapl_events_pkg_group, test_msr, false, RAPL_MSR_MASK }, - [PERF_RAPL_RAM] = { 0, &rapl_events_ram_group, 0, false, 0 }, - [PERF_RAPL_PP1] = { 0, &rapl_events_gpu_group, 0, false, 0 }, - [PERF_RAPL_PSYS] = { 0, &rapl_events_psys_group, 0, false, 0 }, + [PERF_RAPL_RAM] = { 0, &rapl_events_ram_group, NULL, false, 0 }, + [PERF_RAPL_PP1] = { 0, &rapl_events_gpu_group, NULL, false, 0 }, + [PERF_RAPL_PSYS] = { 0, &rapl_events_psys_group, NULL, false, 0 }, }; static int rapl_cpu_offline(unsigned int cpu)