Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/external/bsd/drm2/include/linux Dinky hash_32.



details:   https://anonhg.NetBSD.org/src/rev/840c27b024ff
branches:  trunk
changeset: 1028003:840c27b024ff
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun Dec 19 01:34:46 2021 +0000

description:
Dinky hash_32.

diffstat:

 sys/external/bsd/drm2/include/linux/hash.h |  8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diffs (20 lines):

diff -r 9374b86ba19f -r 840c27b024ff sys/external/bsd/drm2/include/linux/hash.h
--- a/sys/external/bsd/drm2/include/linux/hash.h        Sun Dec 19 01:34:39 2021 +0000
+++ b/sys/external/bsd/drm2/include/linux/hash.h        Sun Dec 19 01:34:46 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: hash.h,v 1.2 2014/03/18 18:20:43 riastradh Exp $       */
+/*     $NetBSD: hash.h,v 1.3 2021/12/19 01:34:46 riastradh Exp $       */
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -43,4 +43,10 @@
        return ((value * factor) >> ((CHAR_BIT * sizeof(value)) - bits));
 }
 
+static inline uint32_t
+hash_32(uint32_t value, unsigned int bits)
+{
+       return (value * 0x61c88647) >> (32 - bits);
+}
+
 #endif  /* _LINUX_HASH_H_ */



Home | Main Index | Thread Index | Old Index