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=-20.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED 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 A8F79C4338F for ; Sun, 22 Aug 2021 07:26:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 84C9860F8F for ; Sun, 22 Aug 2021 07:26:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231345AbhHVH0f (ORCPT ); Sun, 22 Aug 2021 03:26:35 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:33328 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229934AbhHVH0e (ORCPT ); Sun, 22 Aug 2021 03:26:34 -0400 Date: Sun, 22 Aug 2021 07:25:50 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1629617152; 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=BDaJ8gq1y2CCb9HbdovkJsuoTT2Ott+UnFGCWMcbZ1s=; b=j8J2xDUjqMbDZ8tLD4Ns7KzQnGOC6+VfXjaJpfd5g26eM66Cu75J7Wzn5aBzcoRKIr3CZw qHrZrUBI10rNNesoqjvvknfdjL6nh1NxGsFWcO+T2KS676JEH/mtnn/pT3zJtc/zhkVN5H mMEjdQ+BQ3zqfWyIqdB7JWkeFGoctRxRTBYVDsKNf3tLMHNouvIQ5FcjpB18u8najg+jUW utdBJ1mfmBNy2zEoOj0BFALFXKf/MWjotDth4cGZ/UFIeHqaoEMqWPcxwUoDosrXGTQkJg 3QKotZ8uGNPCkQ2TwzuUOfm9BCiDBlRn4uY5ftnEcleyx21RbhdDt7+E789LqQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1629617152; 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=BDaJ8gq1y2CCb9HbdovkJsuoTT2Ott+UnFGCWMcbZ1s=; b=2mJQQJ9rWYEBE+ORbmghjg6TfLrGLBac0hveQpFvheUL0Pu7xehOS/xacJbwGUSZ+GknMY +xk8xA070kmmhmBg== From: "tip-bot2 for Babu Moger" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/urgent] x86/resctrl: Fix a maybe-uninitialized build warning treated as error Cc: Terry Bowman , kernel test robot , Babu Moger , Borislav Petkov , Reinette Chatre , stable@vger.kernel.org, x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <162949631908.23903.17090272726012848523.stgit@bmoger-ubuntu> References: <162949631908.23903.17090272726012848523.stgit@bmoger-ubuntu> MIME-Version: 1.0 Message-ID: <162961715100.25758.14486039318102865041.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the x86/urgent branch of tip: Commit-ID: 527f721478bce3f49b513a733bacd19d6f34b08c Gitweb: https://git.kernel.org/tip/527f721478bce3f49b513a733bacd19d6f3= 4b08c Author: Babu Moger AuthorDate: Fri, 20 Aug 2021 16:52:42 -05:00 Committer: Borislav Petkov CommitterDate: Sun, 22 Aug 2021 09:11:29 +02:00 x86/resctrl: Fix a maybe-uninitialized build warning treated as error The recent commit 064855a69003 ("x86/resctrl: Fix default monitoring groups reporting") caused a RHEL build failure with an uninitialized variable warning treated as an error because it removed the default case snippet. The RHEL Makefile uses '-Werror=3Dmaybe-uninitialized' to force possibly uninitialized variable warnings to be treated as errors. This is also reported by smatch via the 0day robot. The error from the RHEL build is: arch/x86/kernel/cpu/resctrl/monitor.c: In function =E2=80=98__mon_event_cou= nt=E2=80=99: arch/x86/kernel/cpu/resctrl/monitor.c:261:12: error: =E2=80=98m=E2=80=99 ma= y be used uninitialized in this function [-Werror=3Dmaybe-uninitialized] m->chunks +=3D chunks; ^~ The upstream Makefile does not build using '-Werror=3Dmaybe-uninitialized'. So, the problem is not seen there. Fix the problem by putting back the default case snippet. [ bp: note that there's nothing wrong with the code and other compilers do not trigger this warning - this is being done just so the RHEL compiler is happy. ] Fixes: 064855a69003 ("x86/resctrl: Fix default monitoring groups reporting") Reported-by: Terry Bowman Reported-by: kernel test robot Signed-off-by: Babu Moger Signed-off-by: Borislav Petkov Reviewed-by: Reinette Chatre Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/r/162949631908.23903.17090272726012848523.stgit= @bmoger-ubuntu --- arch/x86/kernel/cpu/resctrl/monitor.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arch/x86/kernel/cpu/resctrl/monitor.c b/arch/x86/kernel/cpu/resc= trl/monitor.c index 57e4bb6..8caf871 100644 --- a/arch/x86/kernel/cpu/resctrl/monitor.c +++ b/arch/x86/kernel/cpu/resctrl/monitor.c @@ -304,6 +304,12 @@ static u64 __mon_event_count(u32 rmid, struct rmid_read = *rr) case QOS_L3_MBM_LOCAL_EVENT_ID: m =3D &rr->d->mbm_local[rmid]; break; + default: + /* + * Code would never reach here because an invalid + * event id would fail the __rmid_read. + */ + return RMID_VAL_ERROR; } =20 if (rr->first) {