Skip to contentSkip to conversation

Fix checkpatch.pl WARNINGS

PATCH New Aakash Hemadri 1 participant 5 messages Aug 14, 2021 PCI

lore
Share & tools
lore
#0 lore raw

cover Fix checkpatch.pl WARNINGS

Hi,
This patch series fixes checkpatch.pl WARNINGS in slot.c
This patch series will apply cleanly on pci-v5.14-changes

Aakash Hemadri (4):
PCI: Missing blank line after declarations
PCI: Symbolic permissions 'S_IRUGO' are not preferred
PCI: Prefer IS_ENABLED(CONFIG_HOTPLUG_PCI)
PCI: No space before tabs

 drivers/pci/slot.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)
Signature · 1 line
2.32.0
#1 lore raw

PATCH 1/4 PCI: Missing blank line after declarations

Fix checkpatch.pl WARNING: Missing a blank line after declarations

---
 drivers/pci/slot.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/pci/slot.c +3 -0
index 751a26668e3a..6ee4ccaf30b3 100644
@@ -20,6 +20,7 @@ static ssize_t pci_slot_attr_show(struct kobject *kobj,
 {
 	struct pci_slot *slot = to_pci_slot(kobj);
 	struct pci_slot_attribute *attribute = to_pci_slot_attr(attr);
+
 	return attribute->show ? attribute->show(slot, buf) : -EIO;
 }
 
@@ -28,6 +29,7 @@ static ssize_t pci_slot_attr_store(struct kobject *kobj,
 {
 	struct pci_slot *slot = to_pci_slot(kobj);
 	struct pci_slot_attribute *attribute = to_pci_slot_attr(attr);
+
 	return attribute->store ? attribute->store(slot, buf, len) : -EIO;
 }
 
@@ -123,6 +125,7 @@ static char *make_slot_name(const char *name)
 
 	for (;;) {
 		struct kobject *dup_slot;
+
 		dup_slot = kset_find_obj(pci_slots_kset, new_name);
 		if (!dup_slot)
 			break;
Signature · 1 line
2.32.0
#2 lore raw

PATCH 2/4 PCI: Symbolic permissions 'S_IRUGO' are not preferred

In reply to Aakash Hemadri

Fix checkpatch.pl WARNING: Symbolic permissions 'S_IRUGO' are not preferred. Consider using octal permission '0444'

---
 drivers/pci/slot.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/pci/slot.c +3 -3
index 6ee4ccaf30b3..a9678589ed23 100644
@@ -86,11 +86,11 @@ static void pci_slot_release(struct kobject *kobj)
 }
 
 static struct pci_slot_attribute pci_slot_attr_address =
-	__ATTR(address, S_IRUGO, address_read_file, NULL);
+	__ATTR(address, 0444, address_read_file, NULL);
 static struct pci_slot_attribute pci_slot_attr_max_speed =
-	__ATTR(max_bus_speed, S_IRUGO, max_speed_read_file, NULL);
+	__ATTR(max_bus_speed, 0444, max_speed_read_file, NULL);
 static struct pci_slot_attribute pci_slot_attr_cur_speed =
-	__ATTR(cur_bus_speed, S_IRUGO, cur_speed_read_file, NULL);
+	__ATTR(cur_bus_speed, 0444, cur_speed_read_file, NULL);
 
 static struct attribute *pci_slot_default_attrs[] = {
 	&pci_slot_attr_address.attr,
Signature · 1 line
2.32.0
#3 lore raw

PATCH 3/4 PCI: Prefer IS_ENABLED(CONFIG_HOTPLUG_PCI)

In reply to Aakash Hemadri

Fix checkpatch.pl WARNING: Prefer IS_ENABLED(CONFIG_HOTPLUG_PCI) over defined(CONFIG_HOTPLUG_PCI) || defined(CONFIG_HOTPLUG_PCI_MODULE)

---
 drivers/pci/slot.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pci/slot.c +1 -1
index a9678589ed23..8d1a983027b7 100644
@@ -323,7 +323,7 @@ void pci_destroy_slot(struct pci_slot *slot)
 }
 EXPORT_SYMBOL_GPL(pci_destroy_slot);
 
-#if defined(CONFIG_HOTPLUG_PCI) || defined(CONFIG_HOTPLUG_PCI_MODULE)
+#if IS_ENABLED(CONFIG_HOTPLUG_PCI)
 #include <linux/pci_hotplug.h>
 /**
  * pci_hp_create_module_link - create symbolic link to hotplug driver module
Signature · 1 line
2.32.0
#4 lore raw

PATCH 4/4 PCI: No space before tabs

In reply to Aakash Hemadri

Fix checkpatch.pl WARNING: please, no space before tabs

---
 drivers/pci/slot.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pci/slot.c +1 -1
index 8d1a983027b7..d7a60135168e 100644
@@ -353,7 +353,7 @@ EXPORT_SYMBOL_GPL(pci_hp_create_module_link);
 
 /**
  * pci_hp_remove_module_link - remove symbolic link to the hotplug driver
- * 	module.
+ * module.
  * @pci_slot: struct pci_slot
  *
  * Helper function for pci_hotplug_core.c to remove symbolic link to
Signature · 1 line
2.32.0