| /* find_next_bit.c: fallback find next bit implementation |
| * Copyright (C) 2004 Red Hat, Inc. All Rights Reserved. |
| * Written by David Howells (dhowells@redhat.com) |
| * This program is free software; you can redistribute it and/or |
| * modify it under the terms of the GNU General Public License |
| * as published by the Free Software Foundation; either version |
| * 2 of the License, or (at your option) any later version. |
| #include <linux/bitops.h> |
| int find_next_bit(const unsigned long *addr, int size, int offset) |
| const unsigned long *base; |
| const int NBITS = sizeof(*addr) * 8; |
| suboffset = offset % NBITS; |
| while ((tmp = *addr) == 0) |
| offset = (addr - base) * NBITS; |
| /* count the remaining bits without using __ffs() since that takes a 32-bit arg */ |