summaryrefslogtreecommitdiffstats
path: root/include/net/fq_impl.h
diff options
context:
space:
mode:
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>2022-07-09 16:37:53 +0200
committerJakub Kicinski <kuba@kernel.org>2022-07-11 19:49:38 -0700
commit2b8bf3d6c99318eae669e3098c490ba6b508fd37 (patch)
treebd1d39c65a5c5ee32130b974dcb5e8822aa1799f /include/net/fq_impl.h
parente7bde1c581e41e396ab14275793f193ffbd5b2b1 (diff)
downloadlinux-stable-2b8bf3d6c99318eae669e3098c490ba6b508fd37.tar.gz
linux-stable-2b8bf3d6c99318eae669e3098c490ba6b508fd37.tar.bz2
linux-stable-2b8bf3d6c99318eae669e3098c490ba6b508fd37.zip
net/fq_impl: Use the bitmap API to allocate bitmaps
Use bitmap_zalloc()/bitmap_free() instead of hand-writing them. It is less verbose and it improves the semantic. Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Link: https://lore.kernel.org/r/c7bf099af07eb497b02d195906ee8c11fea3b3bd.1657377335.git.christophe.jaillet@wanadoo.fr Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'include/net/fq_impl.h')
-rw-r--r--include/net/fq_impl.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/include/net/fq_impl.h b/include/net/fq_impl.h
index a5f67a2c0c73..524b510f1c68 100644
--- a/include/net/fq_impl.h
+++ b/include/net/fq_impl.h
@@ -358,8 +358,7 @@ static int fq_init(struct fq *fq, int flows_cnt)
if (!fq->flows)
return -ENOMEM;
- fq->flows_bitmap = kcalloc(BITS_TO_LONGS(fq->flows_cnt), sizeof(long),
- GFP_KERNEL);
+ fq->flows_bitmap = bitmap_zalloc(fq->flows_cnt, GFP_KERNEL);
if (!fq->flows_bitmap) {
kvfree(fq->flows);
fq->flows = NULL;
@@ -383,7 +382,7 @@ static void fq_reset(struct fq *fq,
kvfree(fq->flows);
fq->flows = NULL;
- kfree(fq->flows_bitmap);
+ bitmap_free(fq->flows_bitmap);
fq->flows_bitmap = NULL;
}