From nobody Thu Oct 2 18:34:36 2025 Received: from mail-10630.protonmail.ch (mail-10630.protonmail.ch [79.135.106.30]) (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 9CE352BE05F; Sat, 13 Sep 2025 16:13:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=79.135.106.30 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757779984; cv=none; b=HrfJF9nTFUdpFGs8gTj0n6Ec+Egomjgi7dw+ORolxj47sI0+bDNpLZ/OL0blT8tFMmq9gY8q7z+syUhrYss2Wg5Ra3k/bli3iHa4PyNSIzc7KgIMRHwBSrNT8Jbu9vvqEeIyNfcKoC/R5cAS3pf7XxDCaFt5eZQuKAJZeqBKXCw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757779984; c=relaxed/simple; bh=MuOPTDgQU29247DLgY8+Lmyrxez7rrt9iyp3vKghqp0=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=aNLMzV7000UvHDqwmryrRcFD+o9EakrbWfyXY8/uW+r/12LREg4daX56PcZrD+St61Yr88J3lPAVHHhzRad8o9SsexDCuid8PS45s1ev8fDBZ17A21N8sjr7+eLTYsG8ILFN7hyzBxBzgwTouf+OGlT6k5nP89GMNSEqetfSdqc= 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=b+dgBnBA; arc=none smtp.client-ip=79.135.106.30 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="b+dgBnBA" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1757779979; x=1758039179; bh=DVoGha/incWcNsAyXcYxtSakFRN5uHI6li9pSOPUlhc=; 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=b+dgBnBAdYiEhr2DzQXP1fBwGw6setLzJEDt6Y0B9frePGdlbmbDVPNh3TCtzrL52 c5xiB0t7ivjft+feyicAo/q1RvFsDfcw/rhik8h2fossuurd/srH3FlfVeK8taQ3kT crU0CRpUi3vLKml+y/qbptXIOj1MnJOng5QhL0HVXbT6Z0N1qPWLEwHd88wVwaykYf sdQBMKih/UwzKMDiUDptBPoU4OQ3mXy1zmwjIpZO3zaA9n9BmcRT/lGHFB+EgBdeB1 dUUavY81+/KIOroFS2OAdRhl9vbVrsWq5GSCQ6cOxgK+tK2w0z98SRmiLeN4Xr2JVA NBGIAy5JAO/jw== Date: Sat, 13 Sep 2025 16:12:54 +0000 To: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org From: Rahul Rameshbabu Cc: Jiri Kosina , a.hindborg@kernel.org, alex.gaynor@gmail.com, aliceryhl@google.com, benno.lossin@proton.me, Benjamin Tissoires , bjorn3_gh@protonmail.com, boqun.feng@gmail.com, dakr@kernel.org, db48x@db48x.net, gary@garyguo.net, ojeda@kernel.org, tmgross@umich.edu, peter.hutterer@who-t.net, Rahul Rameshbabu Subject: [PATCH v3 RESEND RESEND 1/3] HID: core: Change hid_driver to use a const char* for name Message-ID: <20250913161222.3889-2-sergeantsagara@protonmail.com> In-Reply-To: <20250913161222.3889-1-sergeantsagara@protonmail.com> References: <20250913161222.3889-1-sergeantsagara@protonmail.com> Feedback-ID: 26003777:user:proton X-Pm-Message-ID: 7a44fdbd84a01e3d90b6cdc77a694e065a18ca5d Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 difficult 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 { - char *name; + const char *name; const struct hid_device_id *id_table; =20 struct list_head dyn_list; --=20 2.47.2