Linux PCI subsystem development
 help / color / mirror / Atom feed
* [PATCH] PCI: Constify struct configfs_attribute pointers
@ 2026-11-07  4:35 Thomas Weißschuh
  2026-11-09 19:53 ` sashiko-bot
  0 siblings, 1 reply; 2+ messages in thread
From: Thomas Weißschuh @ 2026-11-07  4:35 UTC (permalink / raw)
  To: Bjorn Helgaas; +Cc: linux-pci, linux-kernel, Thomas Weißschuh

In preparation for the constification of configfs attributes, make the
pointers to struct configfs_attribute in drivers/pci/ const
and use the new ct_attrs_const field of struct config_item_type.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
---
 drivers/pci/endpoint/functions/pci-epf-ntb.c  | 4 ++--
 drivers/pci/endpoint/functions/pci-epf-test.c | 4 ++--
 drivers/pci/endpoint/functions/pci-epf-vntb.c | 4 ++--
 drivers/pci/endpoint/pci-ep-cfs.c             | 8 ++++----
 4 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/pci/endpoint/functions/pci-epf-ntb.c b/drivers/pci/endpoint/functions/pci-epf-ntb.c
index 5314aca2188a..ae3efbe4ef41 100644
--- a/drivers/pci/endpoint/functions/pci-epf-ntb.c
+++ b/drivers/pci/endpoint/functions/pci-epf-ntb.c
@@ -1984,7 +1984,7 @@ CONFIGFS_ATTR(epf_ntb_, mw2);
 CONFIGFS_ATTR(epf_ntb_, mw3);
 CONFIGFS_ATTR(epf_ntb_, mw4);
 
-static struct configfs_attribute *epf_ntb_attrs[] = {
+static const struct configfs_attribute *const epf_ntb_attrs[] = {
 	&epf_ntb_attr_spad_count,
 	&epf_ntb_attr_db_count,
 	&epf_ntb_attr_num_mws,
@@ -1996,7 +1996,7 @@ static struct configfs_attribute *epf_ntb_attrs[] = {
 };
 
 static const struct config_item_type ntb_group_type = {
-	.ct_attrs	= epf_ntb_attrs,
+	.ct_attrs_const	= epf_ntb_attrs,
 	.ct_owner	= THIS_MODULE,
 };
 
diff --git a/drivers/pci/endpoint/functions/pci-epf-test.c b/drivers/pci/endpoint/functions/pci-epf-test.c
index d4905aa8e4c0..a97a986ddf51 100644
--- a/drivers/pci/endpoint/functions/pci-epf-test.c
+++ b/drivers/pci/endpoint/functions/pci-epf-test.c
@@ -1441,7 +1441,7 @@ CONFIGFS_ATTR(pci_epf_test_, bar3_size);
 CONFIGFS_ATTR(pci_epf_test_, bar4_size);
 CONFIGFS_ATTR(pci_epf_test_, bar5_size);
 
-static struct configfs_attribute *pci_epf_test_attrs[] = {
+static const struct configfs_attribute *const pci_epf_test_attrs[] = {
 	&pci_epf_test_attr_bar0_size,
 	&pci_epf_test_attr_bar1_size,
 	&pci_epf_test_attr_bar2_size,
@@ -1452,7 +1452,7 @@ static struct configfs_attribute *pci_epf_test_attrs[] = {
 };
 
 static const struct config_item_type pci_epf_test_group_type = {
-	.ct_attrs	= pci_epf_test_attrs,
+	.ct_attrs_const	= pci_epf_test_attrs,
 	.ct_owner	= THIS_MODULE,
 };
 
diff --git a/drivers/pci/endpoint/functions/pci-epf-vntb.c b/drivers/pci/endpoint/functions/pci-epf-vntb.c
index f77e28f2fe96..31f527ae34c8 100644
--- a/drivers/pci/endpoint/functions/pci-epf-vntb.c
+++ b/drivers/pci/endpoint/functions/pci-epf-vntb.c
@@ -1314,7 +1314,7 @@ CONFIGFS_ATTR(epf_ntb_, mw2_bar);
 CONFIGFS_ATTR(epf_ntb_, mw3_bar);
 CONFIGFS_ATTR(epf_ntb_, mw4_bar);
 
-static struct configfs_attribute *epf_ntb_attrs[] = {
+static const struct configfs_attribute *const epf_ntb_attrs[] = {
 	&epf_ntb_attr_spad_count,
 	&epf_ntb_attr_db_count,
 	&epf_ntb_attr_num_mws,
@@ -1335,7 +1335,7 @@ static struct configfs_attribute *epf_ntb_attrs[] = {
 };
 
 static const struct config_item_type ntb_group_type = {
-	.ct_attrs	= epf_ntb_attrs,
+	.ct_attrs_const	= epf_ntb_attrs,
 	.ct_owner	= THIS_MODULE,
 };
 
diff --git a/drivers/pci/endpoint/pci-ep-cfs.c b/drivers/pci/endpoint/pci-ep-cfs.c
index 590e5bde57ef..44f68188f307 100644
--- a/drivers/pci/endpoint/pci-ep-cfs.c
+++ b/drivers/pci/endpoint/pci-ep-cfs.c
@@ -210,7 +210,7 @@ static ssize_t pci_epc_start_show(struct config_item *item, char *page)
 
 CONFIGFS_ATTR(pci_epc_, start);
 
-static struct configfs_attribute *pci_epc_attrs[] = {
+static const struct configfs_attribute *const pci_epc_attrs[] = {
 	&pci_epc_attr_start,
 	NULL,
 };
@@ -263,7 +263,7 @@ static const struct configfs_item_operations pci_epc_item_ops = {
 
 static const struct config_item_type pci_epc_type = {
 	.ct_item_ops	= &pci_epc_item_ops,
-	.ct_attrs	= pci_epc_attrs,
+	.ct_attrs_const	= pci_epc_attrs,
 	.ct_owner	= THIS_MODULE,
 };
 
@@ -458,7 +458,7 @@ CONFIGFS_ATTR(pci_epf_, interrupt_pin);
 CONFIGFS_ATTR(pci_epf_, msi_interrupts);
 CONFIGFS_ATTR(pci_epf_, msix_interrupts);
 
-static struct configfs_attribute *pci_epf_attrs[] = {
+static const struct configfs_attribute *const pci_epf_attrs[] = {
 	&pci_epf_attr_vendorid,
 	&pci_epf_attr_deviceid,
 	&pci_epf_attr_revid,
@@ -515,7 +515,7 @@ static const struct configfs_item_operations pci_epf_ops = {
 
 static const struct config_item_type pci_epf_type = {
 	.ct_item_ops	= &pci_epf_ops,
-	.ct_attrs	= pci_epf_attrs,
+	.ct_attrs_const	= pci_epf_attrs,
 	.ct_owner	= THIS_MODULE,
 };
 

---
base-commit: ddfe51b0a0f5dc9e415cc2c8ad8db17532dd426b
change-id: 20261107-configfs-const-pci-d26fe89300e1

Best regards,
--  
Thomas Weißschuh <linux@weissschuh.net>


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-11-09 19:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-07  4:35 [PATCH] PCI: Constify struct configfs_attribute pointers Thomas Weißschuh
2026-11-09 19:53 ` sashiko-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox