[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20201228194343.88880-1-yury.norov@gmail.com>
Date: Mon, 28 Dec 2020 11:43:43 -0800
From: Yury Norov <yury.norov@...il.com>
To: Carsten Haitzler <carsten.haitzler@....com>,
Liviu Dudau <liviu.dudau@....com>, linux-kernel@...r.kernel.org
Cc: Yury Norov <yury.norov@...il.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Rasmus Villemoes <rasmus.villemoes@...vas.dk>
Subject: [PATCH] drm/komeda: use bitmap API to convert U32 to bitmap
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@...il.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
Powered by blists - more mailing lists