From mboxrd@z Thu Jan 1 00:00:00 1970 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-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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); static int internal_create_groups(struct kobject *kobj, int update, - const struct attribute_group **groups) + const struct attribute_group *const *groups) { int error = 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; @@ -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 = 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 kobject *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 kuid, 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, } static inline int sysfs_create_groups(struct kobject *kobj, - const struct attribute_group **groups) + const struct attribute_group *const *groups) { return 0; } 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 *kobj, } static inline void sysfs_remove_groups(struct kobject *kobj, - const struct attribute_group **groups) + const struct attribute_group *const *groups) { } @@ -733,7 +733,7 @@ static inline int sysfs_change_owner(struct kobject *kobj, kuid_t kuid, kgid_t k } 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; -- 2.53.0