optgroup: move debug code into function
authorJens Axboe <axboe@kernel.dk>
Tue, 20 Mar 2018 17:19:19 +0000 (11:19 -0600)
committerJens Axboe <axboe@kernel.dk>
Tue, 20 Mar 2018 17:19:19 +0000 (11:19 -0600)
The current global construct breaks on some compilers:

optgroup.c:208: error: expected identifier or '(' before 'do'
optgroup.c:208: error: expected identifier or '(' before 'while'

Reported-by: Tomohiro Kusumi <kusumi.tomohiro@gmail.com>
Fixes: 96344ff00349 ("optgroup: add check for optgroup bit numbers being within range")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
optgroup.c

index 1c418f5aa36f06064118f515e487de570b8c0cf8..04ceec7ec3a7242db72bbb07349c3cbeb6695671 100644 (file)
@@ -202,7 +202,8 @@ const struct opt_group *opt_group_from_mask(uint64_t *mask)
 
 const struct opt_group *opt_group_cat_from_mask(uint64_t *mask)
 {
+       compiletime_assert(__FIO_OPT_G_NR <= 8 * sizeof(uint64_t),
+                               "__FIO_OPT_G_NR");
+
        return group_from_mask(fio_opt_cat_groups, mask, FIO_OPT_G_INVALID);
 }
-
-compiletime_assert(__FIO_OPT_G_NR <= 8 * sizeof(uint64_t), "__FIO_OPT_G_NR");