linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] cpqphp_ctrl: remove unreachable path
@ 2012-09-04 14:39 Alan Cox
  2012-09-10 22:47 ` Bjorn Helgaas
  0 siblings, 1 reply; 2+ messages in thread
From: Alan Cox @ 2012-09-04 14:39 UTC (permalink / raw)
  To: linux-pci

From: Alan Cox <alan@linux.intel.com>

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
Signed-off-by: Alan Cox <alan@linux.intel.com>
---

 drivers/pci/hotplug/cpqphp_ctrl.c |   21 +--------------------
 1 file changed, 1 insertion(+), 20 deletions(-)

diff --git a/drivers/pci/hotplug/cpqphp_ctrl.c b/drivers/pci/hotplug/cpqphp_ctrl.c
index e43908d..36112fe 100644
--- a/drivers/pci/hotplug/cpqphp_ctrl.c
+++ b/drivers/pci/hotplug/cpqphp_ctrl.c
@@ -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;
 				}
 


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] cpqphp_ctrl: remove unreachable path
  2012-09-04 14:39 [PATCH] cpqphp_ctrl: remove unreachable path Alan Cox
@ 2012-09-10 22:47 ` Bjorn Helgaas
  0 siblings, 0 replies; 2+ messages in thread
From: Bjorn Helgaas @ 2012-09-10 22:47 UTC (permalink / raw)
  To: Alan Cox; +Cc: linux-pci

On Tue, Sep 4, 2012 at 8:39 AM, Alan Cox <alan@lxorguk.ukuu.org.uk> wrote:
> From: Alan Cox <alan@linux.intel.com>
>
> 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
> Signed-off-by: Alan Cox <alan@linux.intel.com>

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

Bjorn

> ---
>
>  drivers/pci/hotplug/cpqphp_ctrl.c |   21 +--------------------
>  1 file changed, 1 insertion(+), 20 deletions(-)
>
> diff --git a/drivers/pci/hotplug/cpqphp_ctrl.c b/drivers/pci/hotplug/cpqphp_ctrl.c
> index e43908d..36112fe 100644
> --- a/drivers/pci/hotplug/cpqphp_ctrl.c
> +++ b/drivers/pci/hotplug/cpqphp_ctrl.c
> @@ -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 majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-09-10 22:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-04 14:39 [PATCH] cpqphp_ctrl: remove unreachable path Alan Cox
2012-09-10 22:47 ` Bjorn Helgaas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).