pci/hotplug/pnv_php: Reduce of_node_put(dn) calls in pnv_php_register_slot()
Subsystems (3)
PATCH 1/1 pci/hotplug/pnv_php: Reduce of_node_put(dn) calls in pnv_php_register_slot()
From: Markus Elfring <[email protected]>
Date: Mon, 23 Sep 2024 18:32:21 +0200
An of_node_put(dn) call was immediately used after a pointer check for a pnv_php_find_slot() call in this function implementation. Thus call such a function instead directly before the check.
This issue was transformed by using the Coccinelle software.
Signed-off-by Markus Elfring <[email protected]>
--- drivers/pci/hotplug/pnv_php.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
drivers/pci/hotplug/pnv_php.c +2 -5
@@ -697,12 +697,9 @@ static int pnv_php_register_slot(struct pnv_php_slot *php_slot) } parent =pnv_php_find_slot (dn); -if (parent) { -of_node_put (dn); -break ; - } -of_node_put (dn); +if (parent) +break ; }spin_lock_irqsave (&pnv_php_lock, flags);
--
2.46.1