Skip to content

Commit 5cdfcfa

Browse files
nunojsadNechita
authored andcommitted
local-mmap: fix -Wsign-compare
__builtin_popcountl() returns int and nb_blocks is unsigned which means -Wsign-compare. In theory, it should be an harmless warning but let's still shut it down and cast nb_blocks (which should never be < 0) to int. Signed-off-by: Nuno Sa <noname.nuno@gmail.com>
1 parent d59b548 commit 5cdfcfa

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

local-mmap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ local_create_mmap_block(struct iio_buffer_pdata *pdata,
113113
goto out_free_priv;
114114
}
115115

116-
if (__builtin_popcountl(ppdata->mmap_block_mask) == ppdata->nb_blocks) {
116+
if (__builtin_popcountl(ppdata->mmap_block_mask) == (int) ppdata->nb_blocks) {
117117
/* All our allocated blocks are used; we need to create one more. */
118118
priv->idx = ppdata->nb_blocks;
119119
req.id = 0;

0 commit comments

Comments
 (0)