Received: by 2002:ab2:69cc:0:b0:1fd:c486:4f03 with SMTP id n12csp328257lqp; Tue, 11 Jun 2024 06:03:41 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXjgfhqPzckrkkOnnEo/jxT3GhaPZWbex4Mt0j6irA5MsbHB5eXtED2j/quVKNgHzeqy8Eu/793blCEOurW3KFLpvQDIRBRjpk+URgGzA== X-Google-Smtp-Source: AGHT+IFDbcarcJTpDW1rudADKDQ9MshgfrNmp/lfP2y7YEoNMrARhRHdNA6keD/XRRo+2Ta+yIqX X-Received: by 2002:a05:6808:1511:b0:3d2:1fbf:e060 with SMTP id 5614622812f47-3d21fbfe16fmr9463876b6e.53.1718111021328; Tue, 11 Jun 2024 06:03:41 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718111021; cv=pass; d=google.com; s=arc-20160816; b=qhl8Rga1A3NFBPyoBFrYyJndcIoNO3UkKunYr28aynz61HnSOvX4MFLSBAtoeUTyJt ZBxVxBSsoTq3iMVhJ9Byfwws+s3xOPVDNWeDHDY20GFAkp6OfxBwI4GV4hoZMSQVRcrL JsmyaTQmTQ7sB4JIWNRODLw0z2xAPLUN6nhHV3V67oXbHiaZ+phFpNnGMnastyISFKgU 8GlZvDODVdpUoasst/tUR5QtfEV61An8BhtARsTaGNrYt5qVOy2eQSU6ZvmrIsviiC5N ifdlxDsFDEexDo40HO/wLmUz3vOc2ls9SZaLSiQkqL1jBwf+3e1tgCNDkSO9N2lS6Ko4 AV4g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=R2Oxt9Es99LvjUtb3P5HMCspuLdSHRmt/fYYRiJA8Jg=; fh=jUXwtF0520eqoQ34ytTRmHhHfmU9hKCLubTc/MmAv2E=; b=aj98l9LduJoGtp6TSScdgb34vNFasfVZG5YLXUUciWw4DufRR7L9B9PydT6VUdnsHr nQqrOBA8ybTYmKI0izEz8c6k92QOAH/wc+GxYmdZjY76WniUKlOBsx1kL+UrR5xbY5X4 QEXipexyRWlRYa8Xm8vLPtmIbzLl9wY8mNBvn433nFYRYkIswNrZ80sZTnSrwdsTRoUI 2YxJXozwdzQa/Ti2Zviefuiuyflq0n+d+D+KXDJdZ4r1PU8Ddn+QFDQQ73HOq6SnkyHb d/KrrEjVc5OmqQPI8SDExg/f2l5h7VJYU0xUUXkUaiCgdT4x+JTfdSpXJwXFrGrSc9mT JIbA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=QzPahklF; arc=pass (i=1 dkim=pass dkdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-kernel+bounces-209891-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-209891-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 5614622812f47-3d20b7a6b84si766200b6e.192.2024.06.11.06.03.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 06:03:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-209891-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=QzPahklF; arc=pass (i=1 dkim=pass dkdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-kernel+bounces-209891-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-209891-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 61CAB282B03 for ; Tue, 11 Jun 2024 13:01:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 50B9C17D344; Tue, 11 Jun 2024 13:01:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="QzPahklF" 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 7C23917CA1C for ; Tue, 11 Jun 2024 13:01:20 +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=1718110880; cv=none; b=rleYi5PSXSkTWl52TSW55Me/H4yifvZs4iZIemAGUwwnPbT9nzB7yH+AscqM8zodlCkDDt2j8wp6coyJUOtZyZfrkm4doztxE9Q94ztA7QQypAsJViIgWLIEWYtoxuX7G8LvcpanwUvX/wpTCiO8IrICyKyFEntYBWEUZKMwVxA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718110880; c=relaxed/simple; bh=FU/6iPiDrX2Ki4l7e9j9OyGkg+UQtIgHZ5MD4/NbJKU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=VBLDq+YV2r/NT4ry5KyBGX9NbxosP9vAF/gyRVWPCXwRX3TI4EaeXN/36YLOJ3AwgmPVODIJxWPBae7Uhj0UtEmXWmNz6w8C9hjwewD85YStEFzEzM03uFPyRd5C0rDAOGOIEvTvTiclgP2ZKivntdBheHpezeso32/R2/3Hrq4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=QzPahklF; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id AAA6BC3277B; Tue, 11 Jun 2024 13:01:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1718110880; bh=FU/6iPiDrX2Ki4l7e9j9OyGkg+UQtIgHZ5MD4/NbJKU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QzPahklFBMInwUg8SOxZYVzG3DM53urnMtWv6DkOPGTie+xne1Q1/gpeBh+ZtshsF s00MYP7KNP+crR9RvD9nM4TROgVlZutGt9K3gmNbL0V3naLfs5UAECTiBN1EU8VurN nO/Xh0HKdM/lKkupXbJ3utgSvwH6hOHPinTRWBAM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , "Rafael J. Wysocki" Subject: [PATCH 3/6] driver core: driver: mark driver_add/remove_groups constant Date: Tue, 11 Jun 2024 15:01:06 +0200 Message-ID: <20240611130103.3262749-9-gregkh@linuxfoundation.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240611130103.3262749-7-gregkh@linuxfoundation.org> References: <20240611130103.3262749-7-gregkh@linuxfoundation.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1845; i=gregkh@linuxfoundation.org; h=from:subject; bh=FU/6iPiDrX2Ki4l7e9j9OyGkg+UQtIgHZ5MD4/NbJKU=; b=kA0DAAIRMUfUDdst+ykByyZiAGZoSpKhOael1iKxPJ05oFvNqdwkNPEh56kminJbjUeYkpziX IhdBAARAgAdFiEE9LYMxb94wiFKMT3LMUfUDdst+ykFAmZoSpIACgkQMUfUDdst+ykfzACfQwaC DsDxH3dHcU1SkMS8Gj/zyTsAn3FoIF3Hayqk6RDXxFMpgFJxrAfG X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit driver_add_groups() and driver_remove_groups should take a constant pointer as the structure is not modified, so make the change. Cc: "Rafael J. Wysocki" Signed-off-by: Greg Kroah-Hartman --- drivers/base/base.h | 4 ++-- drivers/base/driver.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/base/base.h b/drivers/base/base.h index db4f910e8e36..cba8307908c7 100644 --- a/drivers/base/base.h +++ b/drivers/base/base.h @@ -175,8 +175,8 @@ static inline void dev_sync_state(struct device *dev) dev->driver->sync_state(dev); } -int driver_add_groups(struct device_driver *drv, const struct attribute_group **groups); -void driver_remove_groups(struct device_driver *drv, const struct attribute_group **groups); +int driver_add_groups(const struct device_driver *drv, const struct attribute_group **groups); +void driver_remove_groups(const struct device_driver *drv, const struct attribute_group **groups); void device_driver_detach(struct device *dev); int devres_release_all(struct device *dev); diff --git a/drivers/base/driver.c b/drivers/base/driver.c index c8436c26ed6a..85b4c00df078 100644 --- a/drivers/base/driver.c +++ b/drivers/base/driver.c @@ -199,13 +199,13 @@ void driver_remove_file(struct device_driver *drv, } EXPORT_SYMBOL_GPL(driver_remove_file); -int driver_add_groups(struct device_driver *drv, +int driver_add_groups(const struct device_driver *drv, const struct attribute_group **groups) { return sysfs_create_groups(&drv->p->kobj, groups); } -void driver_remove_groups(struct device_driver *drv, +void driver_remove_groups(const struct device_driver *drv, const struct attribute_group **groups) { sysfs_remove_groups(&drv->p->kobj, groups); -- 2.45.2