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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Aug 19, 2014 at 2:50 PM, Mikhail Ulyanov
<mikhail.ulyanov@xxxxxxxxxxxxxxxxxx> 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@xxxxxxxxxxxxxx

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-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux