From nobody Thu Apr 16 08:24:09 2026 Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 926E932C8B for ; Sun, 1 Mar 2026 12:30:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772368222; cv=none; b=LGh+45uIQb5OFo5r5zKliz+Vmz8nfiA7VjDx1+G+3toS3tpeEoqvTMM0LhvTj3WsAB/qIkmfzOMEdzW1HVdS1oOJPGtoqR7v+oPGmlufkOsfC1qm41KhZZxgoyjItqHytnuUNx+IN5YFfyuUbwbqgxI4rXEjvh5lmT93moQR/M0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772368222; c=relaxed/simple; bh=Qlxf4vGP0s+oYc7nTK+dIxJjKgrkya9GImiujsOZ3vk=; h=Message-ID:Date:MIME-Version:Subject:From:To:Cc:References: In-Reply-To:Content-Type; b=sswxF0LXgdBtLXqiDS5TehvFiYUpsFTnCN7roaCdi/dSBEE76VpsUkcECRCjlUTJViM8FWHy8EQe7S7o1DxZ7pLvmN+PEYzZPUC61zCs4ry4qyBtRqt2e4WqlOLp8gv+MdphRZyRIjoDPpbR2ea2JSOaoQTNKXAcMEMxTnpfAMk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=ScOrdpiv; arc=none smtp.client-ip=209.85.128.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ScOrdpiv" Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-4806cc07ce7so38864385e9.1 for ; Sun, 01 Mar 2026 04:30:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1772368219; x=1772973019; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:from:subject:user-agent:mime-version:date:message-id:from:to :cc:subject:date:message-id:reply-to; bh=IH7s13CuB6X9sNPcDjs79QdKxXWKmWCf+uImrAdahLc=; b=ScOrdpivTP0wqiFYzg9+lpNuI8270noPjg9Zzkv+O89yvpXoiZADfE24tmDLDmfrkz 4f8eL36VfoX6/M3BzVZ1zbsDKgCP+6Ewl1iviRsmhF4InctjMcX1ZYmiYtHW0W9gea9b UbNH2OQJJebxidfh87ilpqSbIziN5LFQlTUcIS0nr8PbLkyV1MIyUYVz0B+b54o5/mmw Z4PAvftvmO8ho1WnxCNbEh1GWaA+KwAPFD3UZmmwmJU1cNm11PQPzRmvcLzuFpkMuZgU MHXEwEdveSu5u4+4GYh2duGLV/I3JIUsSkMwnw9zO+cobhlZcQp3JutYDeqpmSPLkNdo ZlFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772368219; x=1772973019; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:from:subject:user-agent:mime-version:date:message-id:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=IH7s13CuB6X9sNPcDjs79QdKxXWKmWCf+uImrAdahLc=; b=iz2wnMuFa/3iz9mK6tudPGnXW0MhysmHmts6BcKTBx8GXTm70GB5D8J0YR54NQTgqd WRJ6o0hGwF3i/PjFl9Rz2mUSIqp6TXHbji+kmXMEsXUldWK5bXzxruoiJ7MQY12bWtMq Ym0HICUHBP0czVdrnggAJRl3NXSVRbuPu+HZvPcR+ZGpvNxgq89P9k4wrSQm5ZE9NjzE M4iw4eC6A5yLiITrT1H3LYUIAFrkJMAftm3FwmyBWSMVOJOFZUse9EIghNP0Xq1q9gpx ELBWiT6UM1roYU0W8p6iulHCXTKTqV5WYa+2nIE4w5vJ9EgcC4YRE0URvM4+8Ws+Wfkg hwVg== X-Forwarded-Encrypted: i=1; AJvYcCUMtmMIp49lucGK6SCCUIYGloC9XE9d4d0jEUi5yBGoXyyjcP5SKeGNaRHDjBKTrWD17xgAuRyD/jv0nZo=@vger.kernel.org X-Gm-Message-State: AOJu0YyLXUkoHC44XjZdki/KUe+Bv3No7xsDlgSbG6ZJVZrv9ccKVjgp BAGI6xxXq9bljxfeCdWh1D7Y4G1Llk77n1TivBazEFduK4cU8XxFBrCnabNYZw== X-Gm-Gg: ATEYQzx168ksT3WJRIRQ3DJRPULgmouRFsFxgWi8ysWwWgrrb0ZACujzr1aBnZ+WA/u xrR2A6EAY8UUHFrZf0f6P0CmrtmDY2388Bi6IqAOIIYRGXDXWChfWo/uqgQPg637wjvTEsz10cl x9v++8+T7VGj/BjUobliV0VPptnEcGE+cogsjolLg9DEdCiEmKnja0X556P5DNuc9z4AH6b7DWg 8dzX6B2HOCXukkT2LzNJXHkWoEEEJhuMzuNUdsPXf9FLv/b3qI9vxmELbk1zbnkkcFzG79wis3m 7Lf1nhsICaeO68OZRyEPsTguHfciXD//T7SIT6NTzNh3p+73jX8lbXyou9c5wGP1oIKLNdqxv9K r6vtbo5kCrVTv5JLau1qMqJB29agdgn24aOGVr8Q6NZTMKf+dHyK3w7dlgToGJngGKaHByFzta6 pqxzEGa5QfS8J9Ce3codv7AMIsTPuFmCZCcSxYe5JX9O5ttnWzUxQhQeFqDq0pH7PilSqkstEJk yEh1I6EsODIIbLX0F95TlA3d6bRQ4rc6o0dDmFbnjiLvZ4H+1ohCU8q47bCKMI6ZxiKAfP+TA5E X-Received: by 2002:a05:600c:3e12:b0:477:9eb8:97d2 with SMTP id 5b1f17b1804b1-483c9bb1e09mr148646305e9.8.1772368218757; Sun, 01 Mar 2026 04:30:18 -0800 (PST) Received: from ?IPV6:2003:ea:8f04:4d00:b8f3:c9fe:a208:3449? (p200300ea8f044d00b8f3c9fea2083449.dip0.t-ipconnect.de. [2003:ea:8f04:4d00:b8f3:c9fe:a208:3449]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-483c3b770e7sm237976555e9.9.2026.03.01.04.30.17 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 01 Mar 2026 04:30:17 -0800 (PST) Message-ID: <17035265-8882-4101-b7a7-16b3eb94f8b5@gmail.com> Date: Sun, 1 Mar 2026 13: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 1/3] sysfs: constify group arrays in function arguments From: Heiner Kallweit To: Greg Kroah-Hartman , "Rafael J. Wysocki" , Danilo Krummrich Cc: driver-core@lists.linux.dev, Linux Kernel Mailing List References: Content-Language: en-US In-Reply-To: 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 99b775f3ff4..9777e9445dd 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 Thu Apr 16 08:24:09 2026 Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B32F782866 for ; Sun, 1 Mar 2026 12:31:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772368266; cv=none; b=RbL5E5Urq7BBZbKiQtExsCEKVHBzv5LUq6oZG7oqWwccl22/NJB588mtP1UMMEv6/HCHzunoAkVC9jRbn0rjZGCLmjE4dEQto0Vuti4wDzaeVD0MYQgYmJmmOTJkdvrcoc2eS9hBCge+o6++/4zLyN5bgc/vLaPJ+6k/Q201idQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772368266; c=relaxed/simple; bh=e8H4avRFlAUOV699FyBASvVpYwgBt329l3QdH0BnKgg=; h=Message-ID:Date:MIME-Version:Subject:From:To:Cc:References: In-Reply-To:Content-Type; b=GRQwQaYUzqSgKQJsFTwSm1txGQlIjJrQAqdJVyPcAxngroLGxYKIU9aDWYLaz99jYjIaKMe94hhfdG06sj3xVqg6EdUIaUrGhQI+bas9+ivUYME5IViLUUS/KNEUKAsI8snDBlMUii2aKJfn6wmjFVlDmw28hAV3GYCHerCKM0o= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=hl7+Vkj+; arc=none smtp.client-ip=209.85.128.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="hl7+Vkj+" Received: by mail-wm1-f52.google.com with SMTP id 5b1f17b1804b1-4836f363d0dso29672795e9.3 for ; Sun, 01 Mar 2026 04:31:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1772368263; x=1772973063; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:from:subject:user-agent:mime-version:date:message-id:from:to :cc:subject:date:message-id:reply-to; bh=IV8LIVJYlIzCJ+pXwZ3nFU4gVyFjVKrpHPPGWI1pXSY=; b=hl7+Vkj+gq4KBxXI7V61NCWqFBmKXOzNvs/KIRN9g/fySfTO8h8gPSrFfHAHU5RA3R dNoRjX8coNtpGjlB7B6/aNUPY1FLM7F9TQTyZayDB6kc/ZVPMpP/A63dQaZtOM/yRfAU 8osjmP+WljY81Agm/jN4/ivOcIqY0JjV2Y6yLYdu9kKPF5QZbKDIDFV3vPEiz7MQmgKc 98/MdyVnyWePElGSTqDLoKZVnQ6BcPo0Lcn9N27+fx4jlFfLRo98lA3QLfOxahmNwRQo DrnYU4UCqwXSZPNXurBR5DArvbkuwu045V188/obSBzMoewXZI1/KToVvLmU1R6MRVqh kzyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772368263; x=1772973063; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:from:subject:user-agent:mime-version:date:message-id:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=IV8LIVJYlIzCJ+pXwZ3nFU4gVyFjVKrpHPPGWI1pXSY=; b=H9bFw2dCQoi2sZHwHP2MJbQmwi4KEZ3Gwyf/Q45M4S9Eb4uYCMuMQCw56bb4bukCxa xMbEsrXDl5x0PsJqTTTXmsllcPH2Ew1gE8cfUKU7PgXkdrZEtWV6nFsIG7jmXWwqgu1k wiJsYDk2/4amnL+HYKxeTBNzpBIcdQL+S9Z/ovYrOi+UGx8a7JvG0C/1WV9/wb5BI/yl kV4VKSP2Kv1I42wHR3dL2mT7iAZY0Cu/ZJjku5KqEPrUFQMLiswSK2+crTAdH9DvcqFw ErhAbt0BARIJxnj3f5H2m/oMja8ugna3d4HIvWfWKNoRxCOo8D6zIqMWcQyiQ7XlOD5i aPXQ== X-Forwarded-Encrypted: i=1; AJvYcCXCOq/MlXWH0u381HZr+AtgpfzMXYuAMtc+8iPzuMLD9lJSpBXnaQqNeiV96WI8iW1d7JB/Mu94MJWP2nE=@vger.kernel.org X-Gm-Message-State: AOJu0YxzaC9Z8kKJrH5OqaK3A+I47Y74S74jVkE51hYJ/0FsYOm8vCLn kNjxkwtw94LK9UN2V+c4kBdgwLefsNwnb3ZpwFpcd3U69CYsTPgNgevI X-Gm-Gg: ATEYQzwKawdTxPSrgZHUVL+2H/un5l5/67xTFphbUjox2hNVWieB7RZpgkURp/A4Ls1 /OrwvlzS/V9iet3hL8YVVWijMxR3hICYaqbfYoLTFBbtAXvZ1nDNt6eCajIhaFDiXMIqWFomMow UNWt2Jd3IybZp7PQ8Wf1uYddSg2scwWXSLWDWDVYXRqo2cXwPPzR4jjvpZaWxuxCNF99Irvvq/H +d7uPfYfps2MslLEqZDCYunXUDDy38oyJOdEOiZ1mT+HSL4AyJ/0hlB7M00qlVlTDa2FsqhDXb8 t6y+Cyp8wHtGuD9lLAhN372Y8GmuTidHpHAoYXvKZ912yzU8Euj/NpTcZX/OzmuKigIjZzwVIZm C2eQieugeJVQhdj76QWls5XLgeNtS36SiN6dZRSpTA37HVztFFMPJoU2GuRVGS4fkZxKGq3uGcD lFRCq+c9uGjlZafjrI/i2ttBc1iSos43REM1Nh63OpB2ZQmlLrxLCLHB56TOx94+UjEGBZ14DFz yEwTVnhRUosCNEGZxvFKoDHRg7nUQfkslnWJBzSCQG3dGGAtKFrNu8r6zIPmu2gIw== X-Received: by 2002:a05:600c:34d6:b0:477:7af8:c8ad with SMTP id 5b1f17b1804b1-483c9c1cc59mr160599545e9.31.1772368262780; Sun, 01 Mar 2026 04:31:02 -0800 (PST) Received: from ?IPV6:2003:ea:8f04:4d00:b8f3:c9fe:a208:3449? (p200300ea8f044d00b8f3c9fea2083449.dip0.t-ipconnect.de. [2003:ea:8f04:4d00:b8f3:c9fe:a208:3449]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-483c3b841absm255176275e9.13.2026.03.01.04.31.02 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 01 Mar 2026 04:31:02 -0800 (PST) Message-ID: <8ea2d6d1-0adb-4d7f-92bc-751e93ce08d6@gmail.com> Date: Sun, 1 Mar 2026 13:31:02 +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 2/3] driver: core: constify groups array argument in device_add_groups and device_remove_groups From: Heiner Kallweit To: Greg Kroah-Hartman , "Rafael J. Wysocki" , Danilo Krummrich Cc: driver-core@lists.linux.dev, Linux Kernel Mailing List References: Content-Language: en-US In-Reply-To: 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 791f9e444df..f497b724332 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 Thu Apr 16 08:24:09 2026 Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 70E6F2571D7 for ; Sun, 1 Mar 2026 12:31:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772368319; cv=none; b=WlocWcyjKN7LcvGoz+BaqNpPbybdxSJL/5stqtuSGzYx+rIfkGd27OgnnpQn+Thr6MeDwaNsrJafcJMfpYJySlhluvdpAdbz9K40jKWFszGrsWY2kHSAqjHboke8qiYwRQbYXzyMzjvcrX3Y37Xp/H0CySN18pOI2b6QUyQvYrQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772368319; c=relaxed/simple; bh=SaaFcH6Oc3jCFSVMmx10cF8ncRdwRf8Ta+7Tz1QJAk4=; h=Message-ID:Date:MIME-Version:Subject:From:To:Cc:References: In-Reply-To:Content-Type; b=EvUjTeqZxc8Yddw0lfVHR6ILSkm+qrc/iXvr1EsOLbJVpQn7iFAHUXnoPN7z6ETGEZAkLkwEAmIMHX78R3JI2niLbXugcZGCOd3yWLR2puw+g1p8w+AaBZoYnYMt59OPS19ce7YpzJA7jvd7R79R7ERhxMdovUpBkpU/YH+kPQU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=bmP2hP1t; arc=none smtp.client-ip=209.85.128.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="bmP2hP1t" Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-4838c15e3cbso30857315e9.3 for ; Sun, 01 Mar 2026 04:31:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1772368317; x=1772973117; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:from:subject:user-agent:mime-version:date:message-id:from:to :cc:subject:date:message-id:reply-to; bh=gOAYb0Oy7G9A/bRMOH/gRXdzCm1K7chfFKNZ0qHtpLQ=; b=bmP2hP1tMNRXvfOye/mvAYYwUXtNHvm4pjeymiMD7Cx4L8hWgBUZASQseofXZvdBLc XONVn/f54/kMJ4p7RY78oB+WW0f40jKPSl0M4ZIrEPE3lZOlQyiBcCfVal9fqgv7iUNW cXBE08eWC2Pfqoh5IyMTL5W0sw3cBWTknh2JtDETwTGOXG02NU2Q/av/5VinpGWmWyKK yMXJvRz1Q2fO1cWT50K7dl5VaQVRvaEjlAt801uS/4ktCVRaO58jwzekDRQogblkiZRu OphxBWUX/EQvbNbIjgSIWSGk3DT/yGlPbvB1xkVZF3SG5mVpZ6MqWSoyz/2pPg1Mn00P 6Xtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772368317; x=1772973117; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:from:subject:user-agent:mime-version:date:message-id:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=gOAYb0Oy7G9A/bRMOH/gRXdzCm1K7chfFKNZ0qHtpLQ=; b=YuaEgmErQ6beoQCwMxA8dCEK4l2TY6wIe5o7keE4eg6aqWHXyq7JtIK2zUtGWgBD8N DPHE6SkVDzZD03z24LANn+jsE3xtcHJbXVc0/sceWxJH6gZugvCe5TL/OwZSbB+p+l/y 5TmXJxSawIekO5djZ7TqzTENls4+Rqll3x+rU8A5TraDPgnQCsnKLOuCSJBa5OaS16pR AD0ElDKbj13YK/03GcVFdvZMeazR13F/+1HncVq11XJijKy9q1OZmgcFoRMkBqWmkSym w/AcaGkU5hYhpWxYufMzGwtRY5jdxFBr5Y/tD8g+kFqmFkLPGL+eCPO5DYBLfyBj0A2B BTGg== X-Forwarded-Encrypted: i=1; AJvYcCUnW+ogLBzX6yI/WIRyq0kgSiB5FDFFJHaUOACVy4QFkPPDQpURunxpg8+aBAnOrGJVrVAcBy1qi/38rSI=@vger.kernel.org X-Gm-Message-State: AOJu0Yw9fJSUqOjgY9yn2NeTWa12KHHzzd7XGgJWSoVKSQYwAzrkO3ao pVQj2jgQypG00z62HBpkpSYHh3fIAOaGOsvk3MWj4QRsXI0TJyuGdwjm X-Gm-Gg: ATEYQzzQpvcAhmlJSzsrY4hZVPpDEE5BY5eEzVxwH7nCXniFFDJEuCugxizzysRPSn1 kdgCSdHsZ6F0uh5vU6zDgtabPHMeHcWaBiGvVur8l+oi5qJZXxZ3EyD0JmVg42y+KhA+w2hcGf6 zN93cDJJmCKw7jLt9rJhfW2yOSZuvXFPKqrXRGGqy9jwnpGEoVdgx9Gi/jjdxdyNTf+aVYOg/27 dzO6XDTZjndKY6fCD/LjVgeTDdmmyszejvUdU2DR/6FlPJPBGZGLagV16Q/RHoDqKS9fNbcs7mT kfYO3oWWao0e9NqT9uQAqSxq6dCsJycqDW+Yxue9eV9Fr/pedKSs8HWMp3ipXwtYSoUpLHSFg40 yMUbsN8B0t5TUaYkbTCeNk58Akdom1/6qVM0T7c7562EKSeuzmpevXzR6a8+lTPUecSN9K/DW3S AYRx+DyMdrZLlwaZ+LJXDDZrxeWVLmQ+Oa0aBrcSb6CSJKDaNrJxrArNIYbD2KZIudvcb86u1Kd jLhGAicztbqhh0mopjy9ZWMnsNEHOwUG/PkRzNTnyYMixhnaJz4FAWkCxAuyF/Ijw== X-Received: by 2002:a05:600c:3b18:b0:483:7631:befa with SMTP id 5b1f17b1804b1-483c9bc55d6mr146296345e9.5.1772368316663; Sun, 01 Mar 2026 04:31:56 -0800 (PST) Received: from ?IPV6:2003:ea:8f04:4d00:b8f3:c9fe:a208:3449? (p200300ea8f044d00b8f3c9fea2083449.dip0.t-ipconnect.de. [2003:ea:8f04:4d00:b8f3:c9fe:a208:3449]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-483c3b346ccsm202763185e9.2.2026.03.01.04.31.56 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 01 Mar 2026 04:31:56 -0800 (PST) Message-ID: <7ff56b07-09ca-4948-b98f-5bd37ceef21e@gmail.com> Date: Sun, 1 Mar 2026 13:31:56 +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 3/3] driver core: make struct class groups members constant arrays From: Heiner Kallweit To: Greg Kroah-Hartman , "Rafael J. Wysocki" , Danilo Krummrich Cc: driver-core@lists.linux.dev, Linux Kernel Mailing List References: Content-Language: en-US In-Reply-To: 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