linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/komeda: use bitmap API to convert U32 to bitmap
@ 2020-12-28 19:43 Yury Norov
  2020-12-28 19:50 ` Andy Shevchenko
  0 siblings, 1 reply; 7+ messages in thread
From: Yury Norov @ 2020-12-28 19:43 UTC (permalink / raw)
  To: Carsten Haitzler, Liviu Dudau, linux-kernel
  Cc: Yury Norov, Andrew Morton, Andy Shevchenko, Rasmus Villemoes

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


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-12-29 18:28 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-28 19:43 [PATCH] drm/komeda: use bitmap API to convert U32 to bitmap Yury Norov
2020-12-28 19:50 ` Andy Shevchenko
2020-12-28 20:10   ` Yury Norov
2020-12-29 12:22     ` Carsten Haitzler
2020-12-29 13:50       ` Andy Shevchenko
2020-12-29 18:09         ` Yury Norov
2020-12-29 18:27           ` Yury Norov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).