From patchwork Tue Jul 30 21:35:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Patchwork-Id: 13747905 X-Patchwork-Delegate: jikos@jikos.cz Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E8B6E145FEF; Tue, 30 Jul 2024 21:36:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=159.69.126.157 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722375375; cv=none; b=ioeMqkbEs4heRhcNsjm/dHmGuL2g/ASTxXyZMeX1yk24Mrt9js7B7Ra4Bi2pNqkidseRfc0bMnybUZjNZZjoWPUg1+EgsXJ5gCpaFMuj753f6xFzukD+99bAK5HA96NTmA6z8uvU6G/Bw9FwTcKXQlGrBn6L/TtCvMi3g1AcQrQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722375375; c=relaxed/simple; bh=CuCPxz/YYLzA4evHClClTWRKVOvvMIx6m6M1HhhjvJw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=bnCTya0KaOV9WwBclluqdw1k4XOyuwDtNSRyxkQQliNfUswt0apNm733y6cN8qr/43WlnbsXTHgJOWDTPLKlqXnVRH/XE3GFXuRswqRPxAFddDVaLuU6l8VGSLL+iiAlOosEZqw8PufUgmi8ScykT7weKaZ0iqWBVAtjyeaeaq0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net; spf=pass smtp.mailfrom=weissschuh.net; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b=Gy6zEL6m; arc=none smtp.client-ip=159.69.126.157 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b="Gy6zEL6m" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1722375361; bh=CuCPxz/YYLzA4evHClClTWRKVOvvMIx6m6M1HhhjvJw=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=Gy6zEL6mvS8A/NgRcnVeeOoVl948AKfpjeRrf1UXxIUGAu3axFwTrOT8xLUbL8Cpy gITObj2lOL6F4VItRNZzjyavnGFHJpybFDoeRkpZcthyRW0C7mzVWmKkmVY3A0I7Ki ZQl8w0+uZnwrO0p5+sB0sO1vvEpfDyldYVEUlFXc= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Tue, 30 Jul 2024 23:35:57 +0200 Subject: [PATCH RFC 1/4] HID: treat fixed up report as const Precedence: bulk X-Mailing-List: linux-input@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240730-hid-const-fixup-v1-1-f667f9a653ba@weissschuh.net> References: <20240730-hid-const-fixup-v1-0-f667f9a653ba@weissschuh.net> In-Reply-To: <20240730-hid-const-fixup-v1-0-f667f9a653ba@weissschuh.net> To: Jiri Kosina , Benjamin Tissoires Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?q?Tho?= =?utf-8?q?mas_Wei=C3=9Fschuh?= X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1722375361; l=1162; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=CuCPxz/YYLzA4evHClClTWRKVOvvMIx6m6M1HhhjvJw=; b=2X4hlJon375StyoXGzTN+k5j8d3rhRDdjk6ApotaD5JDflxLk7VNkWqCo9JtsdXGpFvFnPZm9 ouBk3GCMVD9B7S2CLuOBh1fxgDAg4dTlpf9WtcA4fqns5CEtKQtLc// X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= Prepare the HID core for the ->report_fixup() callback to return const data. This will then allow the HID drivers to store their static reports in read-only memory. Signed-off-by: Thomas Weißschuh --- drivers/hid/hid-core.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index 988d0acbdf04..dc233599ae56 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c @@ -1203,6 +1203,7 @@ int hid_open_report(struct hid_device *device) { struct hid_parser *parser; struct hid_item item; + const __u8 *fixed_up; unsigned int size; __u8 *start; __u8 *buf; @@ -1232,11 +1233,11 @@ int hid_open_report(struct hid_device *device) return -ENOMEM; if (device->driver->report_fixup) - start = device->driver->report_fixup(device, buf, &size); + fixed_up = device->driver->report_fixup(device, buf, &size); else - start = buf; + fixed_up = buf; - start = kmemdup(start, size, GFP_KERNEL); + start = kmemdup(fixed_up, size, GFP_KERNEL); kfree(buf); if (start == NULL) return -ENOMEM; From patchwork Tue Jul 30 21:35:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Patchwork-Id: 13747901 X-Patchwork-Delegate: jikos@jikos.cz Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E8C4F18DF81; Tue, 30 Jul 2024 21:36:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=159.69.126.157 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722375373; cv=none; b=FdrjYkXI7z5lV663L1sy6rb++swUPvKL7zn0/YMTKMeHHH4+h8AawZ4sdfXmfz0mQtLw2Afiv8oeDeRG0oyVxhDWlQFqi8mfN0+WD1wu5jS35inx4Jz5ee+h4aAp8HvWyJ8p+1StVFttPRyJwj6EeoUOWVGY3y1Ugz1HsMIjWgA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722375373; c=relaxed/simple; bh=HqF2jZdEKGHsJTB8RCtb6VbOiiZngzSQrgnKBN4QiNQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=IV3KzcsIj5BWeHCA0sNJreqZhp5WmioXHlMdgVtp56iydBtUdSFU3nhwuz3W49CA93HM4A0DeM3VwlylTo+m4zS5wgrXgy1Lob4VhZB2EM9NeRY67pXV7f4jnKwK5ni8+c8hG8See4U8/e5Ol8/1MPXLBdlWgKqcrIklKOubqms= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net; spf=pass smtp.mailfrom=weissschuh.net; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b=UcR1fYmh; arc=none smtp.client-ip=159.69.126.157 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b="UcR1fYmh" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1722375361; bh=HqF2jZdEKGHsJTB8RCtb6VbOiiZngzSQrgnKBN4QiNQ=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=UcR1fYmhIPiLf7jSNGgsbQD5YJgGX21t74ttJmAZoGihKCoHCG1tgdoJYjB1xtmDi 6sDIQhLCymNmJbdazxZKXU8L0bT5bXe4VEvAZ9t6rJkt2uvFc2uRbX4Shmf6cmOvzx WCUW7hT6KyFrjZzqVWZ/ueDUIWJuXPm27cLPjIUE= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Tue, 30 Jul 2024 23:35:58 +0200 Subject: [PATCH RFC 2/4] HID: cmedia: directly return fixed up rdesc Precedence: bulk X-Mailing-List: linux-input@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240730-hid-const-fixup-v1-2-f667f9a653ba@weissschuh.net> References: <20240730-hid-const-fixup-v1-0-f667f9a653ba@weissschuh.net> In-Reply-To: <20240730-hid-const-fixup-v1-0-f667f9a653ba@weissschuh.net> To: Jiri Kosina , Benjamin Tissoires Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?q?Tho?= =?utf-8?q?mas_Wei=C3=9Fschuh?= X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1722375361; l=899; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=HqF2jZdEKGHsJTB8RCtb6VbOiiZngzSQrgnKBN4QiNQ=; b=gtPWFFwLa6VlvpwpvXzX9Y5A3YmU7yMB1ZFLFRqndnTDY02vBB5z4jQMMGm5xZMY3RgUQXWJR uSycQzj0cEMCUqiLNxX8nRSuaHRcKLcoDYMoftPMWEn3tdfADcBpoF/ X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= In a future patch the return type of the _report_fixup() callback will change to "const", but the "rdesc" parameter will stay non-const. Avoid constness errors in that case by not assigning to rdesc but returning directly. Signed-off-by: Thomas Weißschuh --- drivers/hid/hid-cmedia.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hid/hid-cmedia.c b/drivers/hid/hid-cmedia.c index cab42047bc99..0681d8882ac8 100644 --- a/drivers/hid/hid-cmedia.c +++ b/drivers/hid/hid-cmedia.c @@ -204,8 +204,8 @@ static __u8 *cmhid_hs100b_report_fixup(struct hid_device *hid, __u8 *rdesc, { if (*rsize == HS100B_RDESC_ORIG_SIZE) { hid_info(hid, "Fixing CMedia HS-100B report descriptor\n"); - rdesc = hs100b_rdesc_fixed; *rsize = sizeof(hs100b_rdesc_fixed); + return hs100b_rdesc_fixed; } return rdesc; } From patchwork Tue Jul 30 21:35:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Patchwork-Id: 13747902 Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CAB0A18DF8B; Tue, 30 Jul 2024 21:36:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=159.69.126.157 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722375373; cv=none; b=A5EE8VDprJKA/VcQbbodlfxiXWH+zL7WeUO3shQLuolbhhLz1BSHANyXo/Rs1DH/waunbQ01WINJkUZoacH6+HyUhQAP+Ll7/v6+uYVy5EFnMK0GUxeW9hhuIdCABtbPYQFYn7DG21EEGZZjIirx8k/uZyaXtKYar4neMn933rg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722375373; c=relaxed/simple; bh=vQHVvIEzQXkW1NLb5klOf1qnkQALOJgVLTI071IIIt8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=BL4mAKAAG+MtdXMPXSmxCjl6irhY3fNcVvbdrZ7cc0FZJt9cRbjAW9bcHZwdnU2HRgfafa+z8xlFHc4ZMEFxexCPyFf6agu9ou+cK/wQ9ZU9XwrMjIYzzyWy6lYaetIg0fGWjDzCX631sOnH6c1yILIirTEUjL6AF+cvBQylDPk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net; spf=pass smtp.mailfrom=weissschuh.net; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b=Qvp3oFnk; arc=none smtp.client-ip=159.69.126.157 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b="Qvp3oFnk" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1722375361; bh=vQHVvIEzQXkW1NLb5klOf1qnkQALOJgVLTI071IIIt8=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=Qvp3oFnkeV/d/RpHj5bv1nBJXiLlrJ65SvzzDSMb7rmTs4O4oX7JFM44vs29rDE1Q wfWGMFGyqAW8r4Jr/nQqtn0GiedoJPrI9+/Dm8pY/r3tNRgVjGkugVSFvVcgichnno 2I1GEeLlIRBEF8Mzi4L3l0kXFkcX0lb4qX7RrRKs= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Tue, 30 Jul 2024 23:35:59 +0200 Subject: [PATCH RFC 3/4] HID: change return type of report_fixup() to const Precedence: bulk X-Mailing-List: linux-input@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240730-hid-const-fixup-v1-3-f667f9a653ba@weissschuh.net> References: <20240730-hid-const-fixup-v1-0-f667f9a653ba@weissschuh.net> In-Reply-To: <20240730-hid-const-fixup-v1-0-f667f9a653ba@weissschuh.net> To: Jiri Kosina , Benjamin Tissoires Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?q?Tho?= =?utf-8?q?mas_Wei=C3=9Fschuh?= X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1722375361; l=2159; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=vQHVvIEzQXkW1NLb5klOf1qnkQALOJgVLTI071IIIt8=; b=MMeW3AAQPkKElwpHNYNMqNes0wv8iNwkNyVZykY/DhmTs3MGO4z6C8IN4pHcdVEkj8XN0GkAu 3EoqgATFA00CkIuFDMUC0hmycO6YGxP/FecjMOzuDy2iDBHc51YdyTe X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= By allowing the drivers to return a "const *" they can constify their static report arrays. This makes it clear to driver authors that the HID core will not modify those reports and they can be reused for multiple devices. Furthermore security is slightly improved as those reports are protected against accidental or malicious modifications. Signed-off-by: Thomas Weißschuh --- drivers/hid/hid-cmedia.c | 2 +- drivers/hid/hid-sensor-hub.c | 2 +- include/linux/hid.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/hid/hid-cmedia.c b/drivers/hid/hid-cmedia.c index 0681d8882ac8..d235dbedab8c 100644 --- a/drivers/hid/hid-cmedia.c +++ b/drivers/hid/hid-cmedia.c @@ -199,7 +199,7 @@ static struct hid_driver cmhid_driver = { .input_mapping = cmhid_input_mapping, }; -static __u8 *cmhid_hs100b_report_fixup(struct hid_device *hid, __u8 *rdesc, +static const __u8 *cmhid_hs100b_report_fixup(struct hid_device *hid, __u8 *rdesc, unsigned int *rsize) { if (*rsize == HS100B_RDESC_ORIG_SIZE) { diff --git a/drivers/hid/hid-sensor-hub.c b/drivers/hid/hid-sensor-hub.c index 26e93a331a51..7bd86eef6ec7 100644 --- a/drivers/hid/hid-sensor-hub.c +++ b/drivers/hid/hid-sensor-hub.c @@ -580,7 +580,7 @@ void sensor_hub_device_close(struct hid_sensor_hub_device *hsdev) } EXPORT_SYMBOL_GPL(sensor_hub_device_close); -static __u8 *sensor_hub_report_fixup(struct hid_device *hdev, __u8 *rdesc, +static const __u8 *sensor_hub_report_fixup(struct hid_device *hdev, __u8 *rdesc, unsigned int *rsize) { /* diff --git a/include/linux/hid.h b/include/linux/hid.h index 1533c9dcd3a6..8b3807609ff2 100644 --- a/include/linux/hid.h +++ b/include/linux/hid.h @@ -822,7 +822,7 @@ struct hid_driver { struct hid_usage *usage, __s32 value); void (*report)(struct hid_device *hdev, struct hid_report *report); - __u8 *(*report_fixup)(struct hid_device *hdev, __u8 *buf, + const __u8 *(*report_fixup)(struct hid_device *hdev, __u8 *buf, unsigned int *size); int (*input_mapping)(struct hid_device *hdev, From patchwork Tue Jul 30 21:36:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Patchwork-Id: 13747903 X-Patchwork-Delegate: jikos@jikos.cz Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E8BBF18B46A; Tue, 30 Jul 2024 21:36:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=159.69.126.157 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722375373; cv=none; b=Fpm1o9O05KbmJhEPtzvMqYBqlGrC2Rn7dk5YNnhXWmAKyMQzVAYl6yGFSiM8MEUAU6x1/7roy26M7p0ny10oJMBwgNPDv0GscVDZEgWXm4GBcGuqx3BqTAc91LjEckLRX3euBV95xpLyTUqWAIGeq9ejwoYCSjKjoFShiw370tI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722375373; c=relaxed/simple; bh=LHZUnDmwFmh2fmeCMgokisCrnfbDNiATUFJWQDX71ZM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=T3yCnCoR6VMyyUXL/+isenuVzs5T/V+rH+t1iv0J7FgMFslkKexHoB1O17FhYiNFfRTo9FrXPaVIxndMLSGWbfHsmPFEPye3ZKEZZpoOB8SKGlk1KIGcr/MtBWe8CK2NG78w/acOm/8bviTSgDGNHVB2M4pF4SMyFkVhuMQGQ4E= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net; spf=pass smtp.mailfrom=weissschuh.net; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b=Cjk/ur9K; arc=none smtp.client-ip=159.69.126.157 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b="Cjk/ur9K" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1722375361; bh=LHZUnDmwFmh2fmeCMgokisCrnfbDNiATUFJWQDX71ZM=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=Cjk/ur9KK6sYkMPTj+0ll6/g30Z/l4RHmEuFOYose44C7XvGGUChPwiLbsptgR3Je CtIliOepImKqNCXtxVexQFPylqDznA09sdUMo+Hhwzn+K8wmomO1D9bSKkmGsLpfRI DF14UJ90gt1GFelAYX6RoI0Dbt54lDSTaQnHN2Hs= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Tue, 30 Jul 2024 23:36:00 +0200 Subject: [PATCH RFC 4/4] HID: cmedia: constify fixed up report descriptor Precedence: bulk X-Mailing-List: linux-input@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240730-hid-const-fixup-v1-4-f667f9a653ba@weissschuh.net> References: <20240730-hid-const-fixup-v1-0-f667f9a653ba@weissschuh.net> In-Reply-To: <20240730-hid-const-fixup-v1-0-f667f9a653ba@weissschuh.net> To: Jiri Kosina , Benjamin Tissoires Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?q?Tho?= =?utf-8?q?mas_Wei=C3=9Fschuh?= X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1722375361; l=864; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=LHZUnDmwFmh2fmeCMgokisCrnfbDNiATUFJWQDX71ZM=; b=afXRryW/iPaJsDa968Z+1f22FEEueZPZVceiIxetaiVJMoY0pis3DPqzzzuD8hLjKMW4hAs08 L/GU02du/FFDDqzQFmFYG3MTOW9zxs/xIRrVdk/mtanxucgsGMB38sV X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= The HID core now allows static report descriptors to be read-only, make use of it. Signed-off-by: Thomas Weißschuh --- drivers/hid/hid-cmedia.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hid/hid-cmedia.c b/drivers/hid/hid-cmedia.c index d235dbedab8c..528d7f361215 100644 --- a/drivers/hid/hid-cmedia.c +++ b/drivers/hid/hid-cmedia.c @@ -26,7 +26,7 @@ MODULE_LICENSE("GPL"); /* Fixed report descriptor of HS-100B audio chip * Bit 4 is an abolute Microphone mute usage instead of being unassigned. */ -static __u8 hs100b_rdesc_fixed[] = { +static const __u8 hs100b_rdesc_fixed[] = { 0x05, 0x0C, /* Usage Page (Consumer), */ 0x09, 0x01, /* Usage (Consumer Control), */ 0xA1, 0x01, /* Collection (Application), */