staging: lustre: Replace strtoul with simple_strtoul
authorGuenter Roeck <linux@roeck-us.net>
Fri, 24 Jul 2015 16:37:14 +0000 (09:37 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 24 Jul 2015 20:56:33 +0000 (13:56 -0700)
Defining and using strtoul in lustre code results in the following
compile warnings (arm64:allmodconfig).

include/linux/libcfs/libcfs_string.h:105:0: warning: "strtoul" redefined
#define strtoul(str, endp, base) simple_strtoul(str, endp, base)
include/acpi/platform/aclinux.h:122:0: note:
this is the location of the previous definition
#define strtoul simple_strtoul

Remove the definition and use simple_strtoul() directly. Note that we
can not replace simple_strtoul with kstrtoul since the end pointer
is used by the code.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/include/linux/libcfs/libcfs_string.h
drivers/staging/lustre/lustre/include/obd.h
drivers/staging/lustre/lustre/libcfs/libcfs_string.c

index 509dc1e..478e958 100644 (file)
@@ -102,6 +102,4 @@ int cfs_ip_addr_parse(char *str, int len, struct list_head *list);
 int cfs_ip_addr_match(__u32 addr, struct list_head *list);
 void cfs_ip_addr_free(struct list_head *list);
 
-#define        strtoul(str, endp, base)        simple_strtoul(str, endp, base)
-
 #endif
index 55452e5..9ad8c26 100644 (file)
@@ -1472,7 +1472,7 @@ static inline bool filename_is_volatile(const char *name, int namelen, int *idx)
        }
        /* we have an idx, read it */
        start = name + LUSTRE_VOLATILE_HDR_LEN + 1;
-       *idx = strtoul(start, &end, 0);
+       *idx = simple_strtoul(start, &end, 0);
        /* error cases:
         * no digit, no trailing :, negative value
         */
index 76d4392..4dde8e0 100644 (file)
@@ -231,7 +231,7 @@ cfs_str2num_check(char *str, int nob, unsigned *num,
        char    *endp;
 
        str = cfs_trimwhite(str);
-       *num = strtoul(str, &endp, 0);
+       *num = simple_strtoul(str, &endp, 0);
        if (endp == str)
                return 0;