25 lines · c
1/* SPDX-License-Identifier: GPL-2.0 */2#ifndef __ASM_GENERIC_BITS_PER_LONG3#define __ASM_GENERIC_BITS_PER_LONG4 5#include <uapi/asm-generic/bitsperlong.h>6 7#ifdef __SIZEOF_LONG__8#define BITS_PER_LONG (__CHAR_BIT__ * __SIZEOF_LONG__)9#else10#define BITS_PER_LONG __WORDSIZE11#endif12 13#if BITS_PER_LONG != __BITS_PER_LONG14#error Inconsistent word size. Check asm/bitsperlong.h15#endif16 17#ifndef BITS_PER_LONG_LONG18#define BITS_PER_LONG_LONG 6419#endif20 21#define small_const_nbits(nbits) \22 (__builtin_constant_p(nbits) && (nbits) <= BITS_PER_LONG && (nbits) > 0)23 24#endif /* __ASM_GENERIC_BITS_PER_LONG */25