Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5b189bf3 authored by Stefan Richter's avatar Stefan Richter
Browse files

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: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
parent cb7c96da
Loading
Loading
Loading
Loading
+4 −2
Original line number Original line Diff line number Diff line
@@ -218,6 +218,9 @@ static void fw_fill_request(struct fw_packet *packet, int tcode, int tlabel,
		packet->header_length = 16;
		packet->header_length = 16;
		packet->payload_length = 0;
		packet->payload_length = 0;
		break;
		break;

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


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


	response->payload_bus = 0;
	response->payload_bus = 0;