#ifndef _ASM_GENERIC_BITOPS___FFS_H_
#define _ASM_GENERIC_BITOPS___FFS_H_

#include <asm/types.h>

/**
 * __ffs - find first bit in word.
 * @word: The word to search
 *
 * Undefined if no bit exists, so code should check against 0 first.
 */
static __always_inline unsigned long __ffs(unsigned long word)
{
	int num = 0;

#if BITS_PER_LONG == 64
	if ((word & 0xffffffff) == 0) {
		num += 32;
		word >>= 32;
	}
#endif
	if ((word & 0xffff) == 0) {
		num += 16;
		word >>= 16;
	}
	if ((word & 0xff) == 0) {
		num += 8;
		word >>= 8;
	}
	if ((word & 0xf) == 0) {
		num += 4;
		word >>= 4;
	}
	if ((word & 0x3) == 0) {
		num += 2;
		word >>= 2;
	}
	if ((word & 0x1) == 0)
		num += 1;
	return num;
}

#endif /* _ASM_GENERIC_BITOPS___FFS_H_ */
><a href='/cgit.cgi/'>index</a> : <a href='/cgit.cgi/linux/net-next.git/'>net-next.git</a></td><td class='form'><form method='get'>
<input type='hidden' name='id' value='baa2d42cff088d9f962697a10e0345b444c8c409'/><input type='hidden' name='showmsg' value='1'/><select name='h' onchange='this.form.submit();'>
<option value='emaclite-cleanup'>emaclite-cleanup</option>
<option value='master' selected='selected'>master</option>
<option value='nds-private-remove'>nds-private-remove</option>
<option value='packet-loop-back'>packet-loop-back</option>
<option value='packet-rx-pump-back'>packet-rx-pump-back</option>
</select> <input type='submit' value='switch'/></form></td></tr>
<tr><td class='sub'>net-next plumbings</td><td class='sub right'>Tobias Klauser</td></tr></table>
<table class='tabs'><tr><td>
<a href='/cgit.cgi/linux/net-next.git/'>summary</a><a href='/cgit.cgi/linux/net-next.git/refs/?id=baa2d42cff088d9f962697a10e0345b444c8c409'>refs</a><a class='active' href='/cgit.cgi/linux/net-next.git/log/drivers/usb/mtu3/Makefile?showmsg=1'>log</a><a href='/cgit.cgi/linux/net-next.git/tree/drivers/usb/mtu3/Makefile?id=baa2d42cff088d9f962697a10e0345b444c8c409'>tree</a><a href='/cgit.cgi/linux/net-next.git/commit/drivers/usb/mtu3/Makefile?id=baa2d42cff088d9f962697a10e0345b444c8c409'>commit</a><a href='/cgit.cgi/linux/net-next.git/diff/drivers/usb/mtu3/Makefile?id=baa2d42cff088d9f962697a10e0345b444c8c409'>diff</a></td><td class='form'><form class='right' method='get' action='/cgit.cgi/linux/net-next.git/log/drivers/usb/mtu3/Makefile'>
<input type='hidden' name='id' value='baa2d42cff088d9f962697a10e0345b444c8c409'/><input type='hidden' name='showmsg' value='1'/><select name='qt'>
<option value='grep'>log msg</option>
<option value='author'>author</option>
<option value='committer'>committer</option>
<option value='range'>range</option>
</select>
<input class='txt' type='search' size='10' name='q' value=''/>
<input type='submit' value='search'/>
</form>
</td></tr></table>
<div class='path'>path: <a href='/cgit.cgi/linux/net-next.git/log/?id=baa2d42cff088d9f962697a10e0345b444c8c409&amp;showmsg=1'>root</a>/<a href='/cgit.cgi/linux/net-next.git/log/drivers?id=baa2d42cff088d9f962697a10e0345b444c8c409&amp;showmsg=1'>drivers</a>/<a href='/cgit.cgi/linux/net-next.git/log/drivers/usb?id=baa2d42cff088d9f962697a10e0345b444c8c409&amp;showmsg=1'>usb</a>/<a href='/cgit.cgi/linux/net-next.git/log/drivers/usb/mtu3?id=baa2d42cff088d9f962697a10e0345b444c8c409&amp;showmsg=1'>mtu3</a>/<a href='/cgit.cgi/linux/net-next.git/log/drivers/usb/mtu3/Makefile?id=baa2d42cff088d9f962697a10e0345b444c8c409&amp;showmsg=1'>Makefile</a></div><div class='content'><table class='list nowrap'><tr class='nohover'><th class='left'>Age</th><th class='left'>Commit message (<a href='/cgit.cgi/linux/net-next.git/log/drivers/usb/mtu3/Makefile?id=baa2d42cff088d9f962697a10e0345b444c8c409'>Collapse</a>)</th><th class='left'>Author</th><th class='left'>Files</th><th class='left'>Lines</th></tr>