Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp1900838imm; Sat, 23 Jun 2018 05:14:46 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLXGfaTyjl+3edr7ItJHzrlHPHgOmYxgwR47vKgELFwJTML5hJuiocbKp4hiTP7XthCQ11N X-Received: by 2002:a62:e208:: with SMTP id a8-v6mr5646412pfi.6.1529756086543; Sat, 23 Jun 2018 05:14:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529756086; cv=none; d=google.com; s=arc-20160816; b=WvianGfueo4Oo1P88cRG1f1vfPDq414F5gfLskQIthWEynRvT0ZYvAOxhz6Ezig/y3 furzpuj07O2J9IJwUbR3GZgBDIH3jzxNnUkhXisSgIubTcGDLCd9XDS4SuKinufhguYP /n7wMxr3OY533vJaPi3VjNELYFc1MGtrRhtqA8SgvRq8CFSi7WAFM6sRmW34cG7/aoLa ULroQAG7w2gP3jT94iw++N72QV+LfVm9LOcLmdp13W3XcC0M6HYpAmB26srBbKkYoU7+ Uj5cAV1Tv2R7mTeFMYPu42Y4XDVVdHMm1I+X/OHgM1HdgVT6P7Bwoj1SJIlRdCfU1kw0 aiCw== 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=2Np1FLGpG4K5+VYZC51/iYlA3TaFeN9hfV/yqUb/P2Q=; b=xtOtMd666FlK7jj1QYACLhi1b6x0NaGcZ6RIpZ92hmrmb+EZVIN9lCMgvCgt0ux8uJ Wdqmqc09/CPQ/m9Uqfc3ztpoVDms4LF0cGNhSGpLLZxtrwpC5jsNsIXaVhAd9L702EPO 6jSk/TLHHLclbLrVNNLQwfJZECeo4K4yAiMChHESOTF4jaz7d5Gt4w7V5keLIbbV1eaf qFeNaZlafu0/twhqrkXjnmrRmsxFzwlWPNw6GJNMnmhntDQuGjyI0o3l3OzYf4nZ9fEn duRPAGOUZRF3HoyQhwnF50TEvm02NCJKe0SURfUL8VyykfZFUqdqOgui6Me+jcl50uum X5qg== 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 q18-v6si8192646pgd.294.2018.06.23.05.14.32; Sat, 23 Jun 2018 05:14:46 -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 S1751916AbeFWMMf (ORCPT + 99 others); Sat, 23 Jun 2018 08:12:35 -0400 Received: from terminus.zytor.com ([198.137.202.136]:44159 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751654AbeFWMMe (ORCPT ); Sat, 23 Jun 2018 08:12:34 -0400 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTPS id w5NCCTHd463908 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 23 Jun 2018 05:12:29 -0700 Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id w5NCCTYk463905; Sat, 23 Jun 2018 05:12:29 -0700 Date: Sat, 23 Jun 2018 05:12:29 -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: hpa@zytor.com, tglx@linutronix.de, linux-kernel@vger.kernel.org, mingo@kernel.org, reinette.chatre@intel.com Reply-To: reinette.chatre@intel.com, mingo@kernel.org, linux-kernel@vger.kernel.org, tglx@linutronix.de, hpa@zytor.com In-Reply-To: <5e29cf0209ea2deac9beacd35cbe5239a50959fb.1529706536.git.reinette.chatre@intel.com> References: <5e29cf0209ea2deac9beacd35cbe5239a50959fb.1529706536.git.reinette.chatre@intel.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/cache] x86/intel_rdt: Making CBM name and type more explicit Git-Commit-ID: 9af4c0a6dc1a1abf5336f2c3f951444db6b71da9 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, 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: 9af4c0a6dc1a1abf5336f2c3f951444db6b71da9 Gitweb: https://git.kernel.org/tip/9af4c0a6dc1a1abf5336f2c3f951444db6b71da9 Author: Reinette Chatre AuthorDate: Fri, 22 Jun 2018 15:42:02 -0700 Committer: Thomas Gleixner CommitDate: Sat, 23 Jun 2018 13:03:43 +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/5e29cf0209ea2deac9beacd35cbe5239a50959fb.1529706536.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;