* Significance Of sort() In include/linux/sort.h
@ 2008-06-18 18:39 Soumyadip Das Mahapatra
2008-06-18 19:00 ` Valdis.Kletnieks
2008-06-18 19:12 ` Randy Dunlap
0 siblings, 2 replies; 3+ messages in thread
From: Soumyadip Das Mahapatra @ 2008-06-18 18:39 UTC (permalink / raw)
To: linux-kernel
Hello everybody,
I dont understand what is the significance of keeping
include/linux/sort.h and lib/sort.c while i think there is
none using (#include<linux/sort.h>) it. Can anyone explaint it?
Thanks :-)
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Significance Of sort() In include/linux/sort.h
2008-06-18 18:39 Significance Of sort() In include/linux/sort.h Soumyadip Das Mahapatra
@ 2008-06-18 19:00 ` Valdis.Kletnieks
2008-06-18 19:12 ` Randy Dunlap
1 sibling, 0 replies; 3+ messages in thread
From: Valdis.Kletnieks @ 2008-06-18 19:00 UTC (permalink / raw)
To: Soumyadip Das Mahapatra; +Cc: linux-kernel
[-- Attachment #1: Type: text/plain, Size: 2979 bytes --]
On Wed, 18 Jun 2008 20:39:38 +0200, Soumyadip Das Mahapatra said:
> Hello everybody,
> I dont understand what is the significance of keeping
> include/linux/sort.h and lib/sort.c while i think there is
> none using (#include<linux/sort.h>) it. Can anyone explaint it?
Huh? Am I missing something here?
[/usr/src/linux-2.6] find . -name '*.[ch]' | xargs grep linux/sort
./arch/x86/kernel/setup_64.c:#include <linux/sort.h>
./arch/x86/kernel/mmconf-fam10h_64.c:#include <linux/sort.h>
./arch/x86/kernel/test_nx.c:#include <linux/sort.h>
./arch/sparc/prom/memory.c:#include <linux/sort.h>
./arch/sparc64/mm/init.c:#include <linux/sort.h>
./arch/powerpc/kernel/module_32.c:#include <linux/sort.h>
./arch/powerpc/kernel/module_64.c:#include <linux/sort.h>
./arch/ia64/mm/extable.c:#include <linux/sort.h>
./kernel/cgroup.c:#include <linux/sort.h>
./kernel/cpuset.c:#include <linux/sort.h>
./kernel/lockdep_proc.c:#include <linux/sort.h>
./drivers/net/pppol2tp.c:#include <linux/sort.h>
./drivers/media/video/saa7134/saa7134-video.c:#include <linux/sort.h>
./drivers/media/video/v4l2-int-device.c:#include <linux/sort.h>
./drivers/message/fusion/mptfc.c:#include <linux/sort.h>
./lib/extable.c:#include <linux/sort.h>
./lib/sort.c:#include <linux/sort.h>
./fs/nfs_common/nfsacl.c:#include <linux/sort.h>
./fs/gfs2/glock.c:#include <linux/sort.h>
./fs/gfs2/inode.c:#include <linux/sort.h>
./fs/gfs2/quota.c:#include <linux/sort.h>
./fs/gfs2/dir.c:#include <linux/sort.h>
./fs/xfs/linux-2.6/xfs_linux.h:#include <linux/sort.h>
./mm/page_alloc.c:#include <linux/sort.h>
Lotta includes of the header. And does anybody use the one function in it?
[/usr/src/linux-2.6] find . -name '*.c' | xargs grep 'sort(' | wc
66 376 5054
[/usr/src/linux-2.6] find . -name '*.c' | xargs grep '[ ]sort(' | head
./arch/x86/kernel/mmconf-fam10h_64.c: sort(range, hi_mmio_num, sizeof(struct range), cmp_range, NULL);
./arch/sparc/prom/memory.c: sort(sp_banks, num_ents, sizeof(struct sparc_phys_banks),
./arch/sparc64/mm/init.c: sort(regs, ents, sizeof(struct linux_prom64_registers),
./arch/sparc64/mm/init.c: sort(prom_trans, ents, sizeof(struct linux_prom_translation),
./arch/powerpc/kernel/module_32.c: sort((void *)hdr + sechdrs[i].sh_offset,
./arch/powerpc/kernel/module_64.c: sort((void *)sechdrs[i].sh_addr,
./arch/ia64/mm/extable.c: sort(start, finish - start, sizeof(struct exception_table_entry),
./kernel/cgroup.c: sort(pidarray, npids, sizeof(pid_t), cmppid, NULL);
./kernel/lockdep_proc.c: sort(data->stats, data->iter_end - data->iter,
./drivers/media/video/saa7134/saa7134-video.c: sort(col, cols, sizeof col[0], cliplist_cmp, NULL);
Looks like people call it too. OK, I admit I haven't gone and checked
whether all of those have #ifdef-0 magic around them that render them dead code,
but I suspect lots of them are live code...
What made you think it wasn't used?
[-- Attachment #2: Type: application/pgp-signature, Size: 226 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Significance Of sort() In include/linux/sort.h
2008-06-18 18:39 Significance Of sort() In include/linux/sort.h Soumyadip Das Mahapatra
2008-06-18 19:00 ` Valdis.Kletnieks
@ 2008-06-18 19:12 ` Randy Dunlap
1 sibling, 0 replies; 3+ messages in thread
From: Randy Dunlap @ 2008-06-18 19:12 UTC (permalink / raw)
To: Soumyadip Das Mahapatra; +Cc: linux-kernel
On Wed, 18 Jun 2008 20:39:38 +0200 (CEST) Soumyadip Das Mahapatra wrote:
> Hello everybody,
> I dont understand what is the significance of keeping
> include/linux/sort.h and lib/sort.c while i think there is
> none using (#include<linux/sort.h>) it. Can anyone explaint it?
Did you check all of these?
./drivers/message/fusion/mptfc.c:56:#include <linux/sort.h>
./drivers/net/pppol2tp.c:92:#include <linux/sort.h>
./drivers/media/video/saa7134/saa7134-video.c:28:#include <linux/sort.h>
./drivers/media/video/v4l2-int-device.c:27:#include <linux/sort.h>
./fs/gfs2/glock.c:16:#include <linux/sort.h>
./fs/gfs2/dir.c:59:#include <linux/sort.h>
./fs/gfs2/quota.c:44:#include <linux/sort.h>
./fs/gfs2/inode.c:16:#include <linux/sort.h>
./fs/ubifs/find.c:29:#include <linux/sort.h>
./fs/nfs_common/nfsacl.c:28:#include <linux/sort.h>
./lib/extable.c:14:#include <linux/sort.h>
./arch/sparc/prom/memory.c:9:#include <linux/sort.h>
./arch/x86/kernel/test_nx.c:13:#include <linux/sort.h>
./arch/x86/kernel/mmconf-fam10h_64.c:11:#include <linux/sort.h>
./arch/x86/kernel/setup_64.c:44:#include <linux/sort.h>
./arch/x86/kernel/cpu/mtrr/main.c:40:#include <linux/sort.h>
./arch/sparc64/mm/init.c:25:#include <linux/sort.h>
./arch/powerpc/kernel/module_64.c:27:#include <linux/sort.h>
./arch/powerpc/kernel/module_32.c:27:#include <linux/sort.h>
./arch/ia64/mm/extable.c:8:#include <linux/sort.h>
./kernel/lockdep_proc.c:20:#include <linux/sort.h>
./kernel/cpuset.c:52:#include <linux/sort.h>
./kernel/cgroup.c:43:#include <linux/sort.h>
./mm/page_alloc.c:42:#include <linux/sort.h>
---
~Randy
Linux Plumbers Conference, 17-19 September 2008, Portland, Oregon USA
http://linuxplumbersconf.org/
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-06-18 19:12 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-18 18:39 Significance Of sort() In include/linux/sort.h Soumyadip Das Mahapatra
2008-06-18 19:00 ` Valdis.Kletnieks
2008-06-18 19:12 ` Randy Dunlap
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.