#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_ */ itory'/>
summaryrefslogtreecommitdiff
path: root/include/soc/arc/mcip.h
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2017-02-02 16:54:00 -0500
committerDavid S. Miller <davem@davemloft.net>2017-02-02 16:54:00 -0500
commite2160156bf2a7d5018e99a9993fbcdda0abac09b (patch)
tree1a70cb13dcfa7ade4c48d8a64d20543abebfb1dc /include/soc/arc/mcip.h
parent62e13097c46c69dbd7544ab2cd585ccf48f360a4 (diff)
parent6d04dfc8966019b8b0977b2cb942351f13d2b178 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
All merge conflicts were simple overlapping changes. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/soc/arc/mcip.h')
-rw-r--r--include/soc/arc/mcip.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/include/soc/arc/mcip.h b/include/soc/arc/mcip.h