Re: [PATCH 1/6] V4L2: Add Renesas R-Car JPEG codec driver.

Geert Uytterhoeven
2014-09-23T14:02:16Z

On Tue, Aug 19, 2014 at 2:50 PM, Mikhail Ulyanov
<mikhail.ulyanov@cogentembedded.com> wrote:
> +static void put_short_be(unsigned long *p, u16 v)
> +{
> + u16 *addr = (u16 *)*p;
> +
> + *addr = cpu_to_be16(v);
> + *p += 2;
> +}
> +
> +static void put_word_be(unsigned long *p, u32 v)
> +{
> + u32 *addr = (u32 *)*p;
> +
> + *addr = cpu_to_be32(v);
> + *p += 4;
> +}

Is the address in *p guaranteed to be aligned to 2 resp. 4 bytes?

If not, you can use put_unaligned*().

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-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