From mboxrd@z Thu Jan 1 00:00:00 1970 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-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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, struct device_attribute *attr, } static DEVICE_ATTR_RO(removable); -int device_add_groups(struct device *dev, const struct attribute_group **groups) +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); 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, struct device *parent, dev_t void device_destroy(const struct class *cls, dev_t devt); 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); static inline int __must_check device_add_group(struct device *dev, const struct attribute_group *grp) -- 2.53.0