'drvdata->chs.guaranteed' is a bitmap. So use 'devm_bitmap_kzalloc()' to
simplify code, improve the semantic and avoid some open-coded arithmetic
in allocator arguments.
Signed-off-by: Christophe JAILLET <redacted>
---
drivers/hwtracing/coresight/coresight-stm.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
From: Joe Perches <joe@perches.com> Date: 2021-10-23 19:36:49
On Sat, 2021-10-23 at 21:24 +0200, Christophe JAILLET wrote:
'drvdata->chs.guaranteed' is a bitmap. So use 'devm_bitmap_kzalloc()' to
simplify code, improve the semantic and avoid some open-coded arithmetic
in allocator arguments.
On Sat, 2021-10-23 at 21:24 +0200, Christophe JAILLET wrote:
quoted
'drvdata->chs.guaranteed' is a bitmap. So use 'devm_bitmap_kzalloc()' to
simplify code, improve the semantic and avoid some open-coded arithmetic
in allocator arguments.
I agree, but removing it would make the line with devm_bitmap_zalloc()
86 chars. This would not be consistent with the rest of the file and
would (IMHO) require splitting.
Let see if the maintainer prefer saving one additional line of code, or
keeping the logic in place.
CJ
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Good day,
On Sat, Oct 23, 2021 at 10:09:14PM +0200, Christophe JAILLET wrote:
Le 23/10/2021 à 21:36, Joe Perches a écrit :
quoted
On Sat, 2021-10-23 at 21:24 +0200, Christophe JAILLET wrote:
quoted
'drvdata->chs.guaranteed' is a bitmap. So use 'devm_bitmap_kzalloc()' to
simplify code, improve the semantic and avoid some open-coded arithmetic
in allocator arguments.
I agree, but removing it would make the line with devm_bitmap_zalloc() 86
chars. This would not be consistent with the rest of the file and would
(IMHO) require splitting.
Let see if the maintainer prefer saving one additional line of code, or
keeping the logic in place.
I think we can get rid of @guaranteed and splitting is fine with me:
drvdata->chs.guaranteed = devm_bitmap_zalloc(dev,
drvdata->numsp,
GFP_KERNEL);
Thanks,
Mathieu