Merge "soc: qcom: core,gladiator hang: Change the sysfs print format"
This commit is contained in:
commit
744bdc6546
2 changed files with 8 additions and 11 deletions
|
@ -33,6 +33,7 @@
|
|||
#define _WRITE(x, y, z) (((~(_VAL(z))) & y) | _VALUE(x, z))
|
||||
|
||||
#define MODULE_NAME "msm_hang_detect"
|
||||
#define MAX_SYSFS_LEN 12
|
||||
|
||||
struct hang_detect {
|
||||
phys_addr_t threshold[NR_CPUS];
|
||||
|
@ -108,8 +109,7 @@ static ssize_t show_threshold(struct kobject *kobj, struct attribute *attr,
|
|||
{
|
||||
struct hang_detect *device = to_core_hang_dev(kobj);
|
||||
|
||||
return snprintf(buf, sizeof(device->threshold_val),
|
||||
"%u\n", device->threshold_val);
|
||||
return snprintf(buf, MAX_SYSFS_LEN, "0x%x\n", device->threshold_val);
|
||||
}
|
||||
|
||||
static size_t store_threshold(struct kobject *kobj, struct attribute *attr,
|
||||
|
@ -147,8 +147,8 @@ static ssize_t show_pmu_event_sel(struct kobject *kobj, struct attribute *attr,
|
|||
{
|
||||
struct hang_detect *hang_device = to_core_hang_dev(kobj);
|
||||
|
||||
return snprintf(buf, sizeof(hang_device->pmu_event_sel),
|
||||
"%u\n", hang_device->pmu_event_sel);
|
||||
return snprintf(buf, MAX_SYSFS_LEN, "0x%x\n",
|
||||
hang_device->pmu_event_sel);
|
||||
}
|
||||
|
||||
static size_t store_pmu_event_sel(struct kobject *kobj, struct attribute *attr,
|
||||
|
@ -188,8 +188,7 @@ static ssize_t show_enable(struct kobject *kobj, struct attribute *attr,
|
|||
{
|
||||
struct hang_detect *hang_device = to_core_hang_dev(kobj);
|
||||
|
||||
return snprintf(buf, sizeof(hang_device->enabled),
|
||||
"%u\n", hang_device->enabled);
|
||||
return snprintf(buf, MAX_SYSFS_LEN, "%u\n", hang_device->enabled);
|
||||
}
|
||||
|
||||
static size_t store_enable(struct kobject *kobj, struct attribute *attr,
|
||||
|
|
|
@ -34,6 +34,7 @@
|
|||
#define NR_GLA_REG 6
|
||||
#define MODULE_NAME "gladiator_hang_detect"
|
||||
#define MAX_THRES 0xFFFFFFFF
|
||||
#define MAX_LEN_SYSFS 12
|
||||
|
||||
struct hang_detect {
|
||||
phys_addr_t threshold[NR_GLA_REG];
|
||||
|
@ -199,8 +200,7 @@ static inline ssize_t generic_enable_show(struct kobject *kobj,
|
|||
uint32_t reg_value;
|
||||
|
||||
get_enable(offset, hang_dev, ®_value);
|
||||
return snprintf(buf, sizeof(hang_dev->ACE_enable),
|
||||
"%d\n", reg_value);
|
||||
return snprintf(buf, MAX_LEN_SYSFS, "%u\n", reg_value);
|
||||
}
|
||||
|
||||
static inline ssize_t generic_threshold_show(struct kobject *kobj,
|
||||
|
@ -210,9 +210,7 @@ static inline ssize_t generic_threshold_show(struct kobject *kobj,
|
|||
uint32_t reg_value;
|
||||
|
||||
get_threshold(offset, hang_dev, ®_value);
|
||||
return snprintf(buf, sizeof(hang_dev->ACE_threshold),
|
||||
"%u\n", reg_value);
|
||||
|
||||
return snprintf(buf, MAX_LEN_SYSFS, "0x%x\n", reg_value);
|
||||
}
|
||||
|
||||
static inline size_t generic_threshold_store(struct kobject *kobj,
|
||||
|
|
Loading…
Add table
Reference in a new issue