[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[dm-devel] [patch 09/11] dm-snap: use is_power_of_2()



Use is_power_of_2().

Signed-off-by: Jan Blunck <jblunck suse de>
---
 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;
 	}

-- 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]