Merge tag 'sound-6.13-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai...
[linux.git] / arch / openrisc / include / asm / bitops / __ffs.h
blob1e224b616fdf68b33dc8b90015f621432be90a9f
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 /*
3 * OpenRISC Linux
5 * Copyright (C) 2010-2011 Jonas Bonn <jonas@southpole.se>
6 */
8 #ifndef __ASM_OPENRISC___FFS_H
9 #define __ASM_OPENRISC___FFS_H
12 #ifdef CONFIG_OPENRISC_HAVE_INST_FF1
14 static inline unsigned long __ffs(unsigned long x)
16 int ret;
18 __asm__ ("l.ff1 %0,%1"
19 : "=r" (ret)
20 : "r" (x));
22 return ret-1;
25 #else
26 #include <asm-generic/bitops/__ffs.h>
27 #endif
29 #endif /* __ASM_OPENRISC___FFS_H */