Skip to contentSkip to conversation

s390/pci: Drop unneeded reference to CONFIG_DMI

RFC PATCH Applied Jean Delvare 3 participants 5 messages Apr 23, 2024 – Apr 24, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 s390/pci: Drop unneeded reference to CONFIG_DMI

The S/390 architecture doesn't support SMBIOS, so CONFIG_DMI will never be defined there. So we can simply omit these preprocessing directives and speed up the build a bit.

Cc Niklas Schnelle <[email protected]>
Cc Gerald Schaefer <[email protected]>

---
Niklas, you added these preprocessing directives as part of commit 81bbf03905aa ("s390/pci: expose a PCI device's UID as its index"). I do not understand the purpose. Am I missing something?

 arch/s390/pci/pci_sysfs.c |    4 ----
 1 file changed, 4 deletions(-)
arch/s390/pci/pci_sysfs.c +0 -4
@@ -156,7 +156,6 @@ static ssize_t uid_is_unique_show(struct
 }
 static DEVICE_ATTR_RO(uid_is_unique);
 
-#ifndef CONFIG_DMI
 /* analogous to smbios index */
 static ssize_t index_show(struct device *dev,
 			  struct device_attribute *attr, char *buf)
@@ -186,7 +185,6 @@ static struct attribute_group zpci_ident
 	.attrs = zpci_ident_attrs,
 	.is_visible = zpci_index_is_visible,
 };
-#endif
 
 static struct bin_attribute *zpci_bin_attrs[] = {
 	&bin_attr_util_string,
@@ -229,8 +227,6 @@ static struct attribute_group pfip_attr_
 const struct attribute_group *zpci_attr_groups[] = {
 	&zpci_attr_group,
 	&pfip_attr_group,
-#ifndef CONFIG_DMI
 	&zpci_ident_attr_group,
-#endif
 	NULL,
 };
Signature · 2 lines
Jean Delvare
SUSE L3 Support
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 11 lines · Jean Delvare

The S/390 architecture doesn't support SMBIOS, so CONFIG_DMI will never be defined there. So we can simply omit these preprocessing directives and speed up the build a bit.

Cc Niklas Schnelle <[email protected]>
Cc Gerald Schaefer <[email protected]>

---
Niklas, you added these preprocessing directives as part of commit 81bbf03905aa ("s390/pci: expose a PCI device's UID as its index"). I do not understand the purpose. Am I missing something?

This was only done out of an abundance of caution for the very unlikely case that somehow someday we end up with EFI and DMI on s390x in which case this code would then collide with the smbios way of getting an index from firmware. Looking back I think this is indeed not useful and even if we ever get a collision it would probably need treatment anyway in which case getting a compile error is probably a good thing and less code is always good too.

Quoted 24 lines
 arch/s390/pci/pci_sysfs.c |    4 ----
 1 file changed, 4 deletions(-)
arch/s390/pci/pci_sysfs.c +0 -2
@@ -156,7 +156,6 @@ static ssize_t uid_is_unique_show(struct
 }
 static DEVICE_ATTR_RO(uid_is_unique);
 
-#ifndef CONFIG_DMI
 /* analogous to smbios index */
 static ssize_t index_show(struct device *dev,
 			  struct device_attribute *attr, char *buf)
@@ -186,7 +185,6 @@ static struct attribute_group zpci_ident
 	.attrs = zpci_ident_attrs,
 	.is_visible = zpci_index_is_visible,
 };
-#endif
 
 static struct bin_attribute *zpci_bin_attrs[] = {
 	&bin_attr_util_string,

arch/s390/pci/pci_sysfs.c static struct attribute_group pfip_attr_ · line 232

Quoted 8 lines
arch/s390/pci/pci_sysfs.c +0 -2
@@ -229,8 +227,6 @@ static struct attribute_group pfip_attr_
 const struct attribute_group *zpci_attr_groups[] = {
 	&zpci_attr_group,
 	&pfip_attr_group,
-#ifndef CONFIG_DMI
 	&zpci_ident_attr_group,
-#endif
 	NULL,
 };

I'm assuming this change should go via the s390 tree? So let me add the s390x architecture maintainers to pick this up, but from my side and considering that you maintain the SMBIOS/DMI support:

#2 lore raw
Quoted 3 lines · Niklas Schnelle

I'm assuming this change should go via the s390 tree? So let me add the s390x architecture maintainers to pick this up, but from my side and considering that you maintain the SMBIOS/DMI support:

Hi Jean,

Whether this patch is good to go alone via s390 tree or (as Niklas indicated) might depend on some SMBIOS/DMI update?

Quoted 1 line

Thanks!

#3 lore raw
Quoted 9 lines · Alexander Gordeev
Quoted 3 lines · Niklas Schnelle

I'm assuming this change should go via the s390 tree? So let me add the s390x architecture maintainers to pick this up, but from my side and considering that you maintain the SMBIOS/DMI support:

Hi Jean,

Whether this patch is good to go alone via s390 tree or (as Niklas indicated) might depend on some SMBIOS/DMI update?

It's good to go through the s390 tree, it's a simple clean-up which doesn't depend on anything else.

Quoted 1 line
Quoted 1 line

Thanks to both of you!

Signature · 2 lines
Jean Delvare
SUSE L3 Support
maintainer Applied
#4 lore raw
Quoted 2 lines · Jean Delvare

It's good to go through the s390 tree, it's a simple clean-up which doesn't depend on anything else.

Applied, thanks!

Thanks!

Quoted 5 lines

Thanks to both of you!

Signature · 2 lines
Jean Delvare
SUSE L3 Support