]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
media: verisilicon: Use __set_bit() with local bitmaps
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Sun, 25 May 2025 08:11:44 +0000 (10:11 +0200)
committerHans Verkuil <hverkuil@xs4all.nl>
Fri, 20 Jun 2025 11:20:17 +0000 (13:20 +0200)
The 'used' and 'new' bitmaps are local to this function, so there is no
need to use atomic access because concurrency can not happen.

Use the non-atomic __set_bit() to save a few cycles.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
drivers/media/platform/verisilicon/hantro_h264.c

index 4e9a0ecf5c1337dccadb07bfb7e9ef8dea66a5de..2414782f1eb615c9a9166b3ca645f66d4b5e6a80 100644 (file)
@@ -325,12 +325,12 @@ static void update_dpb(struct hantro_ctx *ctx)
                                continue;
 
                        *cdpb = *ndpb;
-                       set_bit(j, used);
+                       __set_bit(j, used);
                        break;
                }
 
                if (j == ARRAY_SIZE(ctx->h264_dec.dpb))
-                       set_bit(i, new);
+                       __set_bit(i, new);
        }
 
        /* For entries that could not be matched, use remaining free slots. */
@@ -349,7 +349,7 @@ static void update_dpb(struct hantro_ctx *ctx)
 
                cdpb = &ctx->h264_dec.dpb[j];
                *cdpb = *ndpb;
-               set_bit(j, used);
+               __set_bit(j, used);
        }
 }