lkml.org 
[lkml]   [2020]   [Dec]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] drm/komeda: use bitmap API to convert U32 to bitmap
Date
The commit be3e477effba636ad25 ("drm/komeda: Fix bit
check to import to value of proper type") fixes possible
out-of-bound issue related to find_first_bit() usage, but
does not address the endianness problem.

We can use bitmap_from_arr32() here.

Since I have no hardware, the patch is compile-testes only.
Carsten, could you please test it and consider including into
your tree?

Signed-off-by: Yury Norov <yury.norov@gmail.com>
---
drivers/gpu/drm/arm/display/komeda/komeda_pipeline.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_pipeline.c b/drivers/gpu/drm/arm/display/komeda/komeda_pipeline.c
index 719a79728e24..27968215e41d 100644
--- a/drivers/gpu/drm/arm/display/komeda/komeda_pipeline.c
+++ b/drivers/gpu/drm/arm/display/komeda/komeda_pipeline.c
@@ -136,11 +136,12 @@ struct komeda_component *
komeda_pipeline_get_first_component(struct komeda_pipeline *pipe,
u32 comp_mask)
{
+ DECLARE_BITMAP(comp_mask_local, 32);
struct komeda_component *c = NULL;
- unsigned long comp_mask_local = (unsigned long)comp_mask;
int id;

- id = find_first_bit(&comp_mask_local, 32);
+ bitmap_from_arr32(comp_mask_local, &comp_mask, 32);
+ id = find_first_bit(comp_mask_local, 32);
if (id < 32)
c = komeda_pipeline_get_component(pipe, id);

--
2.25.1
\
 
 \ /
  Last update: 2020-12-29 00:26    [W:0.054 / U:0.380 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site