From patchwork Wed Jan 24 23:50:26 2024 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: 191794 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2553:b0:103:945f:af90 with SMTP id p19csp1319001dyi; Wed, 24 Jan 2024 15:50:50 -0800 (PST) X-Google-Smtp-Source: AGHT+IGJlGeZ1Bo+g2qobGAJ8h2WeprhQa6LKiuKIv4AS1tbwyQZbUMylcd/6diaop9/tSa8Zem5 X-Received: by 2002:a05:620a:4626:b0:783:527a:f12a with SMTP id br38-20020a05620a462600b00783527af12amr242648qkb.82.1706140250144; Wed, 24 Jan 2024 15:50:50 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706140250; cv=pass; d=google.com; s=arc-20160816; b=g1aJ0fvBHucq27fIlpGPIhYwPLtCqMhBejX894kkJFBA0F7K0NIejRmcJyaPNftCuk BxKzsbHPNpZq+Zt8FRnCtXbSIU+BFu3zzDs92SyOItdKp1pqvh+26VyBJ3iV1Wcd/eVA 0cIEhCO/VcecZ00n1ovoP4I2c+Zfo0QXom3AKiWTq36rq9eT131SdJYYxDcLLF0RSU6p Ygww7y5LELPkXcPh3yM1oYHAeizSPBj7yP2dpz0aiSAa3nBavY0ltOBlhGb4sIWEmoom roqJ+eTV5M68+uBumNK7/olGp2I86ZIVQjMU84v6p1XrvbYWw0ygxsNyNOHlF8HaQecY 4W/w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:precedence:robot-unsubscribe:robot-id :message-id:mime-version:list-unsubscribe:list-subscribe:list-id :precedence:references:in-reply-to:cc:subject:to:reply-to:sender :from:dkim-signature:dkim-signature:date; bh=Nqtun/gfSuSGqOJXigUbaoDPBPqs2SxC2sefNXP0Rlg=; fh=W6OSK78krXv3XkExO6INir3e3t0tdUkgG7xzLCBnCQM=; b=rbFAZJkztxzd0F0d251lAF+AFmCwNOFIgXe6yGx7P+2I5OAVELJhCkHJ4QfMVgHxT1 bVw4pUxVWEmL1angE3e73xezpPsjMMviBQvUFw5vS8kx3aBcCtjY46DLrDMfbJNiaPnE zkBFoUSJNKFMXEDrGPBMBe9TErOZnXdXJqF4hePmHlTFMbaKWXhsvndO/uHhuM49v0uZ 4kvZnrt6k86flL9snBEZ8+k4BN6aS2KuWrwCy/5yILLehkvy5/zagE/6YKu6Mq0QijoP hkx34DUR8pKLZI8HOXbtKrYdHLEvtJacyRDvUmeHOWzLYEuciJjMrrbYRIQ34sbZ5xCz Uo1Q== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=DTKytzZm; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-37807-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-37807-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id wg12-20020a05620a568c00b007812e5a9151si11346267qkn.549.2024.01.24.15.50.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jan 2024 15:50:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-37807-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=DTKytzZm; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-37807-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-37807-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id EAE981C2246F for ; Wed, 24 Jan 2024 23:50:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 13F2E137C20; Wed, 24 Jan 2024 23:50:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="DTKytzZm"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="UImZUpaa" Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 70A64135407; Wed, 24 Jan 2024 23:50:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706140233; cv=none; b=WChWUqMEQgK8rxThY1Ms620Vj199U4+ix+BNlMhB3Uc618O8Of/dySLBZgbTV5KcWaZACY7a9ds2XaILFuU86OQGBmw+4x2fdxSNIL1wb4jrhHg+59C2Jw/nn+YxKFGXhLLzBj7fI4eF210lMLlDAOfwX6AJF7SJ20H+9HqCSoY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706140233; c=relaxed/simple; bh=28oyuCWqOzuiUre2BYd/XpqNp2z9rDAea2r+BqtLB6U=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=b1PQVsFwUhpl/WRYmIy8IDoFpMOqvYRBomRjsk53q/ZahquQayQrvJsyv4whU2zHF85j+2rbXFxgG6N43xFS4zoMa8Y/7C8/RHOVRQIZ9rltjI/KWncGWeJ2ywPOchlnZUr35Qicfo25yL18j2/EdhH3hLRThTQ6SRtvqUD6rU0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=DTKytzZm; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=UImZUpaa; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Date: Wed, 24 Jan 2024 23:50:26 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1706140228; 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=Nqtun/gfSuSGqOJXigUbaoDPBPqs2SxC2sefNXP0Rlg=; b=DTKytzZmHaG0uo7rcCbsvJIXJq4TetR2hbwLaj/CJIYTT34weeAuN21OFgPTozDhgEp1by sZ766xOq03HmfDGtv6DLQJXfOxe7wmgrAZ6RNTMsHVOXrxsJxXXr8+rl6xR29gdrfLTgrE f6gkvINMU1egezBuwD3d+6y/aTE6nxT+fJRABM8YofDWlz4mSq/WqKwb+EPgmwYLlsZeJX d4s0uUXKmuQkub1xB73q8pklfCt+d1M+ejikh245uI9sHihdNLkMLbXObQBEbmNUxZlmXv ILuA7q2X+ZluwmobXP+L327K6kJ6yTxQhf5/yS3KBdSxBACbbizog4kMrmZIcA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1706140228; 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=Nqtun/gfSuSGqOJXigUbaoDPBPqs2SxC2sefNXP0Rlg=; b=UImZUpaa85vE6/qjQH+2zGu+1jwryq0Wp1qHzWsMjQ3HCf9R1ULAdo6yvvFkKQBf9QH1a5 gcEHwTC+LrfmC2Cw== 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/cache] x86/resctrl: Remove redundant variable in mbm_config_write_domain() Cc: kernel test robot , Babu Moger , "Borislav Petkov (AMD)" , Reinette Chatre , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <202401241810.jbd8Ipa1-lkp@intel.com> References: <202401241810.jbd8Ipa1-lkp@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <170614022689.398.12396173216201868713.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789017719219014922 X-GMAIL-MSGID: 1789017719219014922 The following commit has been merged into the x86/cache branch of tip: Commit-ID: fc747eebef734563cf68a512f57937c8f231834a Gitweb: https://git.kernel.org/tip/fc747eebef734563cf68a512f57937c8f231834a Author: Babu Moger AuthorDate: Wed, 24 Jan 2024 11:52:56 -06:00 Committer: Borislav Petkov (AMD) CommitterDate: Thu, 25 Jan 2024 00:41:59 +01:00 x86/resctrl: Remove redundant variable in mbm_config_write_domain() The kernel test robot reported the following warning after commit 54e35eb8611c ("x86/resctrl: Read supported bandwidth sources from CPUID"). even though the issue is present even in the original commit 92bd5a139033 ("x86/resctrl: Add interface to write mbm_total_bytes_config") which added this function. The reported warning is: $ make C=1 CHECK=scripts/coccicheck arch/x86/kernel/cpu/resctrl/rdtgroup.o ... arch/x86/kernel/cpu/resctrl/rdtgroup.c:1621:5-8: Unneeded variable: "ret". Return "0" on line 1655 Remove the local variable 'ret'. [ bp: Massage commit message, make mbm_config_write_domain() void. ] Fixes: 92bd5a139033 ("x86/resctrl: Add interface to write mbm_total_bytes_config") Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202401241810.jbd8Ipa1-lkp@intel.com/ Signed-off-by: Babu Moger Signed-off-by: Borislav Petkov (AMD) Acked-by: Reinette Chatre Link: https://lore.kernel.org/r/202401241810.jbd8Ipa1-lkp@intel.com --- arch/x86/kernel/cpu/resctrl/rdtgroup.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/arch/x86/kernel/cpu/resctrl/rdtgroup.c b/arch/x86/kernel/cpu/resctrl/rdtgroup.c index 2b69e56..aa24343 100644 --- a/arch/x86/kernel/cpu/resctrl/rdtgroup.c +++ b/arch/x86/kernel/cpu/resctrl/rdtgroup.c @@ -1614,11 +1614,10 @@ static void mon_event_config_write(void *info) wrmsr(MSR_IA32_EVT_CFG_BASE + index, mon_info->mon_config, 0); } -static int mbm_config_write_domain(struct rdt_resource *r, - struct rdt_domain *d, u32 evtid, u32 val) +static void mbm_config_write_domain(struct rdt_resource *r, + struct rdt_domain *d, u32 evtid, u32 val) { struct mon_config_info mon_info = {0}; - int ret = 0; /* * Read the current config value first. If both are the same then @@ -1627,7 +1626,7 @@ static int mbm_config_write_domain(struct rdt_resource *r, mon_info.evtid = evtid; mondata_config_read(d, &mon_info); if (mon_info.mon_config == val) - goto out; + return; mon_info.mon_config = val; @@ -1650,9 +1649,6 @@ static int mbm_config_write_domain(struct rdt_resource *r, * mbm_local and mbm_total counts for all the RMIDs. */ resctrl_arch_reset_rmid_all(r, d); - -out: - return ret; } static int mon_config_write(struct rdt_resource *r, char *tok, u32 evtid) @@ -1661,7 +1657,6 @@ static int mon_config_write(struct rdt_resource *r, char *tok, u32 evtid) char *dom_str = NULL, *id_str; unsigned long dom_id, val; struct rdt_domain *d; - int ret = 0; next: if (!tok || tok[0] == '\0') @@ -1690,9 +1685,7 @@ next: list_for_each_entry(d, &r->domains, list) { if (d->id == dom_id) { - ret = mbm_config_write_domain(r, d, evtid, val); - if (ret) - return -EINVAL; + mbm_config_write_domain(r, d, evtid, val); goto next; } }