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(-)
--
2.32.0
Fix checkpatch.pl WARNING: Missing a blank line after declarations
Signed-off-by: Aakash Hemadri <[email protected]>
---
drivers/pci/slot.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/pci/slot.c b/drivers/pci/slot.c
index 751a26668e3a..6ee4ccaf30b3 100644
--- a/drivers/pci/slot.c
+++ b/drivers/pci/slot.c
@@ -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;
--
2.32.0
Fix checkpatch.pl WARNING: Symbolic permissions 'S_IRUGO' are not
preferred. Consider using octal permission '0444'
Signed-off-by: Aakash Hemadri <[email protected]>
---
drivers/pci/slot.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/pci/slot.c b/drivers/pci/slot.c
index 6ee4ccaf30b3..a9678589ed23 100644
--- a/drivers/pci/slot.c
+++ b/drivers/pci/slot.c
@@ -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,
--
2.32.0
Fix checkpatch.pl WARNING: please, no space before tabs
Signed-off-by: Aakash Hemadri <[email protected]>
---
drivers/pci/slot.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/pci/slot.c b/drivers/pci/slot.c
index 8d1a983027b7..d7a60135168e 100644
--- a/drivers/pci/slot.c
+++ b/drivers/pci/slot.c
@@ -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
--
2.32.0
Fix checkpatch.pl WARNING: Prefer IS_ENABLED(CONFIG_HOTPLUG_PCI) over
defined(CONFIG_HOTPLUG_PCI) || defined(CONFIG_HOTPLUG_PCI_MODULE)
Signed-off-by: Aakash Hemadri <[email protected]>
---
drivers/pci/slot.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/pci/slot.c b/drivers/pci/slot.c
index a9678589ed23..8d1a983027b7 100644
--- a/drivers/pci/slot.c
+++ b/drivers/pci/slot.c
@@ -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
--
2.32.0