[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180809095957.GA21639@ulmo>
Date: Thu, 9 Aug 2018 11:59:57 +0200
From: Thierry Reding <thierry.reding@...il.com>
To: Nick Desaulniers <ndesaulniers@...gle.com>
Cc: airlied@...ux.ie, Jagan Teki <jagannadh.teki@...il.com>,
Rob Herring <robh@...nel.org>,
Thierry Reding <treding@...dia.com>,
dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] drm/panel: simple: fix -Wliteral-conversion warning
On Fri, Jun 15, 2018 at 03:37:49PM -0700, Nick Desaulniers wrote:
> Fixes commit 8cfe83419cdb ("drm/panel: simple: Add
> support for KEO TX31D200VM0BAA")
>
> drivers/gpu/drm/panel/panel-simple.c:1250:27: warning: implicit conversion from
> 'double' to 'u32' (aka 'unsigned int') changes value from 33.5 to 33
> [-Wliteral-conversion]
> .vfront_porch = { 6, 21, 33.5 },
> ~ ^~~~
> drivers/gpu/drm/panel/panel-simple.c:1251:26: warning: implicit conversion from
> 'double' to 'u32' (aka 'unsigned int') changes value from 33.5 to 33
> [-Wliteral-conversion]
> .vback_porch = { 6, 21, 33.5 },
> ~ ^~~~
>
> Signed-off-by: Nick Desaulniers <ndesaulniers@...gle.com>
> ---
> Alternatively, should these be rounded up to 34? I'm guessing the
> current behaviour (truncation) is correct since that's how the patch was
> operating.
Looks like this is a duplicate of what was merged as:
commit c9b6be7dc13e2f87592ee4c9812cb450dba484d5
Author: Stefan Agner <stefan@...er.ch>
Date: Thu Apr 19 23:20:03 2018 +0200
drm/panel: simple: Fix data type in KEO TX31D200VM0BAA timings
All values in a struct struct timing_entry (every entry in
struct display_timing) require an integer. Choose the closest
safe integer of 32.
This avoids a warning seen with clang:
drivers/gpu/drm/panel/panel-simple.c:1250:27: warning: implicit
conversion from 'double' to 'u32' (aka 'unsigned int')
changes value from 33.5 to 33 [-Wliteral-conversion]
.vfront_porch = { 6, 21, 33.5 },
~ ^~~~
drivers/gpu/drm/panel/panel-simple.c:1251:26: warning: implicit
conversion from 'double' to 'u32' (aka 'unsigned int')
changes value from 33.5 to 33 [-Wliteral-conversion]
.vback_porch = { 6, 21, 33.5 },
~ ^~~~
Signed-off-by: Stefan Agner <stefan@...er.ch>
Signed-off-by: Thierry Reding <treding@...dia.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180419212003.8155-1-stefan@agner.ch
Thierry
Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)
Powered by blists - more mailing lists