Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756620AbaGDPQ4 (ORCPT ); Fri, 4 Jul 2014 11:16:56 -0400 Received: from mail-ob0-f178.google.com ([209.85.214.178]:43518 "EHLO mail-ob0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751554AbaGDPQz (ORCPT ); Fri, 4 Jul 2014 11:16:55 -0400 MIME-Version: 1.0 In-Reply-To: References: From: Jean-Michel Hautbois Date: Fri, 4 Jul 2014 17:16:39 +0200 X-Google-Sender-Auth: txOz081Ouj0FwlLmF2idKgIhv-Y Message-ID: Subject: Re: [PATCH] Lattice ECP3 FPGA: Correct endianness To: Geert Uytterhoeven Cc: linux-kernel , Stefan Roese Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 2014-07-04 16:58 GMT+02:00 Geert Uytterhoeven : > On Thu, Jul 3, 2014 at 5:54 PM, Jean-Michel Hautbois > wrote: >> --- a/drivers/misc/lattice-ecp3-config.c >> +++ b/drivers/misc/lattice-ecp3-config.c >> @@ -93,7 +93,7 @@ static void firmware_load(const struct firmware *fw, >> void *context) >> txbuf[0] = FPGA_CMD_READ_ID; >> ret = spi_write_then_read(spi, txbuf, 8, rxbuf, rx_len); >> dev_dbg(&spi->dev, "FPGA JTAG ID=%08x\n", *(u32 *)&rxbuf[4]); >> - jedec_id = *(u32 *)&rxbuf[4]; >> + jedec_id = be32_to_cpu(*(u32 *)&rxbuf[4]); > > What about "jedec_id = get_unaligned_be32(&rxbuf[4]);" instead? Eh I didn't know such a function existed ! :) JM -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/