lkml.org 
[lkml]   [2009]   [Oct]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH 1/2] firewire: core: WARN on wrong usage of core transaction functions
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/


\
 
 \ /
  Last update: 2009-10-14 20:49    [W:1.880 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site