From nobody Fri Apr 3 04:51:27 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 A0A1C3168F6; Tue, 17 Feb 2026 22:25:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771367124; cv=none; b=KeTvCLDaJNGoaHe/5ttpSgZtbJG89/Ot4jGjPxtG1eYFnCpCN3UAz0NmKmsa3g6NOu0MqGHZYZFfud3k1EIAAoieojtWJefC9Cal+Ane6+85Jj7MlmYH0KEH3JSf4wHP03Er8SJPLE174MGyMt+Ro+Wkcn03U6YVsVXYTLL9a4Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771367124; c=relaxed/simple; bh=0G2Wu+ork4b43/V01ieIEc5auZF0HDjfDOooAbQRvMM=; h=Message-ID:Date:MIME-Version:Subject:From:To:Cc:References: In-Reply-To:Content-Type; b=EUh1YefRn1eKUdemgT9InFwYKGpO5GxmDB8y1QuL5izBNa5AERwu2Sw/iTpRhP3cpPKDVn9nFeQ6MraPSm6ilQk2ASCu8/49742KYBrijg+61wyrKiW6hYho2yaNo3tN6C21CN5xs1NeHiEAzE859tDLGBqfLVtn2Lz1ksy4/rQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=fAlsSxkx; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="fAlsSxkx" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 068F6C4CEF7; Tue, 17 Feb 2026 22:25:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1771367124; bh=0G2Wu+ork4b43/V01ieIEc5auZF0HDjfDOooAbQRvMM=; h=Date:Subject:From:To:Cc:References:In-Reply-To:From; b=fAlsSxkx3sLN1/XXD48wAPoUeZ0r4sVnEKY6+VKVBhuy8RpHRmSEhRe1lkt3tEyNg /LedgzgSS5NGp9xE1W4+i8YlIXKztRgomPnxA6O1Y8Hs4jCoq99BVs/SR5C5u4HnVb P2ZXY0mZiuwY4TTKJZJxgNFw5awwgws+M0zZSh88lotDKrc9F1fiOWaIyHlYTPzNg7 EP/dCOHKOPpP6eYrPGOCx41xRRMXNOnW2Ed3zk0w3ewO5EO+QAYnMvDJ3TPtHdoG3m vPZ9gIHqLZWWYtx5eszqFFrUhdiRsWiGpt/ivPwPLArGm7UA/bsLJguqAIcJVIMmfY mno9B+KD0ipJw== Message-ID: <0f7f4ffa-1465-4c54-8d3d-e9b551136669@kernel.org> Date: Tue, 17 Feb 2026 23:25:20 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: [PATCH RFC 01/10] IB/core: Prepare for immutable device groups From: Heiner Kallweit To: =?UTF-8?Q?Thomas_Wei=C3=9Fschuh?= , Greg Kroah-Hartman , "Rafael J. Wysocki" , Danilo Krummrich , Jason Gunthorpe , Leon Romanovsky , Alexandre Belloni Cc: driver-core@lists.linux.dev, Linux Kernel Mailing List , linux-rdma@vger.kernel.org, linux-rtc@vger.kernel.org References: <5d0951ec-42c9-453f-9966-ecca593c4153@kernel.org> Content-Language: en-US In-Reply-To: <5d0951ec-42c9-453f-9966-ecca593c4153@kernel.org> Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" This prepares for making struct device member groups a constant array. No functional change intended. Signed-off-by: Heiner Kallweit Acked-by: Leon Romanovsky --- drivers/infiniband/core/device.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/infiniband/core/device.c b/drivers/infiniband/core/dev= ice.c index 1174ab7da62..f967ad534fc 100644 --- a/drivers/infiniband/core/device.c +++ b/drivers/infiniband/core/device.c @@ -565,15 +565,14 @@ static void rdma_init_coredev(struct ib_core_device *= coredev, */ BUILD_BUG_ON(offsetof(struct ib_device, coredev.dev) !=3D offsetof(struct ib_device, dev)); - - coredev->dev.class =3D &ib_class; - coredev->dev.groups =3D dev->groups; - /* * Don't expose hw counters outside of the init namespace. */ if (!is_full_dev && dev->hw_stats_attr_index) - coredev->dev.groups[dev->hw_stats_attr_index] =3D NULL; + dev->groups[dev->hw_stats_attr_index] =3D NULL; + + coredev->dev.class =3D &ib_class; + coredev->dev.groups =3D dev->groups; =20 device_initialize(&coredev->dev); coredev->owner =3D dev; --=20 2.53.0 From nobody Fri Apr 3 04:51:27 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 E2A68318B96; Tue, 17 Feb 2026 22:26:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771367191; cv=none; b=YJ64JtdqovHBYzqZ4MjHrltAA4WBekliYcbqghslZY2/HgV0bt5oYiM3SkqR5+Zbf/tDHlVnXa5XVRgYqCcXkUclkL5RB5OVvfN0Xt3HLEgDSeJpqMWvI2JK3CFAgKj5WS+P0I3KUET9y16+zCE1lEeH6jcmqQvIx/pmlJUiTcQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771367191; c=relaxed/simple; bh=RmsK6mmAsFn3kMOgdOxe8MRr28G1U6zGaOeHBWEMZ9E=; h=Message-ID:Date:MIME-Version:Subject:From:To:Cc:References: In-Reply-To:Content-Type; b=Zi+XA/+pWLVWw2kQ3T8ROjTs0TxSSyQi0I5+TWvoPhj6bEsMCFXxToap7Pynk+KmVHxueVgpoq7q12fd1dxTLJYorBo7uXGxGN2fBy0aeS2bnISZyH+Td0vyQ9fY+nZC9b6uTkMTgtIczKTN1J7mOI5dG0jjKtD2rYmc1TZG8vc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=iaDc5hRk; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="iaDc5hRk" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 38CA0C4CEF7; Tue, 17 Feb 2026 22:26:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1771367190; bh=RmsK6mmAsFn3kMOgdOxe8MRr28G1U6zGaOeHBWEMZ9E=; h=Date:Subject:From:To:Cc:References:In-Reply-To:From; b=iaDc5hRkRXBnBH9OIzZW+YliZvA35wCYxK5I1/lQWeue6oq7nvT7OHFjExbAbDpya cygBFw+/gQD7Tk83SHM7ELv5wibPxfQ5fY09xq8vV45Dj2zgRT19VEJvqVHAB5J9xg X/LHLXTXmFbso6sN6pqQSrGw6Npaei70Ci8oBV5IFbGCUQK9afQtA6kGTxxrVEe1e8 hfKy6e4GaL9USZtzPzwK0mlBCpfpEdu0rfFB4TRTrDlkXHJ3BiLMfQIYdsupf4Lt0I pmUxX8heePlPZhRsZCQaI0RfYndHtVtk4s2UKUzwp5pPgCj4H7YFE6c5OVE9lyMOAB cLmonA7QfAYJQ== Message-ID: <95e5af90-ed53-4009-a4ea-19ed04499ecc@kernel.org> Date: Tue, 17 Feb 2026 23:26:26 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: [PATCH RFC 02/10] rtc: prepare for struct device member groups becoming a constant array From: Heiner Kallweit To: =?UTF-8?Q?Thomas_Wei=C3=9Fschuh?= , Greg Kroah-Hartman , "Rafael J. Wysocki" , Danilo Krummrich , Jason Gunthorpe , Leon Romanovsky , Alexandre Belloni Cc: driver-core@lists.linux.dev, Linux Kernel Mailing List , linux-rdma@vger.kernel.org, linux-rtc@vger.kernel.org References: <5d0951ec-42c9-453f-9966-ecca593c4153@kernel.org> Content-Language: en-US In-Reply-To: <5d0951ec-42c9-453f-9966-ecca593c4153@kernel.org> Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" This prepares for making struct device member groups a constant array. The assignment groups =3D rtc->dev.groups would result in a "discarding const qualifier" warning with this change. No functional change intended. Signed-off-by: Heiner Kallweit Acked-by: Alexandre Belloni --- drivers/rtc/sysfs.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/rtc/sysfs.c b/drivers/rtc/sysfs.c index 4ab05e105a7..ae5e1252b4c 100644 --- a/drivers/rtc/sysfs.c +++ b/drivers/rtc/sysfs.c @@ -308,7 +308,7 @@ const struct attribute_group **rtc_get_dev_attribute_gr= oups(void) int rtc_add_groups(struct rtc_device *rtc, const struct attribute_group **= grps) { size_t old_cnt =3D 0, add_cnt =3D 0, new_cnt; - const struct attribute_group **groups, **old; + const struct attribute_group **groups, *const *old; =20 if (grps) { for (groups =3D grps; *groups; groups++) @@ -320,9 +320,9 @@ int rtc_add_groups(struct rtc_device *rtc, const struct= attribute_group **grps) return -EINVAL; } =20 - groups =3D rtc->dev.groups; - if (groups) - for (; *groups; groups++) + old =3D rtc->dev.groups; + if (old) + while (*old++) old_cnt++; =20 new_cnt =3D old_cnt + add_cnt + 1; --=20 2.53.0 From nobody Fri Apr 3 04:51:27 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 C8DE0318ED3; Tue, 17 Feb 2026 22:27:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771367235; cv=none; b=gUUA+sIsALIYWR9kuA48pLx5MK8iZWH6dG63T+viAk58T/sxvyvdFdH3g6icso2j8LggOnsbDsJ3iynFbqeaJ6bKNrRxwnA92fxmmmDUY6GTeREWU2qWs7drKHfaceLk5P0YZP3d+8kqrLjs83TuUtqE8+8bkQMdFzf2YCIJQYA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771367235; c=relaxed/simple; bh=fvAepahS8bkIxS/Fi2UU0CU7Bd5BSiZwq69sJ9cH2Ug=; h=Message-ID:Date:MIME-Version:Subject:From:To:Cc:References: In-Reply-To:Content-Type; b=i9dMRzs3dHHtnO6IrE149UzxCdlMrF4GS+riSbWRFppz5jVFLm6dqyQhlAgorg8vWjLU0D/ZFtORVG+TxpLKBDVOuJRavnXVo7dpOpKXHgTDtBWU/TMJjUw3sKFjcQiz1VAIrAp2bLSGU8rsNKjzNWPfh+pTiSS1/QllXjSeVq8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=M8EHB+rm; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="M8EHB+rm" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1FC4FC4CEF7; Tue, 17 Feb 2026 22:27:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1771367235; bh=fvAepahS8bkIxS/Fi2UU0CU7Bd5BSiZwq69sJ9cH2Ug=; h=Date:Subject:From:To:Cc:References:In-Reply-To:From; b=M8EHB+rm+l6swCm5Z9NPzOAdy6A/tqjUHxQpCEENlr4xfmR68J53E4qJe2iJ+m6wK 8PyVAolyzIAjzJFuhtjUnPZR+X3Dpoi+rn2gyVuAoM2Pn6Jvbpq9CGPpw5mLtoGunr a3KPnViDpSa59yHfoyfrE/Z+TkhCrBDr0SigI5BC7eK9cPOrtBepghnukeYwgRDLqI 9SrWmX5Uzmu2NpUz/kUitvqmxIkHWU8fpaE0jdAqfBVmJ7feB5MaZZBNJm891oAgmU QcNM37TQ0YrMos/cOOAh7X8hRu2MFEnzrOf8148bGKC5SzFrgi78K67AmUJmUdNiQ7 JA2OiSnv9fhAw== Message-ID: <1ee481dc-f4fd-4a01-9859-be95cc1095ac@kernel.org> Date: Tue, 17 Feb 2026 23:27:11 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: [PATCH RFC 03/10] sysfs: constify group arrays in function arguments From: Heiner Kallweit To: =?UTF-8?Q?Thomas_Wei=C3=9Fschuh?= , Greg Kroah-Hartman , "Rafael J. Wysocki" , Danilo Krummrich , Jason Gunthorpe , Leon Romanovsky , Alexandre Belloni Cc: driver-core@lists.linux.dev, Linux Kernel Mailing List , linux-rdma@vger.kernel.org, linux-rtc@vger.kernel.org References: <5d0951ec-42c9-453f-9966-ecca593c4153@kernel.org> Content-Language: en-US In-Reply-To: <5d0951ec-42c9-453f-9966-ecca593c4153@kernel.org> Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Constify the groups array argument where applicable. This allows to pass constant arrays as arguments. Signed-off-by: Heiner Kallweit --- fs/sysfs/group.c | 10 +++++----- include/linux/sysfs.h | 16 ++++++++-------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/fs/sysfs/group.c b/fs/sysfs/group.c index e1e639f515a..b3edae0578c 100644 --- a/fs/sysfs/group.c +++ b/fs/sysfs/group.c @@ -217,7 +217,7 @@ int sysfs_create_group(struct kobject *kobj, EXPORT_SYMBOL_GPL(sysfs_create_group); =20 static int internal_create_groups(struct kobject *kobj, int update, - const struct attribute_group **groups) + const struct attribute_group *const *groups) { int error =3D 0; int i; @@ -250,7 +250,7 @@ static int internal_create_groups(struct kobject *kobj,= int update, * Returns 0 on success or error code from sysfs_create_group on failure. */ int sysfs_create_groups(struct kobject *kobj, - const struct attribute_group **groups) + const struct attribute_group *const *groups) { return internal_create_groups(kobj, 0, groups); } @@ -268,7 +268,7 @@ EXPORT_SYMBOL_GPL(sysfs_create_groups); * Returns 0 on success or error code from sysfs_update_group on failure. */ int sysfs_update_groups(struct kobject *kobj, - const struct attribute_group **groups) + const struct attribute_group *const *groups) { return internal_create_groups(kobj, 1, groups); } @@ -342,7 +342,7 @@ EXPORT_SYMBOL_GPL(sysfs_remove_group); * If groups is not NULL, remove the specified groups from the kobject. */ void sysfs_remove_groups(struct kobject *kobj, - const struct attribute_group **groups) + const struct attribute_group *const *groups) { int i; =20 @@ -613,7 +613,7 @@ EXPORT_SYMBOL_GPL(sysfs_group_change_owner); * Returns 0 on success or error code on failure. */ int sysfs_groups_change_owner(struct kobject *kobj, - const struct attribute_group **groups, + const struct attribute_group *const *groups, kuid_t kuid, kgid_t kgid) { int error =3D 0, i; diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h index c33a96b7391..445869ce0f4 100644 --- a/include/linux/sysfs.h +++ b/include/linux/sysfs.h @@ -445,15 +445,15 @@ void sysfs_delete_link(struct kobject *dir, struct ko= bject *targ, int __must_check sysfs_create_group(struct kobject *kobj, const struct attribute_group *grp); int __must_check sysfs_create_groups(struct kobject *kobj, - const struct attribute_group **groups); + const struct attribute_group *const *groups); int __must_check sysfs_update_groups(struct kobject *kobj, - const struct attribute_group **groups); + const struct attribute_group *const *groups); int sysfs_update_group(struct kobject *kobj, const struct attribute_group *grp); void sysfs_remove_group(struct kobject *kobj, const struct attribute_group *grp); void sysfs_remove_groups(struct kobject *kobj, - const struct attribute_group **groups); + const struct attribute_group *const *groups); int sysfs_add_file_to_group(struct kobject *kobj, const struct attribute *attr, const char *group); void sysfs_remove_file_from_group(struct kobject *kobj, @@ -486,7 +486,7 @@ int sysfs_change_owner(struct kobject *kobj, kuid_t kui= d, kgid_t kgid); int sysfs_link_change_owner(struct kobject *kobj, struct kobject *targ, const char *name, kuid_t kuid, kgid_t kgid); int sysfs_groups_change_owner(struct kobject *kobj, - const struct attribute_group **groups, + const struct attribute_group *const *groups, kuid_t kuid, kgid_t kgid); int sysfs_group_change_owner(struct kobject *kobj, const struct attribute_group *groups, kuid_t kuid, @@ -629,13 +629,13 @@ static inline int sysfs_create_group(struct kobject *= kobj, } =20 static inline int sysfs_create_groups(struct kobject *kobj, - const struct attribute_group **groups) + const struct attribute_group *const *groups) { return 0; } =20 static inline int sysfs_update_groups(struct kobject *kobj, - const struct attribute_group **groups) + const struct attribute_group *const *groups) { return 0; } @@ -652,7 +652,7 @@ static inline void sysfs_remove_group(struct kobject *k= obj, } =20 static inline void sysfs_remove_groups(struct kobject *kobj, - const struct attribute_group **groups) + const struct attribute_group *const *groups) { } =20 @@ -733,7 +733,7 @@ static inline int sysfs_change_owner(struct kobject *ko= bj, kuid_t kuid, kgid_t k } =20 static inline int sysfs_groups_change_owner(struct kobject *kobj, - const struct attribute_group **groups, + const struct attribute_group *const *groups, kuid_t kuid, kgid_t kgid) { return 0; --=20 2.53.0 From nobody Fri Apr 3 04:51:27 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 CA0C9318B95; Tue, 17 Feb 2026 22:28:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771367291; cv=none; b=cWH6rsE4giqLwALRnoZ5KAH8obrq4Jsv1FijAIHh9vfh2t6Am7SVsz5cXic5VkqDJD0/G0tdx5RG7aIUtNEkZSGhyxV4qgcOkIMYpQwAjoYBcflAFrRFL3IfV3EdLsWt5DOs9bkeYObDq1L/MQXNjsD2ySKwjUKrBvknZICuUvE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771367291; c=relaxed/simple; bh=4ZZzJoUypvXc3Bo+CoJlQaH09sZK2TEHfYssmcfGRMI=; h=Message-ID:Date:MIME-Version:Subject:From:To:Cc:References: In-Reply-To:Content-Type; b=Vj25RHAoARQhGPtqyySQuKe5FnI15N1riZPDs1za6qyE9vTnWj+SizIXMHWcGMesoh9QXeMX0mDLTQp9zgckWYGFsygC82iwzMnqAfW/Nncjz6mxJL0IGVj3lot3qgfUvgvN8Em8CrSKjkkDGXCwtc+tLfor+AJjMIiVo5RWrOw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=hx7HbXMt; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="hx7HbXMt" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E6407C4CEF7; Tue, 17 Feb 2026 22:28:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1771367291; bh=4ZZzJoUypvXc3Bo+CoJlQaH09sZK2TEHfYssmcfGRMI=; h=Date:Subject:From:To:Cc:References:In-Reply-To:From; b=hx7HbXMtLkovS+AS5uZw9BKiRdnXtksG900F1H4AKrRdPhUtVrMk3YeSHGyy55Kff EYjJ7Wa8cjJ65wjH8A3yi68kM3hVmKaMbUCXELghbTrNZaSQB8oZcTrIL2GF9DE8fm IgGKddR8CF56khB8GQ9a0g8UsKJuTxsKvHhtYt23IHpemNLkOMBplPtBWiwwIiSp1U 1oA+Z9O6Ma4MpbBk2h0OfjdIZOmxVqjbruMI2+Z5JOnLlIfhNicYnt5Tkg650iuCFo auR9lcVnC6NR3YNEUoEchGohW8kp/aS7HQGw1RgLXinLl1eq079N/k9Uc9BhZcJQEq X6QKANzYZjApw== Message-ID: Date: Tue, 17 Feb 2026 23:28:07 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: [PATCH RFC 04/10] driver: core: constify groups array argument in device_add_groups and device_remove_groups From: Heiner Kallweit To: =?UTF-8?Q?Thomas_Wei=C3=9Fschuh?= , Greg Kroah-Hartman , "Rafael J. Wysocki" , Danilo Krummrich , Jason Gunthorpe , Leon Romanovsky , Alexandre Belloni Cc: driver-core@lists.linux.dev, Linux Kernel Mailing List , linux-rdma@vger.kernel.org, linux-rtc@vger.kernel.org References: <5d0951ec-42c9-453f-9966-ecca593c4153@kernel.org> Content-Language: en-US In-Reply-To: <5d0951ec-42c9-453f-9966-ecca593c4153@kernel.org> Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Now that sysfs_create_groups() and sysfs_remove_groups() allow to pass constant groups arrays, we can constify the groups array argument also here. Signed-off-by: Heiner Kallweit --- drivers/base/core.c | 5 +++-- include/linux/device.h | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/base/core.c b/drivers/base/core.c index f599a1384ee..4db63b2603c 100644 --- a/drivers/base/core.c +++ b/drivers/base/core.c @@ -2831,14 +2831,15 @@ static ssize_t removable_show(struct device *dev, s= truct device_attribute *attr, } static DEVICE_ATTR_RO(removable); =20 -int device_add_groups(struct device *dev, const struct attribute_group **g= roups) +int device_add_groups(struct device *dev, + const struct attribute_group *const *groups) { return sysfs_create_groups(&dev->kobj, groups); } EXPORT_SYMBOL_GPL(device_add_groups); =20 void device_remove_groups(struct device *dev, - const struct attribute_group **groups) + const struct attribute_group *const *groups) { sysfs_remove_groups(&dev->kobj, groups); } diff --git a/include/linux/device.h b/include/linux/device.h index 0be95294b6e..48a0444ccc1 100644 --- a/include/linux/device.h +++ b/include/linux/device.h @@ -1131,9 +1131,9 @@ device_create_with_groups(const struct class *cls, st= ruct device *parent, dev_t void device_destroy(const struct class *cls, dev_t devt); =20 int __must_check device_add_groups(struct device *dev, - const struct attribute_group **groups); + const struct attribute_group *const *groups); void device_remove_groups(struct device *dev, - const struct attribute_group **groups); + const struct attribute_group *const *groups); =20 static inline int __must_check device_add_group(struct device *dev, const struct attribute_group *grp) --=20 2.53.0 From nobody Fri Apr 3 04:51:27 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 C3EA2318B95; Tue, 17 Feb 2026 22:28:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771367338; cv=none; b=RTqpDm9EeXqcXqvr353Dm4ZRWeX+0lcCMNSt404d94osqbCwxpn5RPs/SoQwm7RyamOX5cwIr/qTFeUvHfKp6bdaEckxp0Rln450QxeCS6CROmw/3LecLnsqIfhgWZuGbi3tOeYWkZ81x0MzTOeEYed59fLIsRAjXwV2ex/HtvE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771367338; c=relaxed/simple; bh=nol6tUpy3fHDvQ4vYWXQcCQJwZapDwAPPWkod78PTk0=; h=Message-ID:Date:MIME-Version:Subject:From:To:Cc:References: In-Reply-To:Content-Type; b=vAk15wOEpI9oNdQr+mH106OHUZy94y2U8zWQDwFT3i2LpFYW4DKyJxPqqk+NxGifnU3O1GpHKcd2+0uXN2c7KwheQ+yPvOmSEROvvwptFth4sXya31w9qdOGxUkMHxqrXfwJGcz4D+aFrBF5DWAhonE+RDylGFf8y3frfoTRhek= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=hRcONCbK; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="hRcONCbK" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 22621C4CEF7; Tue, 17 Feb 2026 22:28:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1771367338; bh=nol6tUpy3fHDvQ4vYWXQcCQJwZapDwAPPWkod78PTk0=; h=Date:Subject:From:To:Cc:References:In-Reply-To:From; b=hRcONCbKJtlwa8v0gzedJ4f82ku/U34ySHCXRtPyb/c9A3LN7aVzrUYBVn+k66wiY Di/z0d1aUxk0NfpZsdRSjKvBrdY4HxdZZXdTzfdLemK3EtY8Wor59DhAaV44Gzkn6q 6gP8kHRnb8OqUGEl9MaMMyT7PsO6THptA0SDa1W7xGtk0jEl9Fty3Pt7XKNFQ7ni6B nloNsk0ZIQyElYXLM/H/Yrfbvgrragbi1ytfC4Dnnu11m/3gqzV6NSC5kLT2cJYcIw TjZgs1hjJUSyHLBkaGGBlcKdE7y28K83yLapwSvb7wSuj8A7HeA7wAz9YETTJ4o/6+ zs079Y1ku+bYg== Message-ID: Date: Tue, 17 Feb 2026 23:28:54 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: [PATCH RFC 05/10] driver core: make struct device member groups a constant array From: Heiner Kallweit To: =?UTF-8?Q?Thomas_Wei=C3=9Fschuh?= , Greg Kroah-Hartman , "Rafael J. Wysocki" , Danilo Krummrich , Jason Gunthorpe , Leon Romanovsky , Alexandre Belloni Cc: driver-core@lists.linux.dev, Linux Kernel Mailing List , linux-rdma@vger.kernel.org, linux-rtc@vger.kernel.org References: <5d0951ec-42c9-453f-9966-ecca593c4153@kernel.org> Content-Language: en-US In-Reply-To: <5d0951ec-42c9-453f-9966-ecca593c4153@kernel.org> Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Constify the groups array, allowing to assign constant arrays. Signed-off-by: Heiner Kallweit --- include/linux/device.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/device.h b/include/linux/device.h index 48a0444ccc1..bfa2ca603c2 100644 --- a/include/linux/device.h +++ b/include/linux/device.h @@ -640,7 +640,7 @@ struct device { struct list_head devres_head; =20 const struct class *class; - const struct attribute_group **groups; /* optional groups */ + const struct attribute_group *const *groups; /* optional groups */ =20 void (*release)(struct device *dev); struct iommu_group *iommu_group; --=20 2.53.0 From nobody Fri Apr 3 04:51:27 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 7336B318ED3; Tue, 17 Feb 2026 22:29:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771367381; cv=none; b=C93+Tb7iC+hI6dOU8F/XzWOTjPYHeGbg0QRiWP5GPXgCSKrMw2t6Wts9t8KaZ1G8vERfOX2w8WDtSww+v/Gvbboy8S/4Jpyviv5h9py2GQy/XSa6VHSof6eRrPvt90mHwXYnRwrIr0WpVCGNAr6Uu85PjE2VDFHCMWHrvRjYj0c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771367381; c=relaxed/simple; bh=xrd9ece0m84ThVFko3txeePisZV2G0M/1l0pyaeu434=; h=Message-ID:Date:MIME-Version:Subject:From:To:Cc:References: In-Reply-To:Content-Type; b=DckB3Bj5+3XvY4EldUTNS1uds5MKk3A0QwoWkQSUQUZ+ov9pxkVYbN7bRnzZYIf1JLQ1k07p6noRWHIIm/f97sJ0f+FT/ta3Mqumkks4sfXPpXUN+PP4xu79u0+WLFesPR/7nDlRYOyiiJyr4SVbTVkeJDLHGARr7o0/JfTK8IY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=L4r7ltZz; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="L4r7ltZz" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D17ABC4CEF7; Tue, 17 Feb 2026 22:29:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1771367381; bh=xrd9ece0m84ThVFko3txeePisZV2G0M/1l0pyaeu434=; h=Date:Subject:From:To:Cc:References:In-Reply-To:From; b=L4r7ltZzbr5xFxyE40X/d9feLRSAOAK9Wx2x3+pAIsMq9qZT4/CUUNcZwbWYzRq1x xQGl4RVpfrlqF0EPv9AgUh9rvvdmpj25ZmlJHi9onv2/aIIdfLY7VL007TJwjRuuUB IDc8lfC2qQ3bD87Q9ox84//jCaFwmy5bsKBJXnJE88sBVIg38gyjFOFmRT3BttlXXT ga14nBM1rx3wX44Dn31yeD06820kpCnOPNOlDwtOZkJSPzA/+PRg2VK8IpgQgtf1lY Po1LCda6odIOpBXJ0horTwJtdE2QRsYmf5JIs9/EgMekDqYbDb6AkBcLfFfPBy+IMa jx3V0B8UytYuQ== Message-ID: <66a78ec0-2980-4376-96fb-3193b6cbe943@kernel.org> Date: Tue, 17 Feb 2026 23:29:37 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: [PATCH RFC 06/10] driver core: make struct device_type member groups a constant array From: Heiner Kallweit To: =?UTF-8?Q?Thomas_Wei=C3=9Fschuh?= , Greg Kroah-Hartman , "Rafael J. Wysocki" , Danilo Krummrich , Jason Gunthorpe , Leon Romanovsky , Alexandre Belloni Cc: driver-core@lists.linux.dev, Linux Kernel Mailing List , linux-rdma@vger.kernel.org, linux-rtc@vger.kernel.org References: <5d0951ec-42c9-453f-9966-ecca593c4153@kernel.org> Content-Language: en-US In-Reply-To: <5d0951ec-42c9-453f-9966-ecca593c4153@kernel.org> Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Constify the groups array, allowing to assign constant arrays. Signed-off-by: Heiner Kallweit --- include/linux/device.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/device.h b/include/linux/device.h index bfa2ca603c2..808f723bbcf 100644 --- a/include/linux/device.h +++ b/include/linux/device.h @@ -87,7 +87,7 @@ int subsys_virtual_register(const struct bus_type *subsys, */ struct device_type { const char *name; - const struct attribute_group **groups; + const struct attribute_group *const *groups; int (*uevent)(const struct device *dev, struct kobj_uevent_env *env); char *(*devnode)(const struct device *dev, umode_t *mode, kuid_t *uid, kgid_t *gid); --=20 2.53.0 From nobody Fri Apr 3 04:51:27 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 183F713AA2F; Tue, 17 Feb 2026 22:30:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771367422; cv=none; b=g/xIqJCuqVmwgGxAMuflqvCbJ64uFtdGRbfyVsV/OQpxdK1EeZpIxcvYrAp2ta9YUd752wxgCVENe1Yw/Kdag0fsLD4Dw2CriRhddP0zJRC8AtlycZcleg5U5ToSW4aCl78f76nEJmBs5WxUuntG3YokmHuv6lAt65ArLiR5FiA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771367422; c=relaxed/simple; bh=VsVjc+rt/VTr9goq9phUEQQxFoTsYqWk1U/35E2GGPs=; h=Message-ID:Date:MIME-Version:Subject:From:To:Cc:References: In-Reply-To:Content-Type; b=AChpQCLtrovklIpEua2O2ps2Sx9zr9KxAFTH27PrEV9N8e393yqqFyHvyDaC/6rULa3dCydeYnj6tzLpGHR/MQWuPb8vS+rAu9Ol2Yluukz2lKfKKt6dbjqBunIdfQjRXy7nHBRFbs+B3pVVh/gxpIuFcwJHADsJDakIaxAZCOg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=fsSVo1CX; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="fsSVo1CX" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 679C7C4CEF7; Tue, 17 Feb 2026 22:30:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1771367421; bh=VsVjc+rt/VTr9goq9phUEQQxFoTsYqWk1U/35E2GGPs=; h=Date:Subject:From:To:Cc:References:In-Reply-To:From; b=fsSVo1CX31qjds7XGu2AO2QgL3smsrdmvUwrB4pLu22V+z18sAorEMFPUHtEoiIcj R7nbj2JEWeh3y8Em4PH/7bxsMZ2E8xjWPCBVc/nF0PImbGBuv7AgrYMi0J34wn3F/b cwbYYayBZ5MuheMe8V/YVuNJ6ergCwT4lXLcY+hYYZtk5/odqXIkLk315gLT3DinD0 GNId0r0Lo2H3HaVnpy6PpB1QBLN+Z6MSydCkh4/RjWYQc9HyvXVri2vkuleHxzzZXT KoWwrjvLDQivxQKf48XHmxugBcyFd3GVFa31oseTRpvLY87KI4/iq/gccXZZMKagpq s4jtRje6/6N8g== Message-ID: <4a2389ed-6ea4-4cff-aad6-a5a9f9bd13e7@kernel.org> Date: Tue, 17 Feb 2026 23:30:17 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: [PATCH RFC 07/10] driver core: make struct bus_type groups members constant arrays From: Heiner Kallweit To: =?UTF-8?Q?Thomas_Wei=C3=9Fschuh?= , Greg Kroah-Hartman , "Rafael J. Wysocki" , Danilo Krummrich , Jason Gunthorpe , Leon Romanovsky , Alexandre Belloni Cc: driver-core@lists.linux.dev, Linux Kernel Mailing List , linux-rdma@vger.kernel.org, linux-rtc@vger.kernel.org References: <5d0951ec-42c9-453f-9966-ecca593c4153@kernel.org> Content-Language: en-US In-Reply-To: <5d0951ec-42c9-453f-9966-ecca593c4153@kernel.org> Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Constify the groupss arrays, allowing to assign constant arrays. As a prerequisite this requires to constify the groups array argument in few functions. Signed-off-by: Heiner Kallweit --- drivers/base/base.h | 6 ++++-- drivers/base/driver.c | 4 ++-- include/linux/device/bus.h | 6 +++--- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/drivers/base/base.h b/drivers/base/base.h index 8c2175820da..b6852ba45cd 100644 --- a/drivers/base/base.h +++ b/drivers/base/base.h @@ -202,8 +202,10 @@ static inline void dev_sync_state(struct device *dev) dev->driver->sync_state(dev); } =20 -int driver_add_groups(const struct device_driver *drv, const struct attrib= ute_group **groups); -void driver_remove_groups(const struct device_driver *drv, const struct at= tribute_group **groups); +int driver_add_groups(const struct device_driver *drv, + const struct attribute_group *const *groups); +void driver_remove_groups(const struct device_driver *drv, + const struct attribute_group *const *groups); void device_driver_detach(struct device *dev); =20 static inline void device_set_driver(struct device *dev, const struct devi= ce_driver *drv) diff --git a/drivers/base/driver.c b/drivers/base/driver.c index 8ab010ddf70..c5ebf1fdad7 100644 --- a/drivers/base/driver.c +++ b/drivers/base/driver.c @@ -203,13 +203,13 @@ void driver_remove_file(const struct device_driver *d= rv, EXPORT_SYMBOL_GPL(driver_remove_file); =20 int driver_add_groups(const struct device_driver *drv, - const struct attribute_group **groups) + const struct attribute_group *const *groups) { return sysfs_create_groups(&drv->p->kobj, groups); } =20 void driver_remove_groups(const struct device_driver *drv, - const struct attribute_group **groups) + const struct attribute_group *const *groups) { sysfs_remove_groups(&drv->p->kobj, groups); } diff --git a/include/linux/device/bus.h b/include/linux/device/bus.h index 99c3c83ea52..00d8a080f93 100644 --- a/include/linux/device/bus.h +++ b/include/linux/device/bus.h @@ -78,9 +78,9 @@ struct fwnode_handle; struct bus_type { const char *name; const char *dev_name; - const struct attribute_group **bus_groups; - const struct attribute_group **dev_groups; - const struct attribute_group **drv_groups; + const struct attribute_group *const *bus_groups; + const struct attribute_group *const *dev_groups; + const struct attribute_group *const *drv_groups; =20 int (*match)(struct device *dev, const struct device_driver *drv); int (*uevent)(const struct device *dev, struct kobj_uevent_env *env); --=20 2.53.0 From nobody Fri Apr 3 04:51:27 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 843E213AA2F; Tue, 17 Feb 2026 22:31:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771367462; cv=none; b=LEIsHI3YQeWfmJLiMafOYORWfGCryoBvMbTkfn1G77qQMCDqTBSKNHF2JBA/WUk9M5Y2m/JM8Lr4QvXSPMcCZ3n37VFt6JsXcvYgH4UOlj4SmGzL4aZqGh7N0vhczfyv6Hlz9v9i9IEkWMyYz2lHC7Fqm4x60yNHEtQay5byrnc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771367462; c=relaxed/simple; bh=SaaFcH6Oc3jCFSVMmx10cF8ncRdwRf8Ta+7Tz1QJAk4=; h=Message-ID:Date:MIME-Version:Subject:From:To:Cc:References: In-Reply-To:Content-Type; b=oGUD3e9iuP1MBcOCZOqxS62mfUH5f0MYHb0RuHuubItHY7Lg5TVDyllcVtup9EhyHr8qbnAP2q4RJTQzvck74g0syT4IxeYOUMK6kR9apNFOT4Wt8M9L4KQEEHh82FYM091V8f4YxtS70H/mJUAy2N2nz/VHn8ypZcP4wnoYY3k= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=fj/SQQTO; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="fj/SQQTO" Received: by smtp.kernel.org (Postfix) with ESMTPSA id BF351C4CEF7; Tue, 17 Feb 2026 22:30:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1771367462; bh=SaaFcH6Oc3jCFSVMmx10cF8ncRdwRf8Ta+7Tz1QJAk4=; h=Date:Subject:From:To:Cc:References:In-Reply-To:From; b=fj/SQQTOupipFBHak4x5z7L7flqm0zVy+U5fU1vEOY5RRLtwEct8yWTlitXXqmbs+ YHeKKT3UprB8u+vKjGyJLaSu4F4SxH3FyBl453fEcfHkI2dU0eebWwPJu/cuIWLhzh D0lqVOxFF+uVb8X4HQwhH/TUkyrG6VauKQPgKZ81o54nu047R2pn0qF6hUNAxt1whk c0IHDAPfcIH6r5IH+j6LnYAKmHsCMTxbmPpv8mQCpK8gvlgluP6P9kwykHIQtvkEEF JCn099FPpmSGBu8bL3RFWj/Vrspg6sn5akQ7x6BoHNh7YG3c0iE67j6F9NtfvMIkES Brp7oIXxiianw== Message-ID: Date: Tue, 17 Feb 2026 23:30:58 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: [PATCH RFC 08/10] driver core: make struct class groups members constant arrays From: Heiner Kallweit To: =?UTF-8?Q?Thomas_Wei=C3=9Fschuh?= , Greg Kroah-Hartman , "Rafael J. Wysocki" , Danilo Krummrich , Jason Gunthorpe , Leon Romanovsky , Alexandre Belloni Cc: driver-core@lists.linux.dev, Linux Kernel Mailing List , linux-rdma@vger.kernel.org, linux-rtc@vger.kernel.org References: <5d0951ec-42c9-453f-9966-ecca593c4153@kernel.org> Content-Language: en-US In-Reply-To: <5d0951ec-42c9-453f-9966-ecca593c4153@kernel.org> Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Constify the groups arrays, allowing to assign constant arrays. Signed-off-by: Heiner Kallweit --- include/linux/device/class.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/linux/device/class.h b/include/linux/device/class.h index 65880e60c72..2079239a5aa 100644 --- a/include/linux/device/class.h +++ b/include/linux/device/class.h @@ -50,8 +50,8 @@ struct fwnode_handle; struct class { const char *name; =20 - const struct attribute_group **class_groups; - const struct attribute_group **dev_groups; + const struct attribute_group *const *class_groups; + const struct attribute_group *const *dev_groups; =20 int (*dev_uevent)(const struct device *dev, struct kobj_uevent_env *env); char *(*devnode)(const struct device *dev, umode_t *mode); --=20 2.53.0 From nobody Fri Apr 3 04:51:27 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 2FD113C2D; Tue, 17 Feb 2026 22:31:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771367512; cv=none; b=nxP0JDco6z/6j/FXy4CXl5YmZ48cQHxCFoAMKPsf1pTUhL3wu+5CCIg7L/emYNbznPTv+nDBij94xQm/VieRgjYa7IMcT0N5A9TXg8PpDSaf/IQ5bHCca3E98i+bhM3RJYgNuyIRHucuySuiK62bxSUmCgbf9ptpTaLblunZLxo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771367512; c=relaxed/simple; bh=ahqf2qRVFegoMHQN9qWy0uSCWB+Tntxf3SSS1Kt/6WU=; h=Message-ID:Date:MIME-Version:Subject:From:To:Cc:References: In-Reply-To:Content-Type; b=W5GM836NlJdbMuhKpUv1Hjq/DTr++NvKPTzHvKucxsMxbHNBOnMSn+KwebTClA/z8YhcGS7fZTo0WUVTnI6GrvnisVlJfCYFQ7hzfAiGAnW9TFUL8saRZtg8o6sRhCTlRwQWwY7ESQYt1thT6fsN3NWjQGXpnLdM8BXyxPZzL3k= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=TxGvwWL6; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="TxGvwWL6" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 64D10C4CEF7; Tue, 17 Feb 2026 22:31:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1771367511; bh=ahqf2qRVFegoMHQN9qWy0uSCWB+Tntxf3SSS1Kt/6WU=; h=Date:Subject:From:To:Cc:References:In-Reply-To:From; b=TxGvwWL652Dx6J3RpAz9GbpYV+1fvUnwzIKZRpClPgqDAxVBOzREQysAOAbJUr5oL u2VPALzb6d3HKb+8eHGMv8c1QF3un7xhsLERBe3PwgdKjVfjSysFNe9xld08LFKjCc SnVcV+PXl7ok4mdlpVk0w5I8gXGQmKJdMi3VxjKSkimJj2htBfOy5KpL/TRqjnSO5m MfPaCd7gfkr2xIneOwVlCJi148G84fNwNPHuCVjf+SiGws00Cr5ZV/5QAF4LNml9xe 4CU41PdtYSofaMkrGnMJZJq70T3wgt8oZF28TJ4os7t2+5AE6ZP9Aixz46RDb0Wa9u YNJ9olGdRikkQ== Message-ID: <01962d6e-7bb3-431d-9ec3-b4f20e883aae@kernel.org> Date: Tue, 17 Feb 2026 23:31:47 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: [PATCH RFC 09/10] driver core: make struct device_driver groups members contact arrays From: Heiner Kallweit To: =?UTF-8?Q?Thomas_Wei=C3=9Fschuh?= , Greg Kroah-Hartman , "Rafael J. Wysocki" , Danilo Krummrich , Jason Gunthorpe , Leon Romanovsky , Alexandre Belloni Cc: driver-core@lists.linux.dev, Linux Kernel Mailing List , linux-rdma@vger.kernel.org, linux-rtc@vger.kernel.org References: <5d0951ec-42c9-453f-9966-ecca593c4153@kernel.org> Content-Language: en-US In-Reply-To: <5d0951ec-42c9-453f-9966-ecca593c4153@kernel.org> Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Constify the groups arrays, allowing to assign constant arrays. Signed-off-by: Heiner Kallweit --- include/linux/device/driver.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/linux/device/driver.h b/include/linux/device/driver.h index bbc67ec513e..c882daaef01 100644 --- a/include/linux/device/driver.h +++ b/include/linux/device/driver.h @@ -114,8 +114,8 @@ struct device_driver { void (*shutdown) (struct device *dev); int (*suspend) (struct device *dev, pm_message_t state); int (*resume) (struct device *dev); - const struct attribute_group **groups; - const struct attribute_group **dev_groups; + const struct attribute_group *const *groups; + const struct attribute_group *const *dev_groups; =20 const struct dev_pm_ops *pm; void (*coredump) (struct device *dev); --=20 2.53.0 From nobody Fri Apr 3 04:51:27 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 614A32EA473; Tue, 17 Feb 2026 22:32:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771367570; cv=none; b=gmDAUYWkQBypmkMO/zVYXkxGFRdOVYK4iCV8An9eWQ0dD6bcJL1wmQSv8eIo3cillhQnWBYdJaieUu2M4bBxthSbstRr8tHptHIh9QnetS+REeKeMn/Ojp0uSbItw73PmCXrUIwax8AUxmdJpXSgI/cFTdwmBgR8jpRP6LXGeh8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771367570; c=relaxed/simple; bh=bsHw0CdDAwiKv+O4iPUOnlnloSTFSuZaPE4oWUfsSAY=; h=Message-ID:Date:MIME-Version:Subject:From:To:Cc:References: In-Reply-To:Content-Type; b=Fpov6U7C4y+yGBw3bpKZp2CViHZSDWLj29ILY33WRaNAs4Fa/hsQRKyUaiF9rD/RbZEVF4AR9BBLC1lYnfSSRiqiUYbZCYa8yXydjYTJhqtvuE9gN/jWQE/1L5euRf5H6uuSVe9vs4S1KFJ5z0YVeWnxC7V6RaCaNprmV7hy4F8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=jypbKAFR; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="jypbKAFR" Received: by smtp.kernel.org (Postfix) with ESMTPSA id EFB1BC19421; Tue, 17 Feb 2026 22:32:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1771367570; bh=bsHw0CdDAwiKv+O4iPUOnlnloSTFSuZaPE4oWUfsSAY=; h=Date:Subject:From:To:Cc:References:In-Reply-To:From; b=jypbKAFR2Jh4xWXGrHhlTaprdPNVnyhg5aUnSDib2lnw8pRwqxz8cUvy39LFHftR6 jboHuR40a73E40sq4IqHQLio0m1Jzx0tcaE6g4eFk6Yi9o3gEeGtPT4cn5HG+VWGdj AEZhdvd5RgbJP/9MGexrJKYZFjPxn+NKM6S75t4vyW6FyZd0tAx/7CbWee+jRlygvl SfyR2hMorqcAaccz3nltJIbr2z0M6TutI2wgVdm13dVuRClPliIwGPSYF3hTvgYGcA A1DSs7McC2zECDnU8lyANXJ9DPv/R+ww2thyPr1/72PxN+qQI/uTfjSRfuFYqdxBDP hcEqcyhEE791A== Message-ID: <04c85242-dc51-4ddf-9920-4dab57f2498f@kernel.org> Date: Tue, 17 Feb 2026 23:32:46 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: [PATCH RFC 10/10] kobject: make struct kobject member default_groups a constant array From: Heiner Kallweit To: =?UTF-8?Q?Thomas_Wei=C3=9Fschuh?= , Greg Kroah-Hartman , "Rafael J. Wysocki" , Danilo Krummrich , Jason Gunthorpe , Leon Romanovsky , Alexandre Belloni Cc: driver-core@lists.linux.dev, Linux Kernel Mailing List , linux-rdma@vger.kernel.org, linux-rtc@vger.kernel.org References: <5d0951ec-42c9-453f-9966-ecca593c4153@kernel.org> Content-Language: en-US In-Reply-To: <5d0951ec-42c9-453f-9966-ecca593c4153@kernel.org> Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Constify the default_groups array, allowing to assign constant arrays. Signed-off-by: Heiner Kallweit --- include/linux/kobject.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/kobject.h b/include/linux/kobject.h index c8219505a79..e45ee843931 100644 --- a/include/linux/kobject.h +++ b/include/linux/kobject.h @@ -116,7 +116,7 @@ char *kobject_get_path(const struct kobject *kobj, gfp_= t flag); struct kobj_type { void (*release)(struct kobject *kobj); const struct sysfs_ops *sysfs_ops; - const struct attribute_group **default_groups; + const struct attribute_group *const *default_groups; const struct kobj_ns_type_operations *(*child_ns_type)(const struct kobje= ct *kobj); const void *(*namespace)(const struct kobject *kobj); void (*get_ownership)(const struct kobject *kobj, kuid_t *uid, kgid_t *gi= d); --=20 2.53.0