Skip to content

Commit

Permalink
firewire: core: WARN on wrong usage of core transaction functions
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Stefan Richter committed Oct 31, 2009
1 parent cb7c96d commit 5b189bf
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/firewire/core-transaction.c
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,9 @@ static void fw_fill_request(struct fw_packet *packet, int tcode, int tlabel,
packet->header_length = 16;
packet->payload_length = 0;
break;

default:
WARN(1, KERN_ERR "wrong tcode %d", tcode);
}
common:
packet->speed = speed;
Expand Down Expand Up @@ -595,8 +598,7 @@ void fw_fill_response(struct fw_packet *response, u32 *request_header,
break;

default:
BUG();
return;
WARN(1, KERN_ERR "wrong tcode %d", tcode);
}

response->payload_bus = 0;
Expand Down

0 comments on commit 5b189bf

Please sign in to comment.