* [PATCH 1/1] staging: lustre: ldlm: ldlm_resource.c replace obsolete function with kstrtoul()
@ 2014-06-19 15:02 Anil Belur
0 siblings, 0 replies; only message in thread
From: Anil Belur @ 2014-06-19 15:02 UTC (permalink / raw)
To: andreas.dilger, oleg.drokin, gregkh
Cc: linux-kernel, hpdd-discuss, Anil Belur
From: Anil Belur <askb23@gmail.com>
- 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()
Signed-off-by: Anil Belur <askb23@gmail.com>
---
drivers/staging/lustre/lustre/ldlm/ldlm_resource.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c b/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c
index c55d72f..5070a60 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c
@@ -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;
}
--
1.9.0
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2014-06-19 15:02 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-19 15:02 [PATCH 1/1] staging: lustre: ldlm: ldlm_resource.c replace obsolete function with kstrtoul() Anil Belur
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome