Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

replace strict_strto calls

Replace obsolete strict_strto calls with appropriate kstrto calls

Signed-off-by: Daniel Walter <dwalter@google.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>

authored by

Daniel Walter and committed by
Trond Myklebust
00cfaa94 00216026

+9 -13
+6 -10
net/sunrpc/addr.c
··· 176 176 len = (buf + buflen) - delim - 1; 177 177 p = kstrndup(delim + 1, len, GFP_KERNEL); 178 178 if (p) { 179 - unsigned long scope_id = 0; 179 + u32 scope_id = 0; 180 180 struct net_device *dev; 181 181 182 182 dev = dev_get_by_name(net, p); ··· 184 184 scope_id = dev->ifindex; 185 185 dev_put(dev); 186 186 } else { 187 - if (strict_strtoul(p, 10, &scope_id) == 0) { 187 + if (kstrtou32(p, 10, &scope_id) == 0) { 188 188 kfree(p); 189 189 return 0; 190 190 } ··· 304 304 * @sap: buffer into which to plant socket address 305 305 * @salen: size of buffer 306 306 * 307 - * @uaddr does not have to be '\0'-terminated, but strict_strtoul() and 307 + * @uaddr does not have to be '\0'-terminated, but kstrtou8() and 308 308 * rpc_pton() require proper string termination to be successful. 309 309 * 310 310 * Returns the size of the socket address if successful; otherwise ··· 315 315 const size_t salen) 316 316 { 317 317 char *c, buf[RPCBIND_MAXUADDRLEN + sizeof('\0')]; 318 - unsigned long portlo, porthi; 318 + u8 portlo, porthi; 319 319 unsigned short port; 320 320 321 321 if (uaddr_len > RPCBIND_MAXUADDRLEN) ··· 327 327 c = strrchr(buf, '.'); 328 328 if (unlikely(c == NULL)) 329 329 return 0; 330 - if (unlikely(strict_strtoul(c + 1, 10, &portlo) != 0)) 331 - return 0; 332 - if (unlikely(portlo > 255)) 330 + if (unlikely(kstrtou8(c + 1, 10, &portlo) != 0)) 333 331 return 0; 334 332 335 333 *c = '\0'; 336 334 c = strrchr(buf, '.'); 337 335 if (unlikely(c == NULL)) 338 336 return 0; 339 - if (unlikely(strict_strtoul(c + 1, 10, &porthi) != 0)) 340 - return 0; 341 - if (unlikely(porthi > 255)) 337 + if (unlikely(kstrtou8(c + 1, 10, &porthi) != 0)) 342 338 return 0; 343 339 344 340 port = (unsigned short)((porthi << 8) | portlo);
+1 -1
net/sunrpc/auth.c
··· 48 48 49 49 if (!val) 50 50 goto out_inval; 51 - ret = strict_strtoul(val, 0, &num); 51 + ret = kstrtoul(val, 0, &num); 52 52 if (ret == -EINVAL) 53 53 goto out_inval; 54 54 nbits = fls(num);
+2 -2
net/sunrpc/xprtsock.c
··· 3059 3059 const struct kernel_param *kp, 3060 3060 unsigned int min, unsigned int max) 3061 3061 { 3062 - unsigned long num; 3062 + unsigned int num; 3063 3063 int ret; 3064 3064 3065 3065 if (!val) 3066 3066 return -EINVAL; 3067 - ret = strict_strtoul(val, 0, &num); 3067 + ret = kstrtouint(val, 0, &num); 3068 3068 if (ret == -EINVAL || num < min || num > max) 3069 3069 return -EINVAL; 3070 3070 *((unsigned int *)kp->arg) = num;