Skip to contentSkip to conversation

PCI: hotplug: Remove surplus return from a void function

PATCH Applied Krzysztof Wilczynski 3 participants 3 messages Aug 26, 2019 – Aug 29, 2019

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

PATCH 1/1 PCI: hotplug: Remove surplus return from a void function

Remove unnecessary empty return statement at the end of a void function in the following:

- drivers/pci/hotplug/cpci_hotplug_core.c: cleanup_slots()
- drivers/pci/hotplug/cpqphp_core.c: pci_print_IRQ_route()
- drivers/pci/hotplug/cpqphp_ctrl.c: cpqhp_pushbutton_thread()
- drivers/pci/hotplug/cpqphp_ctrl.c: interrupt_event_handler()
- drivers/pci/hotplug/cpqphp_nvram.h: compaq_nvram_init()
- drivers/pci/hotplug/rpadlpar_core.c: rpadlpar_io_init()
- drivers/pci/hotplug/rpaphp_core.c: cleanup_slots()

---
 drivers/pci/hotplug/cpci_hotplug_core.c | 1 -
 drivers/pci/hotplug/cpqphp_core.c       | 1 -
 drivers/pci/hotplug/cpqphp_ctrl.c       | 4 ----
 drivers/pci/hotplug/cpqphp_nvram.h      | 5 +----
 drivers/pci/hotplug/rpadlpar_core.c     | 1 -
 drivers/pci/hotplug/rpaphp_core.c       | 1 -
 6 files changed, 1 insertion(+), 12 deletions(-)
drivers/pci/hotplug/cpci_hotplug_core.c +0 -1
index 603eadf3d965..d0559d2faf50 100644
@@ -563,7 +563,6 @@ cleanup_slots(void)
 	}
 cleanup_null:
 	up_write(&list_rwsem);
-	return;
 }
 
 int
drivers/pci/hotplug/cpqphp_core.c +0 -1
index 16bbb183695a..b8aacb41a83c 100644
@@ -173,7 +173,6 @@ static void pci_print_IRQ_route(void)
 		dbg("%d %d %d %d\n", tbus, tdevice >> 3, tdevice & 0x7, tslot);
 
 	}
-	return;
 }
 
 
drivers/pci/hotplug/cpqphp_ctrl.c +0 -4
index b7f4e1f099d9..68de958a9be8 100644
@@ -1872,8 +1872,6 @@ static void interrupt_event_handler(struct controller *ctrl)
 			}
 		}		/* End of FOR loop */
 	}
-
-	return;
 }
 
 
@@ -1943,8 +1941,6 @@ void cpqhp_pushbutton_thread(struct timer_list *t)
 
 		p_slot->state = STATIC_STATE;
 	}
-
-	return;
 }
 
 
drivers/pci/hotplug/cpqphp_nvram.h +1 -4
index 918ff8dbfe62..70e879b6a23f 100644
@@ -16,10 +16,7 @@
 
 #ifndef CONFIG_HOTPLUG_PCI_COMPAQ_NVRAM
 
-static inline void compaq_nvram_init(void __iomem *rom_start)
-{
-	return;
-}
+static inline void compaq_nvram_init(void __iomem *rom_start) { }
 
 static inline int compaq_nvram_load(void __iomem *rom_start, struct controller *ctrl)
 {
drivers/pci/hotplug/rpadlpar_core.c +0 -1
index 182f9e3443ee..977946e4e613 100644
@@ -473,7 +473,6 @@ int __init rpadlpar_io_init(void)
 void rpadlpar_io_exit(void)
 {
 	dlpar_sysfs_exit();
-	return;
 }
 
 module_init(rpadlpar_io_init);
drivers/pci/hotplug/rpaphp_core.c +0 -1
index c3899ee1db99..18627bb21e9e 100644
@@ -408,7 +408,6 @@ static void __exit cleanup_slots(void)
 		pci_hp_deregister(&slot->hotplug_slot);
 		dealloc_slot_struct(slot);
 	}
-	return;
 }
 
 static int __init rpaphp_init(void)
Signature · 1 line
2.22.1
#1 lore raw
Quoted 11 lines · Krzysztof Wilczynski

Remove unnecessary empty return statement at the end of a void function in the following:

- drivers/pci/hotplug/cpci_hotplug_core.c: cleanup_slots()
- drivers/pci/hotplug/cpqphp_core.c: pci_print_IRQ_route()
- drivers/pci/hotplug/cpqphp_ctrl.c: cpqhp_pushbutton_thread()
- drivers/pci/hotplug/cpqphp_ctrl.c: interrupt_event_handler()
- drivers/pci/hotplug/cpqphp_nvram.h: compaq_nvram_init()
- drivers/pci/hotplug/rpadlpar_core.c: rpadlpar_io_init()
- drivers/pci/hotplug/rpaphp_core.c: cleanup_slots()

Quoted 1 line

Applied to pci/trivial for v5.4, thanks!

I squashed the mediatek patch into this since they're both trivial.

Quoted 98 lines
---
 drivers/pci/hotplug/cpci_hotplug_core.c | 1 -
 drivers/pci/hotplug/cpqphp_core.c       | 1 -
 drivers/pci/hotplug/cpqphp_ctrl.c       | 4 ----
 drivers/pci/hotplug/cpqphp_nvram.h      | 5 +----
 drivers/pci/hotplug/rpadlpar_core.c     | 1 -
 drivers/pci/hotplug/rpaphp_core.c       | 1 -
 6 files changed, 1 insertion(+), 12 deletions(-)
drivers/pci/hotplug/cpci_hotplug_core.c +0 -1
index 603eadf3d965..d0559d2faf50 100644
@@ -563,7 +563,6 @@ cleanup_slots(void)
 	}
 cleanup_null:
 	up_write(&list_rwsem);
-	return;
 }
 
 int
drivers/pci/hotplug/cpqphp_core.c +0 -1
index 16bbb183695a..b8aacb41a83c 100644
@@ -173,7 +173,6 @@ static void pci_print_IRQ_route(void)
 		dbg("%d %d %d %d\n", tbus, tdevice >> 3, tdevice & 0x7, tslot);
 
 	}
-	return;
 }
 
 
drivers/pci/hotplug/cpqphp_ctrl.c +0 -4
index b7f4e1f099d9..68de958a9be8 100644
@@ -1872,8 +1872,6 @@ static void interrupt_event_handler(struct controller *ctrl)
 			}
 		}		/* End of FOR loop */
 	}
-
-	return;
 }
 
 
@@ -1943,8 +1941,6 @@ void cpqhp_pushbutton_thread(struct timer_list *t)
 
 		p_slot->state = STATIC_STATE;
 	}
-
-	return;
 }
 
 
drivers/pci/hotplug/cpqphp_nvram.h +1 -4
index 918ff8dbfe62..70e879b6a23f 100644
@@ -16,10 +16,7 @@
 
 #ifndef CONFIG_HOTPLUG_PCI_COMPAQ_NVRAM
 
-static inline void compaq_nvram_init(void __iomem *rom_start)
-{
-	return;
-}
+static inline void compaq_nvram_init(void __iomem *rom_start) { }
 
 static inline int compaq_nvram_load(void __iomem *rom_start, struct controller *ctrl)
 {
drivers/pci/hotplug/rpadlpar_core.c +0 -1
index 182f9e3443ee..977946e4e613 100644
@@ -473,7 +473,6 @@ int __init rpadlpar_io_init(void)
 void rpadlpar_io_exit(void)
 {
 	dlpar_sysfs_exit();
-	return;
 }
 
 module_init(rpadlpar_io_init);
drivers/pci/hotplug/rpaphp_core.c +0 -1
index c3899ee1db99..18627bb21e9e 100644
@@ -408,7 +408,6 @@ static void __exit cleanup_slots(void)
 		pci_hp_deregister(&slot->hotplug_slot);
 		dealloc_slot_struct(slot);
 	}
-	return;
 }
 
 static int __init rpaphp_init(void)
Signature · 1 line
2.22.1
maintainer Acked-by on v1 1/1
#2 lore raw
In reply to Krzysztof Wilczynski
Quoted 11 lines · Krzysztof Wilczynski

Remove unnecessary empty return statement at the end of a void function in the following:

- drivers/pci/hotplug/cpci_hotplug_core.c: cleanup_slots()
- drivers/pci/hotplug/cpqphp_core.c: pci_print_IRQ_route()
- drivers/pci/hotplug/cpqphp_ctrl.c: cpqhp_pushbutton_thread()
- drivers/pci/hotplug/cpqphp_ctrl.c: interrupt_event_handler()
- drivers/pci/hotplug/cpqphp_nvram.h: compaq_nvram_init()
- drivers/pci/hotplug/rpadlpar_core.c: rpadlpar_io_init()
- drivers/pci/hotplug/rpaphp_core.c: cleanup_slots()

Quoted 1 line

For rpa*_core.c portions,

Quoted 96 lines
---
 drivers/pci/hotplug/cpci_hotplug_core.c | 1 -
 drivers/pci/hotplug/cpqphp_core.c       | 1 -
 drivers/pci/hotplug/cpqphp_ctrl.c       | 4 ----
 drivers/pci/hotplug/cpqphp_nvram.h      | 5 +----
 drivers/pci/hotplug/rpadlpar_core.c     | 1 -
 drivers/pci/hotplug/rpaphp_core.c       | 1 -
 6 files changed, 1 insertion(+), 12 deletions(-)
drivers/pci/hotplug/cpci_hotplug_core.c +0 -1
index 603eadf3d965..d0559d2faf50 100644
@@ -563,7 +563,6 @@ cleanup_slots(void)
 	}
 cleanup_null:
 	up_write(&list_rwsem);
-	return;
 }
 
 int
drivers/pci/hotplug/cpqphp_core.c +0 -1
index 16bbb183695a..b8aacb41a83c 100644
@@ -173,7 +173,6 @@ static void pci_print_IRQ_route(void)
 		dbg("%d %d %d %d\n", tbus, tdevice >> 3, tdevice & 0x7, tslot);
 
 	}
-	return;
 }
 
 
drivers/pci/hotplug/cpqphp_ctrl.c +0 -4
index b7f4e1f099d9..68de958a9be8 100644
@@ -1872,8 +1872,6 @@ static void interrupt_event_handler(struct controller *ctrl)
 			}
 		}		/* End of FOR loop */
 	}
-
-	return;
 }
 
 
@@ -1943,8 +1941,6 @@ void cpqhp_pushbutton_thread(struct timer_list *t)
 
 		p_slot->state = STATIC_STATE;
 	}
-
-	return;
 }
 
 
drivers/pci/hotplug/cpqphp_nvram.h +1 -4
index 918ff8dbfe62..70e879b6a23f 100644
@@ -16,10 +16,7 @@
 
 #ifndef CONFIG_HOTPLUG_PCI_COMPAQ_NVRAM
 
-static inline void compaq_nvram_init(void __iomem *rom_start)
-{
-	return;
-}
+static inline void compaq_nvram_init(void __iomem *rom_start) { }
 
 static inline int compaq_nvram_load(void __iomem *rom_start, struct controller *ctrl)
 {
drivers/pci/hotplug/rpadlpar_core.c +0 -1
index 182f9e3443ee..977946e4e613 100644
@@ -473,7 +473,6 @@ int __init rpadlpar_io_init(void)
 void rpadlpar_io_exit(void)
 {
 	dlpar_sysfs_exit();
-	return;
 }
 
 module_init(rpadlpar_io_init);
drivers/pci/hotplug/rpaphp_core.c +0 -1
index c3899ee1db99..18627bb21e9e 100644
@@ -408,7 +408,6 @@ static void __exit cleanup_slots(void)
 		pci_hp_deregister(&slot->hotplug_slot);
 		dealloc_slot_struct(slot);
 	}
-	return;
 }
 
 static int __init rpaphp_init(void)