Module Name:    src
Committed By:   riastradh
Date:           Sun Dec 19 01:34:46 UTC 2021

Modified Files:
        src/sys/external/bsd/drm2/include/linux: hash.h

Log Message:
Dinky hash_32.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/external/bsd/drm2/include/linux/hash.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/include/linux/hash.h
diff -u src/sys/external/bsd/drm2/include/linux/hash.h:1.2 src/sys/external/bsd/drm2/include/linux/hash.h:1.3
--- src/sys/external/bsd/drm2/include/linux/hash.h:1.2	Tue Mar 18 18:20:43 2014
+++ src/sys/external/bsd/drm2/include/linux/hash.h	Sun Dec 19 01:34:46 2021
@@ -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 @@ hash_long(unsigned long value, unsigned 
 	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_ */

Reply via email to