Date: Sun, 18 Mar 2012 19:03:26 +0100 From: Clemens Ladisch Subject: firewire: ohci: optimize control bit checks Doing the endian conversion on the constant instead of the memory field allows the compiler to do the conversion at compile time. Signed-off-by: Clemens Ladisch Signed-off-by: Stefan Richter --- drivers/firewire/ohci.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) --- a/drivers/firewire/ohci.c +++ b/drivers/firewire/ohci.c @@ -2732,7 +2732,7 @@ static int handle_ir_packet_per_buffer(s p = last + 1; copy_iso_headers(ctx, p); - if (le16_to_cpu(last->control) & DESCRIPTOR_IRQ_ALWAYS) { + if (last->control & cpu_to_le16(DESCRIPTOR_IRQ_ALWAYS)) { ir_header = (__le32 *) p; ctx->base.callback.sc(&ctx->base, le32_to_cpu(ir_header[0]) & 0xffff, @@ -2764,7 +2764,7 @@ static int handle_ir_buffer_fill(struct le16_to_cpu(last->req_count), DMA_FROM_DEVICE); - if (le16_to_cpu(last->control) & DESCRIPTOR_IRQ_ALWAYS) + if (last->control & cpu_to_le16(DESCRIPTOR_IRQ_ALWAYS)) ctx->base.callback.mc(&ctx->base, le32_to_cpu(last->data_address) + le16_to_cpu(last->req_count), @@ -2836,7 +2836,7 @@ static int handle_it_packet(struct conte le16_to_cpu(pd->res_count)); ctx->header_length += 4; } - if (le16_to_cpu(last->control) & DESCRIPTOR_IRQ_ALWAYS) { + if (last->control & cpu_to_le16(DESCRIPTOR_IRQ_ALWAYS)) { ctx->base.callback.sc(&ctx->base, le16_to_cpu(last->res_count), ctx->header_length, ctx->header, ctx->base.callback_data);