Skip to contentSkip to conversation

firewire: use get/put_endian helpers

PATCH In review Harvey Harrison 2 participants 2 messages May 29, 2008

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 9/37 firewire: use get/put_endian helpers

---
 drivers/firewire/fw-card.c   |    2 +-
 drivers/firewire/fw-device.c |    2 +-
 drivers/firewire/fw-ohci.c   |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
drivers/firewire/fw-card.c +1 -1
index 5b4c0d9..2947db5 100644
@@ -204,7 +204,7 @@ complete_bm_lock(struct fw_card *card, int rcode,
 	struct bm_data *bmd = data;
 
 	if (rcode == RCODE_COMPLETE)
-		bmd->old = be32_to_cpu(*(__be32 *) payload);
+		bmd->old = get_be32((__be32 *)payload);
 	bmd->rcode = rcode;
 	complete(&bmd->done);
 }
drivers/firewire/fw-device.c +1 -1
index d9c8daf..4072658 100644
@@ -394,7 +394,7 @@ complete_transaction(struct fw_card *card, int rcode,
 	struct read_quadlet_callback_data *callback_data = data;
 
 	if (rcode == RCODE_COMPLETE)
-		callback_data->data = be32_to_cpu(*(__be32 *)payload);
+		callback_data->data = get_be32((__be32 *)payload);
 	callback_data->rcode = rcode;
 	complete(&callback_data->done);
 }
drivers/firewire/fw-ohci.c +1 -1
index 4f02c55..ee5c87f 100644
@@ -1781,7 +1781,7 @@ static int handle_ir_dualbuffer_packet(struct context *context,
 		memcpy(ctx->header + i + 4, p + 8, ctx->base.header_size - 4);
 		i += ctx->base.header_size;
 		ctx->excess_bytes +=
-			(le32_to_cpu(*(__le32 *)(p + 4)) >> 16) & 0xffff;
+			(get_le32((__le32 *)(p + 4)) >> 16) & 0xffff;
 		p += ctx->base.header_size + 4;
 	}
 	ctx->header_length = i;
Signature · 1 line
1.5.6.rc0.277.g804cf
#1 lore raw

Harvey,

a minor side note: A pointer to your patch which adds the helpers would have saved me 10 minutes of my life. I wasn't up to speed where this API is available.

I.e. please add "requires patch $FOOBAR" below the --- delimiter when you post dependent and depending patch to different addresses.

Signature · 3 lines
Stefan Richter
-=====-==--- -=-= ====-
http://arcgraph.de/sr/