1. 定义如下: (include/linux/kernel.h)
#define IS_ALIGNED(x, a) (((x) & ((typeof(x))(a) - 1)) == 0)
2. 实例拆解
IS_ALIGNED(reg, map->reg_stride)
-> (((reg) & ((typeof(reg))(map->reg_stride) - 1)) == 0)
1. 定义如下: (include/linux/kernel.h)
#define IS_ALIGNED(x, a) (((x) & ((typeof(x))(a) - 1)) == 0)
2. 实例拆解
IS_ALIGNED(reg, map->reg_stride)
-> (((reg) & ((typeof(reg))(map->reg_stride) - 1)) == 0)