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

[PATCH] select() warning fixes

fs/select.c: In function `core_sys_select':
fs/select.c:339: warning: assignment from incompatible pointer type
fs/select.c:376: warning: comparison of distinct pointer types lacks a cast

By using a void* we can remove lots of casts rather than adding more.

Cc: Jes Sorensen <jes@trained-monkey.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by

Andrew Morton and committed by
Linus Torvalds
29ff2db5 8a5bc075

+7 -7
+7 -7
fs/select.c
··· 310 310 fd_set __user *exp, s64 *timeout) 311 311 { 312 312 fd_set_bits fds; 313 - char *bits; 313 + void *bits; 314 314 int ret, size, max_fdset; 315 315 struct fdtable *fdt; 316 316 /* Allocate small arguments on the stack to save memory and be faster */ ··· 341 341 bits = kmalloc(6 * size, GFP_KERNEL); 342 342 if (!bits) 343 343 goto out_nofds; 344 - fds.in = (unsigned long *) bits; 345 - fds.out = (unsigned long *) (bits + size); 346 - fds.ex = (unsigned long *) (bits + 2*size); 347 - fds.res_in = (unsigned long *) (bits + 3*size); 348 - fds.res_out = (unsigned long *) (bits + 4*size); 349 - fds.res_ex = (unsigned long *) (bits + 5*size); 344 + fds.in = bits; 345 + fds.out = bits + size; 346 + fds.ex = bits + 2*size; 347 + fds.res_in = bits + 3*size; 348 + fds.res_out = bits + 4*size; 349 + fds.res_ex = bits + 5*size; 350 350 351 351 if ((ret = get_fd_set(n, inp, fds.in)) || 352 352 (ret = get_fd_set(n, outp, fds.out)) ||