lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMuHMdXBpgfVuvpW8gq2XY8uyFjKn3DotEqYhcZFP36PQX4-hg@mail.gmail.com>
Date:	Fri, 4 Jul 2014 16:58:02 +0200
From:	Geert Uytterhoeven <geert@...ux-m68k.org>
To:	Jean-Michel Hautbois <jean-michel.hautbois@...alys.com>
Cc:	linux-kernel <linux-kernel@...r.kernel.org>, sr@...x.de
Subject: Re: [PATCH] Lattice ECP3 FPGA: Correct endianness

On Thu, Jul 3, 2014 at 5:54 PM, Jean-Michel Hautbois
<jean-michel.hautbois@...alys.com> 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?

etc.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ