From patchwork Wed Aug 28 07:33:25 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: 823281 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 C67D915AADE; Wed, 28 Aug 2024 07:34:37 +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=1724830479; cv=none; b=dGLjHo5ZD2qgn4IjWo2HBfrEbzybThPhVx+cUfrXnzkJ9y0tVeNY7NpEfKsGkgrKyQpdCS7CxaETeuFZTAVLxKGwKUDBVNMaNJLlt9gzBn6LIDCmj5Uc51xuAmpw82bmdZ2X6uZfsWjnGgf5DGQXUb2ZLElTCMqkA5ZEzDZqsWo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724830479; c=relaxed/simple; bh=b0SHEar1LjwTGvnWhUaEDqZURBTUdfYfF4a/RRvIPVU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=OOY5dg98DZ2ieDEB9oSuoaEU7GkwOJ1lSdHHD1rjvJCcK7g4gpmaxwtL92HrSDuuq38OqFXQT0sC4mz03Ve/nqZsAszqbFd5mGj22GDLENTG6sOHlJvDB2cmbVfUTB41xiCnkVYtbGpLMVykEjydi02rTzFWvgTRJpLWd5kq9i4= 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=gyG156zS; 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="gyG156zS" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1724830475; bh=b0SHEar1LjwTGvnWhUaEDqZURBTUdfYfF4a/RRvIPVU=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=gyG156zSHA4PGk7BcoHQ4Iam4SCgQDnQOj+KC8mUGUZk/shFh4zJliNoIevwEn8AQ xRs8eLE5CsVrHdyhXo8YG6NhCA9g6yZBf+9BRMXqwPKF9F8vT9V0Fy37dqSiiqc7Tr swTwZlwgAyb4wcCu454Yx8mHc3jIV5uVpUqWinTM= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Wed, 28 Aug 2024 09:33:25 +0200 Subject: [PATCH 06/14] HID: xiaomi: 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: <20240828-hid-const-fixup-2-v1-6-663b9210eb69@weissschuh.net> References: <20240828-hid-const-fixup-2-v1-0-663b9210eb69@weissschuh.net> In-Reply-To: <20240828-hid-const-fixup-2-v1-0-663b9210eb69@weissschuh.net> To: Jiri Kosina , Benjamin Tissoires , Marcus Folkesson 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=1724830449; l=1338; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=b0SHEar1LjwTGvnWhUaEDqZURBTUdfYfF4a/RRvIPVU=; b=1+CZsM0eFLR+zRqBprh75hyhVhbOKluAdjArhN5Rt7lFHKQKnKVEvVEE8G33Gt+Kq576MUSr7 Cjef+krNr5nAmlJVC287juDCtvaXiMFA+FCvgLzMu4xOyfCbeyOBXhy X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= Now that the HID core can handle const report descriptors, constify them where possible. Signed-off-by: Thomas Weißschuh --- drivers/hid/hid-xiaomi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/hid/hid-xiaomi.c b/drivers/hid/hid-xiaomi.c index 035733fce2e1..ef6598550a40 100644 --- a/drivers/hid/hid-xiaomi.c +++ b/drivers/hid/hid-xiaomi.c @@ -14,7 +14,7 @@ /* Fixed Mi Silent Mouse report descriptor */ /* Button's Usage Maximum changed from 3 to 5 to make side buttons work */ #define MI_SILENT_MOUSE_ORIG_RDESC_LENGTH 87 -static __u8 mi_silent_mouse_rdesc_fixed[] = { +static const __u8 mi_silent_mouse_rdesc_fixed[] = { 0x05, 0x01, /* Usage Page (Desktop), */ 0x09, 0x02, /* Usage (Mouse), */ 0xA1, 0x01, /* Collection (Application), */ @@ -68,8 +68,8 @@ static const __u8 *xiaomi_report_fixup(struct hid_device *hdev, __u8 *rdesc, case USB_DEVICE_ID_MI_SILENT_MOUSE: if (*rsize == MI_SILENT_MOUSE_ORIG_RDESC_LENGTH) { hid_info(hdev, "fixing up Mi Silent Mouse report descriptor\n"); - rdesc = mi_silent_mouse_rdesc_fixed; *rsize = sizeof(mi_silent_mouse_rdesc_fixed); + return mi_silent_mouse_rdesc_fixed; } break; }