Use is_power_of_2(). Signed-off-by: Jan Blunck <jblunck@xxxxxxx> --- drivers/md/dm-snap.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) --- a/drivers/md/dm-snap.c +++ b/drivers/md/dm-snap.c @@ -391,8 +391,7 @@ static int set_chunk_size(struct dm_snap */ chunk_size = roundup(chunk_size, PAGE_SIZE >> 9); - /* Check chunk_size is a power of 2 */ - if (chunk_size & (chunk_size - 1)) { + if (!is_power_of_2(chunk_size)) { *error = "Chunk size is not a power of 2"; return -EINVAL; } -- -- dm-devel mailing list dm-devel@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/dm-devel