Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 4 Mar 2018 18:10:19 +0000 (UTC)
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r330389 - head/sys/compat/linuxkpi/common/include/linux
Message-ID:  <201803041810.w24IAJs5082863@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: hselasky
Date: Sun Mar  4 18:10:18 2018
New Revision: 330389
URL: https://svnweb.freebsd.org/changeset/base/330389

Log:
  Implement for_each_clear_bit() function macro in the LinuxKPI.
  
  MFC after:	1 week
  Submitted by:	Johannes Lundberg <johalun0@gmail.com>
  Sponsored by:	Mellanox Technologies
  Sponsored by:	Limelight Networks

Modified:
  head/sys/compat/linuxkpi/common/include/linux/bitops.h

Modified: head/sys/compat/linuxkpi/common/include/linux/bitops.h
==============================================================================
--- head/sys/compat/linuxkpi/common/include/linux/bitops.h	Sun Mar  4 18:08:21 2018	(r330388)
+++ head/sys/compat/linuxkpi/common/include/linux/bitops.h	Sun Mar  4 18:10:18 2018	(r330389)
@@ -390,6 +390,10 @@ done:
 	     (bit) < (size);					\
 	     (bit) = find_next_bit((addr), (size), (bit) + 1))
 
+#define	for_each_clear_bit(bit, addr, size) \
+	for ((bit) = find_first_zero_bit((addr), (size));		\
+	     (bit) < (size);						\
+	     (bit) = find_next_zero_bit((addr), (size), (bit) + 1))
 
 static inline uint64_t
 sign_extend64(uint64_t value, int index)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201803041810.w24IAJs5082863>