scst_dlm: Use kstrtoul() instead of simple_strtoul()

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6668 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Bart Van Assche
2015-11-11 14:39:01 +00:00
parent 147aededc7
commit 295910c6c7
+5 -2
View File
@@ -572,7 +572,8 @@ static int scst_dlm_update_nodeids(struct scst_pr_dlm_data *pr_dlm)
static const char comms_dir[] = "/sys/kernel/config/dlm/cluster/comms";
struct file *comms;
char *p, *entries = kzalloc(1, GFP_KERNEL);
uint32_t nodeid, *new;
unsigned long nodeid;
uint32_t *new;
int i, ret, num_nodes;
char path[256], buf[64];
@@ -612,7 +613,9 @@ static int scst_dlm_update_nodeids(struct scst_pr_dlm_data *pr_dlm)
pr_dlm->nodeid = new;
pr_dlm->participants = num_nodes;
for (i = 0, p = entries; *p; i++, p += strlen(p) + 1) {
nodeid = simple_strtoul(p, NULL, 0);
ret = kstrtoul(p, 0, &nodeid);
if (WARN_ON_ONCE(ret < 0))
continue;
snprintf(path, sizeof(path), "%s/%s/local", comms_dir, p);
if (scst_read_file(path, buf, sizeof(buf)) >= 0 &&
strcmp(buf, "1\n") == 0)