MIPS: ops-emma2rh: Drop nonsensical db_assert

The db_assert call checks whether the bus_num pointer is non-NULL, but
does so after said pointer has been dereferenced by the assignment on
the previous line. Thus the check is pointless & likely to have been
optimised out by the compiler anyway. The check_args function is static
& only ever called from the local file with bus_num being a pointer to
an on-stack variable, so the check seems somewhat overzealous anyway.
Simply remove it.

Signed-off-by: Paul Burton <paul.burton@imgtec.com>
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/10692/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
This commit is contained in:
Paul Burton 2015-07-13 17:14:21 +01:00 committed by Ralf Baechle
parent e51395d273
commit 2dca88da83

View file

@ -25,7 +25,6 @@
#include <linux/types.h> #include <linux/types.h>
#include <asm/addrspace.h> #include <asm/addrspace.h>
#include <asm/debug.h>
#include <asm/emma/emma2rh.h> #include <asm/emma/emma2rh.h>
@ -40,10 +39,9 @@
static int check_args(struct pci_bus *bus, u32 devfn, u32 * bus_num) static int check_args(struct pci_bus *bus, u32 devfn, u32 * bus_num)
{ {
/* check if the bus is top-level */ /* check if the bus is top-level */
if (bus->parent != NULL) { if (bus->parent != NULL)
*bus_num = bus->number; *bus_num = bus->number;
db_assert(bus_num != NULL); else
} else
*bus_num = 0; *bus_num = 0;
if (*bus_num == 0) { if (*bus_num == 0) {