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

Commit b269825b authored by Ulrich Kunitz's avatar Ulrich Kunitz Committed by John W. Linville
Browse files

[PATCH] zd1211rw: Fixed endianess issue with length info tag detection



Discovered a problem while accessing www.python.org on my PPC32.
The problem was pretty consistent for all sticks. The reason was
that while testing for the length info tag, I ignored the
endianess of the host system.

Please recognize that converting the constant to little endian, we
create faster code.

Signed-off-by: default avatarUlrich Kunitz <kune@deine-taler.de>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent b1162b63
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -544,11 +544,11 @@ static void handle_rx_packet(struct zd_usb *usb, const u8 *buffer,
	 * be padded. Unaligned access might also happen if the length_info
	 * structure is not present.
	 */
	if (get_unaligned(&length_info->tag) == RX_LENGTH_INFO_TAG) {
	if (get_unaligned(&length_info->tag) == cpu_to_le16(RX_LENGTH_INFO_TAG))
	{
		unsigned int l, k, n;
		for (i = 0, l = 0;; i++) {
			k = le16_to_cpu(get_unaligned(
				&length_info->length[i]));
			k = le16_to_cpu(get_unaligned(&length_info->length[i]));
			n = l+k;
			if (n > length)
				return;