[PATCH] Remove select_bits_alloc(), select_bits_free() * Both are trivial wrappers. * Each wrapper is used only in one place. Signed-off-by: Alexey Dobriyan Index: linux-kj/fs/select.c =================================================================== --- linux-kj.orig/fs/select.c 2005-10-28 16:25:03.000000000 +0400 +++ linux-kj/fs/select.c 2005-10-28 16:39:46.000000000 +0400 @@ -274,16 +274,6 @@ int do_select(int n, fd_set_bits *fds, l return retval; } -static void *select_bits_alloc(int size) -{ - return kmalloc(6 * size, GFP_KERNEL); -} - -static void select_bits_free(void *bits, int size) -{ - kfree(bits); -} - /* * We can actually return ERESTARTSYS instead of EINTR, but I'd * like to be certain this leads to no problems. So I return @@ -344,7 +334,7 @@ sys_select(int n, fd_set __user *inp, fd */ ret = -ENOMEM; size = FDS_BYTES(n); - bits = select_bits_alloc(size); + bits = kmalloc(6 * size, GFP_KERNEL); if (!bits) goto out_nofds; fds.in = (unsigned long *) bits; @@ -390,7 +380,7 @@ sys_select(int n, fd_set __user *inp, fd ret = -EFAULT; out: - select_bits_free(bits, size); + kfree(bits); out_nofds: return ret; } Index: linux-kj/fs/compat.c =================================================================== --- linux-kj.orig/fs/compat.c 2005-10-28 16:25:03.000000000 +0400 +++ linux-kj/fs/compat.c 2005-10-28 16:39:46.000000000 +0400 @@ -1594,15 +1594,6 @@ void compat_set_fd_set(unsigned long nr, * This is a virtual copy of sys_select from fs/select.c and probably * should be compared to it from time to time */ -static void *select_bits_alloc(int size) -{ - return kmalloc(6 * size, GFP_KERNEL); -} - -static void select_bits_free(void *bits, int size) -{ - kfree(bits); -} /* * We can actually return ERESTARTSYS instead of EINTR, but I'd @@ -1663,7 +1654,7 @@ compat_sys_select(int n, compat_ulong_t */ ret = -ENOMEM; size = FDS_BYTES(n); - bits = select_bits_alloc(size); + bits = kmalloc(6 * size, GFP_KERNEL); if (!bits) goto out_nofds; fds.in = (unsigned long *) bits; @@ -1709,7 +1700,7 @@ compat_sys_select(int n, compat_ulong_t compat_set_fd_set(n, exp, fds.res_ex); out: - select_bits_free(bits, size); + kfree(bits); out_nofds: return ret; }