Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp120516imm; Tue, 19 Jun 2018 17:20:02 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKxV6lC1+0x2o7kxmjDop3Dh42PKwGlbBAibbr4IIxg+oLtWcfZNrIxFjARdUFBYSFVPMS2 X-Received: by 2002:a17:902:b7c4:: with SMTP id v4-v6mr20986874plz.188.1529454002119; Tue, 19 Jun 2018 17:20:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529454002; cv=none; d=google.com; s=arc-20160816; b=wNLThnj5Bc0PYsgIx6VdJYDrCmcCloyDc3Wai5Us75cOsLNSqegN08occf91BNiZFq wfO4BZlxfHUcpOtTg7xP22n66TcQh/8nidcL9gwaQIZLAtpfk/4Bxj+Z7QMCl7FYyxmM cxNm5t6bzty4RQtG8aSgfRM1GgrEG3Vqrjw1fqn+2imbF5DzZimliBfmwqlrVJYrsC+8 3WjgNpUJY3RD/sugGP6mhg9kPKeHDYEVTlOGY0d+VmyAO1CC58Gm4tngxwxFXphRQY9F VdaLyHdXaHizMX7Ip0ckPH2VtPwBilO/5hBOuIVpUHmnhoTm8RH3labWz5FIYpu40eA+ OYGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date:arc-authentication-results; bh=nbUS2NpFcxphopUF+wsvWcoQXwwSV6quGJDv4MjLB+s=; b=i06UAI0L4ABpwpB/KlAWc7UcqYYIRiVVtufNDykKOiAzORSspUmjVkOiP75OC8XOaP p2mElA3We42dgH2rJkZ74sddzmfMRPqdsG+hY3xLZbAZ6d43pr8q9usvzHs/8UbT9OXu STkN2frWc1JIuIxauci3rZoQHzCob7HwF+LFljPoLkSEi0OoYTDGv0yalouHPsyucsn1 RRi5CMd5iMd78gkfI5z/hHqX+24cctke06wT7E6iE4ONBFuQaW/aYMB/9lmRCBwa9IzX Hlj45mgllrw1D9OvJ9VfDUB47/IYMhfE1jZm/NtkVWFcU283EG/e3vrobZrbijcYHYS1 Mz2w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o26-v6si953505pfe.44.2018.06.19.17.19.44; Tue, 19 Jun 2018 17:20:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753141AbeFTASA (ORCPT + 99 others); Tue, 19 Jun 2018 20:18:00 -0400 Received: from terminus.zytor.com ([198.137.202.136]:35427 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750949AbeFTAR7 (ORCPT ); Tue, 19 Jun 2018 20:17:59 -0400 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTPS id w5K0Hs5T3296731 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 19 Jun 2018 17:17:54 -0700 Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id w5K0Hs9G3296728; Tue, 19 Jun 2018 17:17:54 -0700 Date: Tue, 19 Jun 2018 17:17:54 -0700 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Reinette Chatre Message-ID: Cc: mingo@kernel.org, reinette.chatre@intel.com, tglx@linutronix.de, hpa@zytor.com, linux-kernel@vger.kernel.org Reply-To: tglx@linutronix.de, hpa@zytor.com, reinette.chatre@intel.com, mingo@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: References: To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/cache] x86/intel_rdt: Making CBM name and type more explicit Git-Commit-ID: b659774192534679d93009af9003eefc3d741d59 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, T_DATE_IN_FUTURE_96_Q autolearn=ham autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: b659774192534679d93009af9003eefc3d741d59 Gitweb: https://git.kernel.org/tip/b659774192534679d93009af9003eefc3d741d59 Author: Reinette Chatre AuthorDate: Tue, 29 May 2018 05:57:35 -0700 Committer: Thomas Gleixner CommitDate: Wed, 20 Jun 2018 00:56:30 +0200 x86/intel_rdt: Making CBM name and type more explicit cbm_validate() receives a pointer to the variable that will be initialized with a validated capacity bitmask. The pointer points to a variable of type unsigned long that is immediately assigned to a variable of type u32 by the caller on return from cbm_validate(). Let cbm_validate() initialize a variable of type u32 directly. At this time also change tha variable name "data" within parse_cbm() to a name more reflective of the content: "cbm_val". This frees up the generic "data" to be used later when it is indeed used for a collection of input. Signed-off-by: Reinette Chatre Signed-off-by: Thomas Gleixner Cc: fenghua.yu@intel.com Cc: tony.luck@intel.com Cc: vikas.shivappa@linux.intel.com Cc: gavin.hindman@intel.com Cc: jithu.joseph@intel.com Cc: dave.hansen@intel.com Cc: hpa@zytor.com Link: https://lkml.kernel.org/r/d08cc1fa859f5751fd815ed8ef5499170badc9e5.1527593970.git.reinette.chatre@intel.com --- arch/x86/kernel/cpu/intel_rdt_ctrlmondata.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/arch/x86/kernel/cpu/intel_rdt_ctrlmondata.c b/arch/x86/kernel/cpu/intel_rdt_ctrlmondata.c index 2c23bb136ccc..b3da5b981dd8 100644 --- a/arch/x86/kernel/cpu/intel_rdt_ctrlmondata.c +++ b/arch/x86/kernel/cpu/intel_rdt_ctrlmondata.c @@ -87,7 +87,7 @@ int parse_bw(char *buf, struct rdt_resource *r, struct rdt_domain *d) * are allowed (e.g. FFFFH, 0FF0H, 003CH, etc.). * Additionally Haswell requires at least two bits set. */ -static bool cbm_validate(char *buf, unsigned long *data, struct rdt_resource *r) +static bool cbm_validate(char *buf, u32 *data, struct rdt_resource *r) { unsigned long first_bit, zero_bit, val; unsigned int cbm_len = r->cache.cbm_len; @@ -128,16 +128,17 @@ static bool cbm_validate(char *buf, unsigned long *data, struct rdt_resource *r) */ int parse_cbm(char *buf, struct rdt_resource *r, struct rdt_domain *d) { - unsigned long data; + u32 cbm_val; if (d->have_new_ctrl) { rdt_last_cmd_printf("duplicate domain %d\n", d->id); return -EINVAL; } - if(!cbm_validate(buf, &data, r)) + if (!cbm_validate(buf, &cbm_val, r)) return -EINVAL; - d->new_ctrl = data; + + d->new_ctrl = cbm_val; d->have_new_ctrl = true; return 0;