linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/panel: simple: fix -Wliteral-conversion warning
@ 2018-06-15 22:37 Nick Desaulniers
  2018-08-08 22:06 ` Nick Desaulniers
  2018-08-09  9:59 ` Thierry Reding
  0 siblings, 2 replies; 4+ messages in thread
From: Nick Desaulniers @ 2018-06-15 22:37 UTC (permalink / raw)
  To: thierry.reding, airlied
  Cc: Jagan Teki, Rob Herring, Thierry Reding, Nick Desaulniers,
	dri-devel, linux-kernel

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.

 drivers/gpu/drm/panel/panel-simple.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c
index cbf1ab404ee7..12bcbd1dd77b 100644
--- a/drivers/gpu/drm/panel/panel-simple.c
+++ b/drivers/gpu/drm/panel/panel-simple.c
@@ -1247,8 +1247,8 @@ static const struct display_timing koe_tx31d200vm0baa_timing = {
 	.hback_porch = { 16, 36, 56 },
 	.hsync_len = { 8, 8, 8 },
 	.vactive = { 480, 480, 480 },
-	.vfront_porch = { 6, 21, 33.5 },
-	.vback_porch = { 6, 21, 33.5 },
+	.vfront_porch = { 6, 21, 33 },
+	.vback_porch = { 6, 21, 33 },
 	.vsync_len = { 8, 8, 8 },
 	.flags = DISPLAY_FLAGS_DE_HIGH,
 };
-- 
2.18.0.rc1.244.gcf134e6275-goog


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/panel: simple: fix -Wliteral-conversion warning
  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
  1 sibling, 0 replies; 4+ messages in thread
From: Nick Desaulniers @ 2018-08-08 22:06 UTC (permalink / raw)
  To: Thierry Reding, airlied
  Cc: Jagan Teki, Rob Herring, Thierry Reding, dri-devel, LKML

bumping for review.
On Fri, Jun 15, 2018 at 3:38 PM Nick Desaulniers
<ndesaulniers@google.com> 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.
>
>  drivers/gpu/drm/panel/panel-simple.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c
> index cbf1ab404ee7..12bcbd1dd77b 100644
> --- a/drivers/gpu/drm/panel/panel-simple.c
> +++ b/drivers/gpu/drm/panel/panel-simple.c
> @@ -1247,8 +1247,8 @@ static const struct display_timing koe_tx31d200vm0baa_timing = {
>         .hback_porch = { 16, 36, 56 },
>         .hsync_len = { 8, 8, 8 },
>         .vactive = { 480, 480, 480 },
> -       .vfront_porch = { 6, 21, 33.5 },
> -       .vback_porch = { 6, 21, 33.5 },
> +       .vfront_porch = { 6, 21, 33 },
> +       .vback_porch = { 6, 21, 33 },
>         .vsync_len = { 8, 8, 8 },
>         .flags = DISPLAY_FLAGS_DE_HIGH,
>  };
> --
> 2.18.0.rc1.244.gcf134e6275-goog
>


-- 
Thanks,
~Nick Desaulniers

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/panel: simple: fix -Wliteral-conversion warning
  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
  2018-08-09 16:38   ` Nick Desaulniers
  1 sibling, 1 reply; 4+ messages in thread
From: Thierry Reding @ 2018-08-09  9:59 UTC (permalink / raw)
  To: Nick Desaulniers
  Cc: airlied, Jagan Teki, Rob Herring, Thierry Reding, dri-devel,
	linux-kernel

[-- 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 --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/panel: simple: fix -Wliteral-conversion warning
  2018-08-09  9:59 ` Thierry Reding
@ 2018-08-09 16:38   ` Nick Desaulniers
  0 siblings, 0 replies; 4+ messages in thread
From: Nick Desaulniers @ 2018-08-09 16:38 UTC (permalink / raw)
  To: Thierry Reding
  Cc: airlied, Jagan Teki, Rob Herring, Thierry Reding, dri-devel, LKML

On Thu, Aug 9, 2018 at 3:00 AM Thierry Reding <thierry.reding@gmail.com> wrote:
>
> 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

Ah, cool.  I need to be better about checking maintainers' trees.

Just curious, how come a patch from April hasn't hit torvalds/linux yet?
-- 
Thanks,
~Nick Desaulniers

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-08-09 16:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2018-08-09 16:38   ` Nick Desaulniers

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).