Skip to content

Commit 1047377

Browse files
t-8chbjorn-helgaas
authored andcommitted
PCI/sysfs: Constify struct kobj_type pci_slot_ktype
Since commit ee6d3dd ("driver core: make kobj_type constant.") the driver core allows the usage of const struct kobj_type. Take advantage of this to constify the structure definition to prevent modification at runtime. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Thomas Weißschuh <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]>
1 parent fd85840 commit 1047377

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/pci/slot.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ static struct attribute *pci_slot_default_attrs[] = {
9898
};
9999
ATTRIBUTE_GROUPS(pci_slot_default);
100100

101-
static struct kobj_type pci_slot_ktype = {
101+
static const struct kobj_type pci_slot_ktype = {
102102
.sysfs_ops = &pci_slot_sysfs_ops,
103103
.release = &pci_slot_release,
104104
.default_groups = pci_slot_default_groups,

0 commit comments

Comments
 (0)