Skip to contentSkip to conversation

cpqphp_ctrl: remove unreachable path

PATCH Applied Alan Cox 2 participants 2 messages Sep 4, 2012 – Sep 10, 2012 PCI

lore
Share & tools
lore

Alan Cox

author
#0 lore raw

PATCH 1/1 cpqphp_ctrl: remove unreachable path

From: Alan Cox <[email protected]>

register & 0x0B == 0x04 is never true, the code will always take the (identical) 0x00 path anyway. Remove the dead code paths.

Resolves-bug: https://bugzilla.kernel.org/show_bug.cgi?id=44151

---

 drivers/pci/hotplug/cpqphp_ctrl.c |   21 +--------------------
 1 file changed, 1 insertion(+), 20 deletions(-)
drivers/pci/hotplug/cpqphp_ctrl.c +1 -20
index e43908d..36112fe 100644
@@ -2890,27 +2890,8 @@ static int configure_new_function(struct controller *ctrl, struct pci_func *func
 						func->mem_head = mem_node;
 					} else
 						return -ENOMEM;
-				} else if ((temp_register & 0x0BL) == 0x04) {
-					/* Map memory */
-					base = temp_register & 0xFFFFFFF0;
-					base = ~base + 1;
-
-					dbg("CND:      length = 0x%x\n", base);
-					mem_node = get_resource(&(resources->mem_head), base);
-
-					/* allocate the resource to the board */
-					if (mem_node) {
-						base = mem_node->base;
-
-						mem_node->next = func->mem_head;
-						func->mem_head = mem_node;
-					} else
-						return -ENOMEM;
-				} else if ((temp_register & 0x0BL) == 0x06) {
-					/* Those bits are reserved, we can't handle this */
-					return 1;
 				} else {
-					/* Requesting space below 1M */
+					/* Reserved bits or requesting space below 1M */
 					return NOT_ENOUGH_RESOURCES;
 				}
 
maintainer Applied
#1 lore raw
Quoted 7 lines · Alan Cox

From: Alan Cox <[email protected]>

register & 0x0B == 0x04 is never true, the code will always take the (identical) 0x00 path anyway. Remove the dead code paths.

Resolves-bug: https://bugzilla.kernel.org/show_bug.cgi?id=44151

Applied to my "pci/trivial" branch, thanks!

Bjorn

Quoted 43 lines

---

 drivers/pci/hotplug/cpqphp_ctrl.c |   21 +--------------------
 1 file changed, 1 insertion(+), 20 deletions(-)
drivers/pci/hotplug/cpqphp_ctrl.c +1 -21
index e43908d..36112fe 100644
@@ -2890,27 +2890,8 @@ static int configure_new_function(struct controller *ctrl, struct pci_func *func
                                                func->mem_head = mem_node;
                                        } else
                                                return -ENOMEM;
-                               } else if ((temp_register & 0x0BL) == 0x04) {
-                                       /* Map memory */
-                                       base = temp_register & 0xFFFFFFF0;
-                                       base = ~base + 1;
-
-                                       dbg("CND:      length = 0x%x\n", base);
-                                       mem_node = get_resource(&(resources->mem_head), base);
-
-                                       /* allocate the resource to the board */
-                                       if (mem_node) {
-                                               base = mem_node->base;
-
-                                               mem_node->next = func->mem_head;
-                                               func->mem_head = mem_node;
-                                       } else
-                                               return -ENOMEM;
-                               } else if ((temp_register & 0x0BL) == 0x06) {
-                                       /* Those bits are reserved, we can't handle this */
-                                       return 1;
                                } else {
-                                       /* Requesting space below 1M */
+                                       /* Reserved bits or requesting space below 1M */
                                        return NOT_ENOUGH_RESOURCES;
                                }
 
 
--

To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html