Skip to contentSkip to conversation

staging: lustre: ldlm: ldlm_resource.c replace obsolete function with kstrtoul()

PATCH New Anil Belur 1 participant 1 message Jun 19, 2014 Staging

lore
Share & tools
lore

Anil Belur

author
#0 lore raw

PATCH 1/1 staging: lustre: ldlm: ldlm_resource.c replace obsolete function with kstrtoul()

From: Anil Belur <[email protected]>

- this change fixes the warning "WARNING: simple_strtoul is obsolete, use kstrtoul instead"
- removed the unused var 'end' as this is no longer required for kstrtoul()

---
 drivers/staging/lustre/lustre/ldlm/ldlm_resource.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/staging/lustre/lustre/ldlm/ldlm_resource.c +4 -3
index c55d72f..5070a60 100644
@@ -194,9 +194,10 @@ static ssize_t lprocfs_lru_size_seq_write(struct file *file, const char *buffer,
 				      size_t count, loff_t *off)
 {
 	struct ldlm_namespace *ns = ((struct seq_file *)file->private_data)->private;
-	char dummy[MAX_STRING_SIZE + 1], *end;
+	char dummy[MAX_STRING_SIZE + 1];
 	unsigned long tmp;
 	int lru_resize;
+	int err;
 
 	dummy[MAX_STRING_SIZE] = '\0';
 	if (copy_from_user(dummy, buffer, MAX_STRING_SIZE))
@@ -228,8 +229,8 @@ static ssize_t lprocfs_lru_size_seq_write(struct file *file, const char *buffer,
 		return count;
 	}
 
-	tmp = simple_strtoul(dummy, &end, 0);
-	if (dummy == end) {
+	err = kstrtoul(dummy, 10, &tmp);
+	if (err != 0) {
 		CERROR("invalid value written\n");
 		return -EINVAL;
 	}
Signature · 1 line
1.9.0