From: aybuke ozdemir Date: Sat, 21 Feb 2015 20:47:43 +0000 (+0200) Subject: Staging: lustre: use kstrtoul() instead of sscanf() X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=692f2b6cc298b86b9386bb26ea457aae957cc6ff;p=openwrt%2Fstaging%2Fblogic.git Staging: lustre: use kstrtoul() instead of sscanf() This patch makes checkpatch.pl by fixing the following warning: WARNING: Prefer kstrto to single variable sscanf. I used to kstrtoul can convert unsigned long instead of sscanf Signed-off-by: aybuke ozdemir Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/lustre/lustre/llite/llite_lib.c b/drivers/staging/lustre/lustre/llite/llite_lib.c index a2b11ef89d91..4ebc28cf37dd 100644 --- a/drivers/staging/lustre/lustre/llite/llite_lib.c +++ b/drivers/staging/lustre/lustre/llite/llite_lib.c @@ -2151,7 +2151,8 @@ int ll_process_config(struct lustre_cfg *lcfg) ptr = strrchr(lustre_cfg_string(lcfg, 0), '-'); if (!ptr || !*(++ptr)) return -EINVAL; - if (sscanf(ptr, "%lx", &x) != 1) + rc = kstrtoul(ptr, 16, &x); + if (rc != 0) return -EINVAL; sb = (void *)x; /* This better be a real Lustre superblock! */