mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/2] firewire: core: WARN on wrong usage of core transaction functions
@ 2009-10-14 18:37 Stefan Richter
  2009-10-14 18:40 ` [PATCH 2/2] firewire: ohci: 0 may be a valid DMA address Stefan Richter
  0 siblings, 1 reply; 2+ messages in thread
From: Stefan Richter @ 2009-10-14 18:37 UTC (permalink / raw)
  To: linux1394-devel; +Cc: linux-kernel

In the code path which creates request packets, clearly mark a switch
branch which must never be reached with a WARN.

In the code path which creates response packets, replace a BUG by a
friendlier to debug WARN.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
---
 drivers/firewire/core-transaction.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Index: linux-2.6.31/drivers/firewire/core-transaction.c
===================================================================
--- linux-2.6.31.orig/drivers/firewire/core-transaction.c
+++ linux-2.6.31/drivers/firewire/core-transaction.c
@@ -218,6 +218,9 @@ static void fw_fill_request(struct fw_pa
 		packet->header_length = 16;
 		packet->payload_length = 0;
 		break;
+
+	default:
+		WARN(1, KERN_ERR "wrong tcode %d", tcode);
 	}
  common:
 	packet->speed = speed;
@@ -595,8 +598,7 @@ void fw_fill_response(struct fw_packet *
 		break;
 
 	default:
-		BUG();
-		return;
+		WARN(1, KERN_ERR "wrong tcode %d", tcode);
 	}
 
 	response->payload_bus = 0;

-- 
Stefan Richter
-=====-==--= =-=- -===-
http://arcgraph.de/sr/


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

end of thread, other threads:[~2009-10-14 18:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-10-14 18:37 [PATCH 1/2] firewire: core: WARN on wrong usage of core transaction functions Stefan Richter
2009-10-14 18:40 ` [PATCH 2/2] firewire: ohci: 0 may be a valid DMA address Stefan Richter

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

all inboxes | Powered by JetHome®