return ret ?: nbytes;
}
-void resctrl_arch_get_config(struct rdt_resource *r, struct rdt_domain *d,
- u32 closid, enum resctrl_conf_type type, u32 *value)
+u32 resctrl_arch_get_config(struct rdt_resource *r, struct rdt_domain *d,
+ u32 closid, enum resctrl_conf_type type)
{
struct rdt_hw_domain *hw_dom = resctrl_to_arch_dom(d);
u32 idx = get_config_index(closid, type);
if (!is_mba_sc(r))
- *value = hw_dom->ctrl_val[idx];
- else
- *value = hw_dom->mbps_val[idx];
+ return hw_dom->ctrl_val[idx];
+ return hw_dom->mbps_val[idx];
}
static void show_doms(struct seq_file *s, struct resctrl_schema *schema, int closid)
if (sep)
seq_puts(s, ";");
- resctrl_arch_get_config(r, dom, closid, schema->conf_type,
- &ctrl_val);
+ ctrl_val = resctrl_arch_get_config(r, dom, closid,
+ schema->conf_type);
seq_printf(s, r->format_str, dom->id, max_data_width,
ctrl_val);
sep = true;
for (i = 0; i < closids_supported(); i++) {
if (!closid_allocated(i))
continue;
- resctrl_arch_get_config(r, dom, i, s->conf_type,
- &ctrl_val);
+ ctrl_val = resctrl_arch_get_config(r, dom, i,
+ s->conf_type);
mode = rdtgroup_mode_by_closid(i);
switch (mode) {
case RDT_MODE_SHAREABLE:
/* Check for overlap with other resource groups */
for (i = 0; i < closids_supported(); i++) {
- resctrl_arch_get_config(r, d, i, type, (u32 *)&ctrl_b);
+ ctrl_b = resctrl_arch_get_config(r, d, i, type);
mode = rdtgroup_mode_by_closid(i);
if (closid_allocated(i) && i != closid &&
mode != RDT_MODE_PSEUDO_LOCKSETUP) {
continue;
has_cache = true;
list_for_each_entry(d, &r->domains, list) {
- resctrl_arch_get_config(r, d, closid, s->conf_type, &ctrl);
+ ctrl = resctrl_arch_get_config(r, d, closid,
+ s->conf_type);
if (rdtgroup_cbm_overlaps(s, d, ctrl, closid, false)) {
rdt_last_cmd_puts("Schemata overlaps\n");
return false;
if (rdtgrp->mode == RDT_MODE_PSEUDO_LOCKSETUP) {
size = 0;
} else {
- resctrl_arch_get_config(r, d, rdtgrp->closid,
- schema->conf_type, &ctrl);
+ ctrl = resctrl_arch_get_config(r, d,
+ rdtgrp->closid,
+ schema->conf_type);
if (r->rid == RDT_RESOURCE_MBA)
size = ctrl;
else
* with an exclusive group.
*/
if (resctrl_arch_get_cdp_enabled(r->rid))
- resctrl_arch_get_config(r, d, i, peer_type, &peer_ctl);
+ peer_ctl = resctrl_arch_get_config(r, d, i,
+ peer_type);
else
peer_ctl = 0;
- resctrl_arch_get_config(r, d, i, s->conf_type, &ctrl_val);
+ ctrl_val = resctrl_arch_get_config(r, d, i,
+ s->conf_type);
used_b |= ctrl_val | peer_ctl;
if (mode == RDT_MODE_SHAREABLE)
cfg->new_ctrl |= ctrl_val | peer_ctl;
/* The number of closid supported by this resource regardless of CDP */
u32 resctrl_arch_get_num_closid(struct rdt_resource *r);
int resctrl_arch_update_domains(struct rdt_resource *r, u32 closid);
-void resctrl_arch_get_config(struct rdt_resource *r, struct rdt_domain *d,
- u32 closid, enum resctrl_conf_type type,
- u32 *value);
+u32 resctrl_arch_get_config(struct rdt_resource *r, struct rdt_domain *d,
+ u32 closid, enum resctrl_conf_type type);
#endif /* _RESCTRL_H */