@@ -539,12 +539,12 @@ struct edac_device_ctl_info *edac_device_del_device(struct device *dev)
}
EXPORT_SYMBOL_GPL(edac_device_del_device);
-static inline int edac_device_get_log_ce(struct edac_device_ctl_info *edac_dev)
+static inline bool edac_device_get_log_ce(struct edac_device_ctl_info *edac_dev)
{
return edac_dev->log_ce;
}
-static inline int edac_device_get_log_ue(struct edac_device_ctl_info *edac_dev)
+static inline bool edac_device_get_log_ue(struct edac_device_ctl_info *edac_dev)
{
return edac_dev->log_ue;
}
@@ -157,8 +157,8 @@ struct edac_device_ctl_info {
int dev_idx;
/* Per instance controls for this edac_device */
- int log_ue; /* boolean for logging UEs */
- int log_ce; /* boolean for logging CEs */
+ bool log_ue; /* boolean for logging UEs */
+ bool log_ce; /* boolean for logging CEs */
int panic_on_ue; /* boolean for panic'ing on an UE */
unsigned poll_msec; /* number of milliseconds to poll interval */
unsigned long delay; /* number of jiffies for poll_msec */
@@ -39,10 +39,10 @@ static ssize_t edac_device_ctl_log_ue_store(struct edac_device_ctl_info
*ctl_info, const char *data,
size_t count)
{
- /* if parameter is zero, turn off flag, if non-zero turn on flag */
- ctl_info->log_ue = (simple_strtoul(data, NULL, 0) != 0);
+ int ret;
- return count;
+ ret = kstrtobool(data, &ctl_info->log_ue);
+ return ret ? ret : count;
}
/* 'log_ce' */
@@ -56,10 +56,10 @@ static ssize_t edac_device_ctl_log_ce_store(struct edac_device_ctl_info
*ctl_info, const char *data,
size_t count)
{
- /* if parameter is zero, turn off flag, if non-zero turn on flag */
- ctl_info->log_ce = (simple_strtoul(data, NULL, 0) != 0);
+ int ret;
- return count;
+ ret = kstrtobool(data, &ctl_info->log_ce);
+ return ret ? ret : count;
}
/* 'panic_on_ue' */
Use kstrtobool() since simple_strtoul() is deprecated. Also change edac_device_get_log_ue/ce return type from int to bool. Signed-off-by: Kamati Srinivas <quic_kamasrin@quicinc.com> --- drivers/edac/edac_device.c | 4 ++-- drivers/edac/edac_device.h | 4 ++-- drivers/edac/edac_device_sysfs.c | 12 ++++++------ 3 files changed, 10 insertions(+), 10 deletions(-)