aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/firewire/core-transaction.c
diff options
context:
space:
mode:
authorStefan Richter <stefanr@s5r6.in-berlin.de>2009-10-14 14:37:36 -0400
committerStefan Richter <stefanr@s5r6.in-berlin.de>2009-10-31 06:40:51 -0400
commit5b189bf3633c3b73d4f08124a86f3e019953d412 (patch)
tree3ee30bdd7b5e086e903199f29903400c77a3ddfe /drivers/firewire/core-transaction.c
parentcb7c96da3651111efbe088fa12f9bed61836ea93 (diff)
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>
Diffstat (limited to 'drivers/firewire/core-transaction.c')
-rw-r--r--drivers/firewire/core-transaction.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/firewire/core-transaction.c b/drivers/firewire/core-transaction.c
index 203e6428bada..66789c3cc561 100644
--- a/drivers/firewire/core-transaction.c
+++ b/drivers/firewire/core-transaction.c
@@ -218,6 +218,9 @@ static void fw_fill_request(struct fw_packet *packet, int tcode, int tlabel,
218 packet->header_length = 16; 218 packet->header_length = 16;
219 packet->payload_length = 0; 219 packet->payload_length = 0;
220 break; 220 break;
221
222 default:
223 WARN(1, KERN_ERR "wrong tcode %d", tcode);
221 } 224 }
222 common: 225 common:
223 packet->speed = speed; 226 packet->speed = speed;
@@ -595,8 +598,7 @@ void fw_fill_response(struct fw_packet *response, u32 *request_header,
595 break; 598 break;
596 599
597 default: 600 default:
598 BUG(); 601 WARN(1, KERN_ERR "wrong tcode %d", tcode);
599 return;
600 } 602 }
601 603
602 response->payload_bus = 0; 604 response->payload_bus = 0;