Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp1374125imm; Fri, 22 Jun 2018 15:46:00 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJImP3iw9V4HkHZEjKsLzj86Syt538c9wbLwtGbpeFbrk/kInqe89WLauxt1wbQXyYiPu6P X-Received: by 2002:a62:de03:: with SMTP id h3-v6mr3568850pfg.46.1529707560293; Fri, 22 Jun 2018 15:46:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529707560; cv=none; d=google.com; s=arc-20160816; b=Q4Ob3p3Hf3LEdzGzTtdMtgYtChJlE/hWkzzoSCsqTVKqiEWaBWqjSi4gKD7Fl3oz/R 9TR72H3ExzSuDSGWdzevn7gQNTJcdsyARKgw742O5oVIVw92JHABKz0I3scDlRNDOxZv Inu8v7XcS7vENCxWCSzaZ4sRd3HGJZwZQdtlf/8SMVtEyB+ZI2amhFb/SMeCswYN0+De JS0DyhFnNSfkDEk9yyCmGSg1E4vxz174xOSt/k5iP/3aDEwlilDo5sOm7lU8Y4TnJKO3 bb6H3LnZfMLFPbPfXheMquiQC8fSzTeA8BACSlv90J/DZzN/oSZzh9957glBaayOYxiy GE7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=/odNC8jX3byumG7hkKaHZWC9TrXqVQI8Kfrb58E+19A=; b=Q+XHs/za1bTkCIP1J92vchVkwS00gnQ1bHGtouEXmOFom2jAF/xwDRtvmCBvrv7h1p tqZb/S2mLCA6TPH0oT2kWbU6moGC52ua0Wj+83pVjRnXFZOzMBYqFP98LDS7+i0tV1Bz g9rsdd92BoqA0KpTH2Xe+iqfquuqccgJopChiSfb0YZe2WZTqEMh4Ceqd3ENDnCa4Jpq qcmgBdIwDevh3C6aaT9PZqBtqBDvBFtUD83r5Z48ZZMjrqC3zfCVl4qh56qOCyGAMkHK piwytMJpUrvKVwpN+GYdVz02crfIYnkLtFY32CEseQr+SuAiR8JV4lR/QOImWs2NsMpi Or1A== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r11-v6si7832716pfe.145.2018.06.22.15.45.45; Fri, 22 Jun 2018 15:46:00 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934001AbeFVWm7 (ORCPT + 99 others); Fri, 22 Jun 2018 18:42:59 -0400 Received: from mga17.intel.com ([192.55.52.151]:52517 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933780AbeFVWmt (ORCPT ); Fri, 22 Jun 2018 18:42:49 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Jun 2018 15:42:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,259,1526367600"; d="scan'208";a="234843381" Received: from rchatre-s.jf.intel.com ([10.54.70.76]) by orsmga005.jf.intel.com with ESMTP; 22 Jun 2018 15:42:47 -0700 From: Reinette Chatre To: tglx@linutronix.de, fenghua.yu@intel.com, tony.luck@intel.com, vikas.shivappa@linux.intel.com Cc: gavin.hindman@intel.com, jithu.joseph@intel.com, dave.hansen@intel.com, mingo@redhat.com, hpa@zytor.com, x86@kernel.org, linux-kernel@vger.kernel.org, Reinette Chatre Subject: [PATCH V7 11/41] x86/intel_rdt: Making CBM name and type more explicit Date: Fri, 22 Jun 2018 15:42:02 -0700 Message-Id: <5e29cf0209ea2deac9beacd35cbe5239a50959fb.1529706536.git.reinette.chatre@intel.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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; -- 2.17.0