From: Thierry Reding <thierry.reding@gmail.com>
To: Nick Desaulniers <ndesaulniers@google.com>
Cc: airlied@linux.ie, Jagan Teki <jagannadh.teki@gmail.com>,
Rob Herring <robh@kernel.org>,
Thierry Reding <treding@nvidia.com>,
dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drm/panel: simple: fix -Wliteral-conversion warning
Date: Thu, 9 Aug 2018 11:59:57 +0200 [thread overview]
Message-ID: <20180809095957.GA21639@ulmo> (raw)
In-Reply-To: <20180615223749.149073-1-ndesaulniers@google.com>
[-- Attachment #1: Type: text/plain, Size: 2226 bytes --]
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@google.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@agner.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@agner.ch>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180419212003.8155-1-stefan@agner.ch
Thierry
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2018-08-09 10:00 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-15 22:37 [PATCH] drm/panel: simple: fix -Wliteral-conversion warning Nick Desaulniers
2018-08-08 22:06 ` Nick Desaulniers
2018-08-09 9:59 ` Thierry Reding [this message]
2018-08-09 16:38 ` Nick Desaulniers
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180809095957.GA21639@ulmo \
--to=thierry.reding@gmail.com \
--cc=airlied@linux.ie \
--cc=dri-devel@lists.freedesktop.org \
--cc=jagannadh.teki@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=ndesaulniers@google.com \
--cc=robh@kernel.org \
--cc=treding@nvidia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).