mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Valdis.Kletnieks@vt.edu
To: Soumyadip Das Mahapatra <kernelhacker@visualserver.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Significance Of sort() In include/linux/sort.h
Date: Wed, 18 Jun 2008 15:00:34 -0400	[thread overview]
Message-ID: <26220.1213815634@turing-police.cc.vt.edu> (raw)
In-Reply-To: Your message of "Wed, 18 Jun 2008 20:39:38 +0200." <Pine.LNX.4.64.0806152126001.6721@visualserver.org>

[-- 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 --]

  reply	other threads:[~2008-06-18 19:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-18 18:39 Soumyadip Das Mahapatra
2008-06-18 19:00 ` Valdis.Kletnieks [this message]
2008-06-18 19:12 ` Randy Dunlap

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=26220.1213815634@turing-police.cc.vt.edu \
    --to=valdis.kletnieks@vt.edu \
    --cc=kernelhacker@visualserver.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®