Skip to content

Commit 9af4c0a

Browse files
rchatreKAGA-KOKO
authored andcommitted
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 <reinette.chatre@intel.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> 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
1 parent 49f7b4e commit 9af4c0a

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

arch/x86/kernel/cpu/intel_rdt_ctrlmondata.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ int parse_bw(char *buf, struct rdt_resource *r, struct rdt_domain *d)
8787
* are allowed (e.g. FFFFH, 0FF0H, 003CH, etc.).
8888
* Additionally Haswell requires at least two bits set.
8989
*/
90-
static bool cbm_validate(char *buf, unsigned long *data, struct rdt_resource *r)
90+
static bool cbm_validate(char *buf, u32 *data, struct rdt_resource *r)
9191
{
9292
unsigned long first_bit, zero_bit, val;
9393
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)
128128
*/
129129
int parse_cbm(char *buf, struct rdt_resource *r, struct rdt_domain *d)
130130
{
131-
unsigned long data;
131+
u32 cbm_val;
132132

133133
if (d->have_new_ctrl) {
134134
rdt_last_cmd_printf("duplicate domain %d\n", d->id);
135135
return -EINVAL;
136136
}
137137

138-
if(!cbm_validate(buf, &data, r))
138+
if (!cbm_validate(buf, &cbm_val, r))
139139
return -EINVAL;
140-
d->new_ctrl = data;
140+
141+
d->new_ctrl = cbm_val;
141142
d->have_new_ctrl = true;
142143

143144
return 0;

0 commit comments

Comments
 (0)