Skip to contentSkip to conversation

Staging: lustre: lproc_ptlrpc: Replace simple_strtol with simple_stroul

PATCH New Shivani Bhardwaj 1 participant 1 message Oct 15, 2015 Staging

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 Staging: lustre: lproc_ptlrpc: Replace simple_strtol with simple_stroul

The variable inst is a __u32 type and hence the function used should be simple_strtoul.
Semantic patch used:

@@
typedef __u32;
__u32 e;
@@
e =
- simple_strtol
+ simple_strtoul
(...)

---
Changes in v2:
-Make semantic patch correct.

 drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c +1 -1
index ec44b3c..415817c 100644
@@ -1251,7 +1251,7 @@ int lprocfs_wr_import(struct file *file, const char __user *buffer,
 		*ptr = 0;
 		do_reconn = 0;
 		ptr += strlen("::");
-		inst = simple_strtol(ptr, &endptr, 10);
+		inst = simple_strtoul(ptr, &endptr, 10);
 		if (*endptr) {
 			CERROR("config: wrong instance # %s\n", ptr);
 		} else if (inst != imp->imp_connect_data.ocd_instance) {
Signature · 1 line
2.1.0