Linux MIPS Architecture development
 help / color / mirror / Atom feed
* [PATCH 1/2] MIPS: PCI: ops-emma2rh: drop nonsensical db_assert
@ 2015-07-13 16:14 Paul Burton
  2015-07-13 16:14 ` Paul Burton
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Paul Burton @ 2015-07-13 16:14 UTC (permalink / raw)
  To: linux-mips; +Cc: Paul Burton, Ralf Baechle, linux-kernel

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>
---

 arch/mips/pci/ops-emma2rh.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/arch/mips/pci/ops-emma2rh.c b/arch/mips/pci/ops-emma2rh.c
index 710aef5..2dc97c4 100644
--- a/arch/mips/pci/ops-emma2rh.c
+++ b/arch/mips/pci/ops-emma2rh.c
@@ -25,7 +25,6 @@
 #include <linux/types.h>
 
 #include <asm/addrspace.h>
-#include <asm/debug.h>
 
 #include <asm/emma/emma2rh.h>
 
@@ -40,10 +39,9 @@
 static int check_args(struct pci_bus *bus, u32 devfn, u32 * bus_num)
 {
 	/* check if the bus is top-level */
-	if (bus->parent != NULL) {
+	if (bus->parent != NULL)
 		*bus_num = bus->number;
-		db_assert(bus_num != NULL);
-	} else
+	else
 		*bus_num = 0;
 
 	if (*bus_num == 0) {
-- 
2.4.5

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

end of thread, other threads:[~2015-07-14  8:32 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-13 16:14 [PATCH 1/2] MIPS: PCI: ops-emma2rh: drop nonsensical db_assert Paul Burton
2015-07-13 16:14 ` Paul Burton
2015-07-13 16:14 ` [PATCH 2/2] MIPS: drop CONFIG_RUNTIME_DEBUG & debug.h Paul Burton
2015-07-13 16:14   ` Paul Burton
2015-07-14  8:30 ` [PATCH 1/2] MIPS: PCI: ops-emma2rh: drop nonsensical db_assert Ralf Baechle
2015-07-14  8:32   ` Paul Burton
2015-07-14  8:32     ` Paul Burton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox