Skip to content

Commit

Permalink
CR-1130359 xmc: don't append units(W or C) for temp & power sysfs rea…
Browse files Browse the repository at this point in the history
…dings (Xilinx#6719)

Signed-off-by: Rajkumar Rampelli <[email protected]>
  • Loading branch information
rajkumar-xilinx authored May 20, 2022
1 parent c8a6927 commit 28791c6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
18 changes: 9 additions & 9 deletions src/runtime_src/core/pcie/driver/linux/xocl/subdev/xmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1957,7 +1957,7 @@ static ssize_t scaling_threshold_power_override_show(struct device *dev,
}
mutex_unlock(&xmc->xmc_lock);

return sprintf(buf, "%uW\n", val);
return sprintf(buf, "%u\n", val);
}

static ssize_t scaling_threshold_power_override_store(struct device *dev,
Expand Down Expand Up @@ -2049,7 +2049,7 @@ static ssize_t scaling_critical_temp_threshold_show(struct device *dev,
return sprintf(buf, "N/A\n");
}

return sprintf(buf, "%uC\n", val);
return sprintf(buf, "%u\n", val);
}
static DEVICE_ATTR_RO(scaling_critical_temp_threshold);

Expand All @@ -2072,7 +2072,7 @@ static ssize_t scaling_threshold_temp_limit_show(struct device *dev,
val = xmc_get_threshold_temp(xmc);
}

return sprintf(buf, "%uC\n", val);
return sprintf(buf, "%u\n", val);
}
static DEVICE_ATTR_RO(scaling_threshold_temp_limit);

Expand All @@ -2095,7 +2095,7 @@ static ssize_t scaling_threshold_power_limit_show(struct device *dev,
val = xmc_get_threshold_power(xmc);
}

return sprintf(buf, "%uW\n", val);
return sprintf(buf, "%u\n", val);
}
static DEVICE_ATTR_RO(scaling_threshold_power_limit);

Expand Down Expand Up @@ -2142,7 +2142,7 @@ static ssize_t scaling_threshold_temp_override_show(struct device *dev,
}
mutex_unlock(&xmc->xmc_lock);

return sprintf(buf, "%uC\n", val);
return sprintf(buf, "%u\n", val);
}

static ssize_t scaling_threshold_temp_override_store(struct device *dev,
Expand Down Expand Up @@ -2324,7 +2324,7 @@ static ssize_t hwmon_scaling_target_power_show(struct device *dev,
val = val * 1000000;
mutex_unlock(&xmc->xmc_lock);

return sprintf(buf, "%uW\n", val);
return sprintf(buf, "%u\n", val);
}

static ssize_t hwmon_scaling_target_power_store(struct device *dev,
Expand Down Expand Up @@ -2380,7 +2380,7 @@ static ssize_t hwmon_scaling_target_temp_show(struct device *dev,
val = val * 1000;
mutex_unlock(&xmc->xmc_lock);

return sprintf(buf, "%uc\n", val);
return sprintf(buf, "%u\n", val);
}

static ssize_t hwmon_scaling_target_temp_store(struct device *dev,
Expand Down Expand Up @@ -2443,7 +2443,7 @@ static ssize_t hwmon_scaling_threshold_temp_show(struct device *dev,
val = val * 1000;
mutex_unlock(&xmc->xmc_lock);

return sprintf(buf, "%uC\n", val);
return sprintf(buf, "%u\n", val);
}

static ssize_t hwmon_scaling_threshold_power_show(struct device *dev,
Expand Down Expand Up @@ -2471,7 +2471,7 @@ static ssize_t hwmon_scaling_threshold_power_show(struct device *dev,
val = val * 1000000;
mutex_unlock(&xmc->xmc_lock);

return sprintf(buf, "%uW\n", val);
return sprintf(buf, "%u\n", val);
}

static ssize_t reg_base_show(struct device *dev,
Expand Down
8 changes: 4 additions & 4 deletions src/runtime_src/core/pcie/driver/linux/xocl/subdev/xmc_u2.c
Original file line number Diff line number Diff line change
Expand Up @@ -2182,7 +2182,7 @@ static ssize_t hwmon_scaling_target_power_show(struct device *dev,
val = val * 1000000;
mutex_unlock(&xmc->xmc_lock);

return sprintf(buf, "%uW\n", val);
return sprintf(buf, "%u\n", val);
}

static ssize_t hwmon_scaling_target_power_store(struct device *dev,
Expand Down Expand Up @@ -2238,7 +2238,7 @@ static ssize_t hwmon_scaling_target_temp_show(struct device *dev,
val = val * 1000;
mutex_unlock(&xmc->xmc_lock);

return sprintf(buf, "%uc\n", val);
return sprintf(buf, "%u\n", val);
}

static ssize_t hwmon_scaling_target_temp_store(struct device *dev,
Expand Down Expand Up @@ -2301,7 +2301,7 @@ static ssize_t hwmon_scaling_threshold_temp_show(struct device *dev,
val = val * 1000;
mutex_unlock(&xmc->xmc_lock);

return sprintf(buf, "%uC\n", val);
return sprintf(buf, "%u\n", val);
}

static ssize_t hwmon_scaling_threshold_power_show(struct device *dev,
Expand Down Expand Up @@ -2329,7 +2329,7 @@ static ssize_t hwmon_scaling_threshold_power_show(struct device *dev,
val = val * 1000000;
mutex_unlock(&xmc->xmc_lock);

return sprintf(buf, "%uW\n", val);
return sprintf(buf, "%u\n", val);
}

static ssize_t reg_base_show(struct device *dev,
Expand Down

0 comments on commit 28791c6

Please sign in to comment.