[<prev] [next>] [day] [month] [year] [list]
Message-Id: <3ff2b491c397ba4f763fd2fbcb6795f0c33da2f3.1657568452.git.christophe.jaillet@wanadoo.fr>
Date: Mon, 11 Jul 2022 21:41:18 +0200
From: Christophe JAILLET <christophe.jaillet@...adoo.fr>
To: Jiri Kosina <jikos@...nel.org>,
Benjamin Tissoires <benjamin.tissoires@...hat.com>
Cc: linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org,
Christophe JAILLET <christophe.jaillet@...adoo.fr>,
linux-input@...r.kernel.org
Subject: [PATCH] HID: multitouch: Use the bitmap API to allocate bitmaps
Use bitmap_zalloc()/bitmap_free() instead of hand-writing them.
It is less verbose and it improves the semantic.
Signed-off-by: Christophe JAILLET <christophe.jaillet@...adoo.fr>
---
drivers/hid/hid-multitouch.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c
index 2e72922e36f5..2b19938e0fb8 100644
--- a/drivers/hid/hid-multitouch.c
+++ b/drivers/hid/hid-multitouch.c
@@ -1300,10 +1300,9 @@ static int mt_touch_input_configured(struct hid_device *hdev,
if (td->is_buttonpad)
__set_bit(INPUT_PROP_BUTTONPAD, input->propbit);
- app->pending_palm_slots = devm_kcalloc(&hi->input->dev,
- BITS_TO_LONGS(td->maxcontacts),
- sizeof(long),
- GFP_KERNEL);
+ app->pending_palm_slots = devm_bitmap_zalloc(&hi->input->dev,
+ td->maxcontacts,
+ GFP_KERNEL);
if (!app->pending_palm_slots)
return -ENOMEM;
--
2.34.1
Powered by blists - more mailing lists