Re: [PATCH 1/6] V4L2: Add Renesas R-Car JPEG codec driver.
From: Geert Uytterhoeven <geert@linux-m68k.org>
Date: 2014-09-23 14:02:14
Also in:
linux-devicetree, linux-media
From: Geert Uytterhoeven <geert@linux-m68k.org>
Date: 2014-09-23 14:02:14
Also in:
linux-devicetree, linux-media
On Tue, Aug 19, 2014 at 2:50 PM, Mikhail Ulyanov [off-list ref] 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