#ifndef _ASM_GENERIC_BITOPS_FFS_H_
#define _ASM_GENERIC_BITOPS_FFS_H_

/**
 * ffs - find first bit set
 * @x: the word to search
 *
 * This is defined the same way as
 * the libc and compiler builtin ffs routines, therefore
 * differs in spirit from the above ffz (man ffs).
 */
static inline int ffs(int x)
{
	int r = 1;

	if (!x)
		return 0;
	if (!(x & 0xffff)) {
		x >>= 16;
		r += 16;
	}
	if (!(x & 0xff)) {
		x >>= 8;
		r += 8;
	}
	if (!(x & 0xf)) {
		x >>= 4;
		r += 4;
	}
	if (!(x & 3)) {
		x >>= 2;
		r += 2;
	}
	if (!(x & 1)) {
		x >>= 1;
		r += 1;
	}
	return r;
}

#endif /* _ASM_GENERIC_BITOPS_FFS_H_ */
owspan='2'><a href='/cgit.cgi/'><img src='/cgit.png' alt='cgit logo'/></a></td>
<td class='main'><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='62f01db9cf830957931f811d4da5f2bc34ce92f4'/><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=62f01db9cf830957931f811d4da5f2bc34ce92f4'>refs</a><a class='active' href='/cgit.cgi/linux/net-next.git/log/sound/soc/mediatek/mt8173'>log</a><a href='/cgit.cgi/linux/net-next.git/tree/sound/soc/mediatek/mt8173?id=62f01db9cf830957931f811d4da5f2bc34ce92f4'>tree</a><a href='/cgit.cgi/linux/net-next.git/commit/sound/soc/mediatek/mt8173?id=62f01db9cf830957931f811d4da5f2bc34ce92f4'>commit</a><a href='/cgit.cgi/linux/net-next.git/diff/sound/soc/mediatek/mt8173?id=62f01db9cf830957931f811d4da5f2bc34ce92f4'>diff</a></td><td class='form'><form class='right' method='get' action='/cgit.cgi/linux/net-next.git/log/sound/soc/mediatek/mt8173'>
<input type='hidden' name='id' value='62f01db9cf830957931f811d4da5f2bc34ce92f4'/><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=62f01db9cf830957931f811d4da5f2bc34ce92f4'>root</a>/<a href='/cgit.cgi/linux/net-next.git/log/sound?id=62f01db9cf830957931f811d4da5f2bc34ce92f4'>sound</a>/<a href='/cgit.cgi/linux/net-next.git/log/sound/soc?id=62f01db9cf830957931f811d4da5f2bc34ce92f4'>soc</a>/<a href='/cgit.cgi/linux/net-next.git/log/sound/soc/mediatek?id=62f01db9cf830957931f811d4da5f2bc34ce92f4'>mediatek</a>/<a href='/cgit.cgi/linux/net-next.git/log/sound/soc/mediatek/mt8173?id=62f01db9cf830957931f811d4da5f2bc34ce92f4'>mt8173</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/sound/soc/mediatek/mt8173?id=62f01db9cf830957931f811d4da5f2bc34ce92f4&amp;showmsg=1'>Expand</a>)</th><th class='left'>Author</th><th class='left'>Files</th><th class='left'>Lines</th></tr>