Skip to content

Commit

Permalink
net, lib: kill arch_fast_hash library bits
Browse files Browse the repository at this point in the history
As there are now no remaining users of arch_fast_hash(), lets kill
it entirely.

This basically reverts commit 71ae8aa ("lib: introduce arch
optimized hash library") and follow-up work, that is f.e., commit
2372175 ("lib: hash: follow-up fixups for arch hash"),
commit e3fec2f ("lib: Add missing arch generic-y entries for
asm-generic/hash.h") and last but not least commit 6a02652
("perf tools: Fix include for non x86 architectures").

Cc: Francesco Fusco <[email protected]>
Cc: Thomas Graf <[email protected]>
Cc: Arnaldo Carvalho de Melo <[email protected]>
Signed-off-by: Daniel Borkmann <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Daniel Borkmann authored and davem330 committed Dec 10, 2014
1 parent 8754589 commit 0cb6c96
Show file tree
Hide file tree
Showing 36 changed files with 2 additions and 218 deletions.
1 change: 0 additions & 1 deletion arch/alpha/include/asm/Kbuild
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
generic-y += clkdev.h
generic-y += cputime.h
generic-y += exec.h
generic-y += hash.h
generic-y += irq_work.h
generic-y += mcs_spinlock.h
generic-y += preempt.h
Expand Down
1 change: 0 additions & 1 deletion arch/arc/include/asm/Kbuild
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ generic-y += fb.h
generic-y += fcntl.h
generic-y += ftrace.h
generic-y += hardirq.h
generic-y += hash.h
generic-y += hw_irq.h
generic-y += ioctl.h
generic-y += ioctls.h
Expand Down
1 change: 0 additions & 1 deletion arch/arm/include/asm/Kbuild
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ generic-y += current.h
generic-y += emergency-restart.h
generic-y += errno.h
generic-y += exec.h
generic-y += hash.h
generic-y += ioctl.h
generic-y += ipcbuf.h
generic-y += irq_regs.h
Expand Down
1 change: 0 additions & 1 deletion arch/arm64/include/asm/Kbuild
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ generic-y += early_ioremap.h
generic-y += emergency-restart.h
generic-y += errno.h
generic-y += ftrace.h
generic-y += hash.h
generic-y += hw_irq.h
generic-y += ioctl.h
generic-y += ioctls.h
Expand Down
1 change: 0 additions & 1 deletion arch/avr32/include/asm/Kbuild
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ generic-y += div64.h
generic-y += emergency-restart.h
generic-y += exec.h
generic-y += futex.h
generic-y += hash.h
generic-y += irq_regs.h
generic-y += irq_work.h
generic-y += local.h
Expand Down
1 change: 0 additions & 1 deletion arch/blackfin/include/asm/Kbuild
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ generic-y += emergency-restart.h
generic-y += errno.h
generic-y += fb.h
generic-y += futex.h
generic-y += hash.h
generic-y += hw_irq.h
generic-y += ioctl.h
generic-y += ipcbuf.h
Expand Down
1 change: 0 additions & 1 deletion arch/c6x/include/asm/Kbuild
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ generic-y += exec.h
generic-y += fb.h
generic-y += fcntl.h
generic-y += futex.h
generic-y += hash.h
generic-y += hw_irq.h
generic-y += io.h
generic-y += ioctl.h
Expand Down
1 change: 0 additions & 1 deletion arch/cris/include/asm/Kbuild
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ generic-y += barrier.h
generic-y += clkdev.h
generic-y += cputime.h
generic-y += exec.h
generic-y += hash.h
generic-y += irq_work.h
generic-y += kvm_para.h
generic-y += linkage.h
Expand Down
1 change: 0 additions & 1 deletion arch/frv/include/asm/Kbuild
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
generic-y += clkdev.h
generic-y += cputime.h
generic-y += exec.h
generic-y += hash.h
generic-y += irq_work.h
generic-y += mcs_spinlock.h
generic-y += preempt.h
Expand Down
1 change: 0 additions & 1 deletion arch/hexagon/include/asm/Kbuild
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ generic-y += fb.h
generic-y += fcntl.h
generic-y += ftrace.h
generic-y += hardirq.h
generic-y += hash.h
generic-y += hw_irq.h
generic-y += ioctl.h
generic-y += ioctls.h
Expand Down
1 change: 0 additions & 1 deletion arch/ia64/include/asm/Kbuild
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@

generic-y += clkdev.h
generic-y += exec.h
generic-y += hash.h
generic-y += irq_work.h
generic-y += kvm_para.h
generic-y += mcs_spinlock.h
Expand Down
1 change: 0 additions & 1 deletion arch/m32r/include/asm/Kbuild
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
generic-y += clkdev.h
generic-y += cputime.h
generic-y += exec.h
generic-y += hash.h
generic-y += irq_work.h
generic-y += mcs_spinlock.h
generic-y += module.h
Expand Down
1 change: 0 additions & 1 deletion arch/m68k/include/asm/Kbuild
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ generic-y += device.h
generic-y += emergency-restart.h
generic-y += errno.h
generic-y += exec.h
generic-y += hash.h
generic-y += hw_irq.h
generic-y += ioctl.h
generic-y += ipcbuf.h
Expand Down
1 change: 0 additions & 1 deletion arch/metag/include/asm/Kbuild
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ generic-y += fb.h
generic-y += fcntl.h
generic-y += futex.h
generic-y += hardirq.h
generic-y += hash.h
generic-y += hw_irq.h
generic-y += ioctl.h
generic-y += ioctls.h
Expand Down
1 change: 0 additions & 1 deletion arch/microblaze/include/asm/Kbuild
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ generic-y += clkdev.h
generic-y += cputime.h
generic-y += device.h
generic-y += exec.h
generic-y += hash.h
generic-y += irq_work.h
generic-y += mcs_spinlock.h
generic-y += preempt.h
Expand Down
1 change: 0 additions & 1 deletion arch/mips/include/asm/Kbuild
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ generic-y += cputime.h
generic-y += current.h
generic-y += dma-contiguous.h
generic-y += emergency-restart.h
generic-y += hash.h
generic-y += irq_work.h
generic-y += local64.h
generic-y += mcs_spinlock.h
Expand Down
1 change: 0 additions & 1 deletion arch/mn10300/include/asm/Kbuild
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ generic-y += barrier.h
generic-y += clkdev.h
generic-y += cputime.h
generic-y += exec.h
generic-y += hash.h
generic-y += irq_work.h
generic-y += mcs_spinlock.h
generic-y += preempt.h
Expand Down
1 change: 0 additions & 1 deletion arch/openrisc/include/asm/Kbuild
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ generic-y += fcntl.h
generic-y += ftrace.h
generic-y += futex.h
generic-y += hardirq.h
generic-y += hash.h
generic-y += hw_irq.h
generic-y += ioctl.h
generic-y += ioctls.h
Expand Down
1 change: 0 additions & 1 deletion arch/parisc/include/asm/Kbuild
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ generic-y += device.h
generic-y += div64.h
generic-y += emergency-restart.h
generic-y += exec.h
generic-y += hash.h
generic-y += hw_irq.h
generic-y += irq_regs.h
generic-y += irq_work.h
Expand Down
1 change: 0 additions & 1 deletion arch/powerpc/include/asm/Kbuild
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@

generic-y += clkdev.h
generic-y += hash.h
generic-y += irq_work.h
generic-y += mcs_spinlock.h
generic-y += preempt.h
Expand Down
1 change: 0 additions & 1 deletion arch/s390/include/asm/Kbuild
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@


generic-y += clkdev.h
generic-y += hash.h
generic-y += irq_work.h
generic-y += mcs_spinlock.h
generic-y += preempt.h
Expand Down
1 change: 0 additions & 1 deletion arch/score/include/asm/Kbuild
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ header-y +=
generic-y += barrier.h
generic-y += clkdev.h
generic-y += cputime.h
generic-y += hash.h
generic-y += irq_work.h
generic-y += mcs_spinlock.h
generic-y += preempt.h
Expand Down
1 change: 0 additions & 1 deletion arch/sh/include/asm/Kbuild
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ generic-y += emergency-restart.h
generic-y += errno.h
generic-y += exec.h
generic-y += fcntl.h
generic-y += hash.h
generic-y += ioctl.h
generic-y += ipcbuf.h
generic-y += irq_regs.h
Expand Down
1 change: 0 additions & 1 deletion arch/sparc/include/asm/Kbuild
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ generic-y += cputime.h
generic-y += div64.h
generic-y += emergency-restart.h
generic-y += exec.h
generic-y += hash.h
generic-y += irq_regs.h
generic-y += irq_work.h
generic-y += linkage.h
Expand Down
1 change: 0 additions & 1 deletion arch/tile/include/asm/Kbuild
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ generic-y += errno.h
generic-y += exec.h
generic-y += fb.h
generic-y += fcntl.h
generic-y += hash.h
generic-y += hw_irq.h
generic-y += ioctl.h
generic-y += ioctls.h
Expand Down
1 change: 0 additions & 1 deletion arch/um/include/asm/Kbuild
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ generic-y += exec.h
generic-y += ftrace.h
generic-y += futex.h
generic-y += hardirq.h
generic-y += hash.h
generic-y += hw_irq.h
generic-y += io.h
generic-y += irq_regs.h
Expand Down
1 change: 0 additions & 1 deletion arch/unicore32/include/asm/Kbuild
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ generic-y += fcntl.h
generic-y += ftrace.h
generic-y += futex.h
generic-y += hardirq.h
generic-y += hash.h
generic-y += hw_irq.h
generic-y += ioctl.h
generic-y += ioctls.h
Expand Down
7 changes: 0 additions & 7 deletions arch/x86/include/asm/hash.h

This file was deleted.

2 changes: 1 addition & 1 deletion arch/x86/lib/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ lib-y += memcpy_$(BITS).o
lib-$(CONFIG_RWSEM_XCHGADD_ALGORITHM) += rwsem.o
lib-$(CONFIG_INSTRUCTION_DECODER) += insn.o inat.o

obj-y += msr.o msr-reg.o msr-reg-export.o hash.o
obj-y += msr.o msr-reg.o msr-reg-export.o

ifeq ($(CONFIG_X86_32),y)
obj-y += atomic64_32.o
Expand Down
92 changes: 0 additions & 92 deletions arch/x86/lib/hash.c

This file was deleted.

1 change: 0 additions & 1 deletion arch/xtensa/include/asm/Kbuild
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ generic-y += errno.h
generic-y += exec.h
generic-y += fcntl.h
generic-y += hardirq.h
generic-y += hash.h
generic-y += ioctl.h
generic-y += irq_regs.h
generic-y += irq_work.h
Expand Down
9 changes: 0 additions & 9 deletions include/asm-generic/hash.h

This file was deleted.

35 changes: 0 additions & 35 deletions include/linux/hash.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
*/

#include <asm/types.h>
#include <asm/hash.h>
#include <linux/compiler.h>

/* 2^31 + 2^29 - 2^25 + 2^22 - 2^19 - 2^16 + 1 */
Expand Down Expand Up @@ -84,38 +83,4 @@ static inline u32 hash32_ptr(const void *ptr)
return (u32)val;
}

struct fast_hash_ops {
u32 (*hash)(const void *data, u32 len, u32 seed);
u32 (*hash2)(const u32 *data, u32 len, u32 seed);
};

/**
* arch_fast_hash - Caclulates a hash over a given buffer that can have
* arbitrary size. This function will eventually use an
* architecture-optimized hashing implementation if
* available, and trades off distribution for speed.
*
* @data: buffer to hash
* @len: length of buffer in bytes
* @seed: start seed
*
* Returns 32bit hash.
*/
extern u32 arch_fast_hash(const void *data, u32 len, u32 seed);

/**
* arch_fast_hash2 - Caclulates a hash over a given buffer that has a
* size that is of a multiple of 32bit words. This
* function will eventually use an architecture-
* optimized hashing implementation if available,
* and trades off distribution for speed.
*
* @data: buffer to hash (must be 32bit padded)
* @len: number of 32bit words
* @seed: start seed
*
* Returns 32bit hash.
*/
extern u32 arch_fast_hash2(const u32 *data, u32 len, u32 seed);

#endif /* _LINUX_HASH_H */
2 changes: 1 addition & 1 deletion lib/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ obj-y += bcd.o div64.o sort.o parser.o halfmd4.o debug_locks.o random32.o \
bust_spinlocks.o hexdump.o kasprintf.o bitmap.o scatterlist.o \
gcd.o lcm.o list_sort.o uuid.o flex_array.o iovec.o clz_ctz.o \
bsearch.o find_last_bit.o find_next_bit.o llist.o memweight.o kfifo.o \
percpu-refcount.o percpu_ida.o hash.o rhashtable.o reciprocal_div.o
percpu-refcount.o percpu_ida.o rhashtable.o reciprocal_div.o
obj-y += string_helpers.o
obj-$(CONFIG_TEST_STRING_HELPERS) += test-string_helpers.o
obj-y += kstrtox.o
Expand Down
Loading

0 comments on commit 0cb6c96

Please sign in to comment.