Fix checkpatch.pl WARNINGS
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
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
@@ -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
PATCH 2/4 PCI: Symbolic permissions 'S_IRUGO' are not preferred
In reply to Aakash HemadriFix 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
@@ -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
PATCH 3/4 PCI: Prefer IS_ENABLED(CONFIG_HOTPLUG_PCI)
In reply to Aakash HemadriFix 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
@@ -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
PATCH 4/4 PCI: No space before tabs
In reply to Aakash HemadriFix 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
@@ -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