[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170207155334.fq4emlhpj4hkhets@lukather>
Date: Tue, 7 Feb 2017 16:53:34 +0100
From: Maxime Ripard <maxime.ripard@...e-electrons.com>
To: Thierry Reding <thierry.reding@...il.com>
Cc: Rob Herring <robh+dt@...nel.org>,
Mark Rutland <mark.rutland@....com>,
David Airlie <airlied@...ux.ie>,
dri-devel@...ts.freedesktop.org, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/2] drm/panel: Add driver for sitronix ST7789V panel
On Mon, Feb 06, 2017 at 02:26:20PM +0100, Thierry Reding wrote:
> > +#define NUMARGS(...) (sizeof((int[]){__VA_ARGS__}) / sizeof(int))
> > +#define st7789v_send(ctx, cmd, ...) \
> > + st7789v_write_command_data(ctx, cmd, NUMARGS(__VA_ARGS__), \
> > + ##__VA_ARGS__)
>
> How is this going to work if any of the arguments happens to not be an
> int? What if you have something like this:
>
> u8 value = 0x2;
>
> st7789v_write_command_data(ctx, cmd, 0x1, value, 0x3);
>
> ? Wouldn't that invalidly read "value" as int and wrongly increment the
> ap by three bytes too many?
Hmmm, it might be. I'll remove it, and take all your other changes
into account.
Thanks!
Maxime
--
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
Download attachment "signature.asc" of type "application/pgp-signature" (802 bytes)
Powered by blists - more mailing lists