From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-24418.protonmail.ch (mail-24418.protonmail.ch [109.224.244.18]) (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 4A3701799F for ; Sun, 29 Jun 2025 04:51:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=109.224.244.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751172682; cv=none; b=C2kcNG47hiYG3XQwr5rx9XL1Y/p3oAEls1XpYu7fXudyJvkXTTmNrMSOAoFLD6ESePSlZTjB1mqiSJyKy16EKLKQom193QZhg7U19Nc+cs9O3rMT7nBZs006oJekemJSnEaboMTOjrqN9+aHJ0GOZb7wIK/WJd9vDBSBf9lTv2g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751172682; c=relaxed/simple; bh=Mj7SO4tqmYZznwN0Rq6W8ehsUpN5BBmAX/n/sUh0nkE=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=JexNpSP2qXvMVzwnSuHTm8QTSPwCPqCyVPaQYzxgBdxf+MIIurFqIpnITxb+65CGujox0DJ3flh5xpZYNm7yq03OxqCZ7jJtubywRcsUxVrHxOlIP0fQh00oSKjjfwdAHfzxd0UncynvQHYdu5jvKjvz//IqMyCsVTYN1908Dzk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=protonmail.com; spf=pass smtp.mailfrom=protonmail.com; dkim=pass (2048-bit key) header.d=protonmail.com header.i=@protonmail.com header.b=xXvTpMLd; arc=none smtp.client-ip=109.224.244.18 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=protonmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=protonmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=protonmail.com header.i=@protonmail.com header.b="xXvTpMLd" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1751172673; x=1751431873; bh=hXW9jkr8lqMaLGY2z0MH+sluarRt7NCbYJGIyuwPVk4=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=xXvTpMLd5g7la6UAbH3Hm27ZnvgfgrB8qvDvuMy4rcZin9E94Qk02h9oo16OO030F HjAUzrr+N7N+D7uVlPCQcB01whB9b9kT3RQ0DE7mb3D4WRoj4swcdq210OhwuCBb0/ LdUTBa9QaRiSgva+LLtxKeMnFCYDqKy32LsiIrFuQtyOj+zqZcR1Wix+HqTbNUMko3 hjC6y1Gq+oL49o0P799SHBWcsg0QQ8wTxT6ncohwTv1tSAnKnWeeNpqXRvnFLUiFVj ufOtvcUVbCLoWc3GUTiE5o0wa1q0CPg5IwolulUET2VfpBRlQqfCoL/qeWxsY1uWs0 lAT46AaCetdtA== Date: Sun, 29 Jun 2025 04:51:07 +0000 To: linux-input@vger.kernel.org, rust-for-linux@vger.kernel.org From: Rahul Rameshbabu Cc: Benjamin Tissoires , Miguel Ojeda , Alex Gaynor , Boqun Feng , Gary Guo , =?utf-8?Q?Bj=C3=B6rn_Roy_Baron?= , Benno Lossin , Andreas Hindborg , Alice Ryhl , Trevor Gross , Danilo Krummrich , Daniel Brooks , Rahul Rameshbabu Subject: [PATCH v1 1/3] HID: core: Change hid_driver to use a const char* for name Message-ID: <20250629045031.92358-3-sergeantsagara@protonmail.com> In-Reply-To: <20250629045031.92358-2-sergeantsagara@protonmail.com> References: <20250629045031.92358-2-sergeantsagara@protonmail.com> Feedback-ID: 26003777:user:proton X-Pm-Message-ID: 73f27f073a7bb02c70ce0f2be48430df9cdda8e0 Precedence: bulk X-Mailing-List: rust-for-linux@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable name is never mutated by the core HID stack. Making name a const char* simplifies passing the string from Rust to C. Otherwise, it becomes difficu= lt to pass a 'static lifetime CStr from Rust to a char*, rather than a const char= *, due to lack of guarantee that the underlying data of the CStr will not be mutated by the C code. Signed-off-by: Rahul Rameshbabu --- include/linux/hid.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/hid.h b/include/linux/hid.h index 568a9d8c749b..d65c202783da 100644 --- a/include/linux/hid.h +++ b/include/linux/hid.h @@ -816,7 +816,7 @@ struct hid_usage_id { * zero from them. */ struct hid_driver { -=09char *name; +=09const char *name; =09const struct hid_device_id *id_table; =20 =09struct list_head dyn_list; --=20 2.49.0