From: Thierry Reding Subject: Re: [PATCH] drm/panel: simple: fix -Wliteral-conversion warning Date: Thu, 9 Aug 2018 11:59:57 +0200 Message-ID: <20180809095957.GA21639@ulmo> References: <20180615223749.149073-1-ndesaulniers@google.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0470752529==" Return-path: Received: from mail-wm0-x244.google.com (mail-wm0-x244.google.com [IPv6:2a00:1450:400c:c09::244]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7D0F26E066 for ; Thu, 9 Aug 2018 10:00:00 +0000 (UTC) Received: by mail-wm0-x244.google.com with SMTP id n11-v6so5766221wmc.2 for ; Thu, 09 Aug 2018 03:00:00 -0700 (PDT) In-Reply-To: <20180615223749.149073-1-ndesaulniers@google.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: Nick Desaulniers Cc: airlied@linux.ie, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Thierry Reding , Jagan Teki List-Id: dri-devel@lists.freedesktop.org --===============0470752529== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="lrZ03NoBR/3+SXJZ" Content-Disposition: inline --lrZ03NoBR/3+SXJZ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jun 15, 2018 at 03:37:49PM -0700, Nick Desaulniers wrote: > Fixes commit 8cfe83419cdb ("drm/panel: simple: Add > support for KEO TX31D200VM0BAA") >=20 > drivers/gpu/drm/panel/panel-simple.c:1250:27: warning: implicit conversio= n from > 'double' to 'u32' (aka 'unsigned int') changes value from 33.5 to 33 > [-Wliteral-conversion] > .vfront_porch =3D { 6, 21, 33.5 }, > ~ ^~~~ > drivers/gpu/drm/panel/panel-simple.c:1251:26: warning: implicit conversio= n from > 'double' to 'u32' (aka 'unsigned int') changes value from 33.5 to 33 > [-Wliteral-conversion] > .vback_porch =3D { 6, 21, 33.5 }, > ~ ^~~~ >=20 > Signed-off-by: Nick Desaulniers > --- > 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 Date: Thu Apr 19 23:20:03 2018 +0200 drm/panel: simple: Fix data type in KEO TX31D200VM0BAA timings =20 All values in a struct struct timing_entry (every entry in struct display_timing) require an integer. Choose the closest safe integer of 32. =20 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 =3D { 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 =3D { 6, 21, 33.5 }, ~ ^~~~ =20 Signed-off-by: Stefan Agner Signed-off-by: Thierry Reding Link: https://patchwork.freedesktop.org/patch/msgid/20180419212003.8155= -1-stefan@agner.ch Thierry --lrZ03NoBR/3+SXJZ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEiOrDCAFJzPfAjcif3SOs138+s6EFAltsEJoACgkQ3SOs138+ s6FCyQ//bVHrl+Gzj3ilKtzK0SyWlW+cdLwqsfM1QGEVMmPl/+X/v39JLeL3sPR/ eLZEUf9HD2kaDXVKsOyBlD6G1TYnOgh0Du3qKxUBHvUaIMpOVozDctGKFh1SE/IX gCevfcbGn7isq9GvCdHMWrerLce8+6QfYbh4hCIRXT+CqiEo0BtsJHb7u/g9QvTS 6l0Wfq0pw54CuLUNLDol/XywbIxaiv52kis0IM31+nUTaAL32+PErq6+YQdNMOXw TyLmDjZ6m9PJDEct1cB+39IFApeAs31e7sG43hisSGC9I6WNtrzn5u0X7xxmwzDV 8If5uN7wA9Mo5seZDK4TMYFZgduU+jr5/I2/17NVsuTXbW143XwnaPHerODvfosv imFTpOCnjteTHX7zNwuyT/HWB6OB2mSPXuZwOrJEAPmkIKkyY75XKHYm9f4g+9t8 nBtzOxs/9l5Rc2/iHg5d56WZAO6C+F9beNRbDjp5LcOlsGAutOA+PfTIIHQ/nOiF c7kqVWHueHiQ5sTRakxajnmbel1zgnTaEZKz+Iqm6eMFMGL/x//kfmczm78m7joF LV58eSKGmPZ5QZJ0IOJlmHsuPWFX8Q97S+XW2seh9vTbFlifMp1PlqeRSE3rEJSU I9ueyA62+EZ9f4sGfFXBa4nSuOXEvqBnDe4ytj51E1QtdmWkdLY= =NqZw -----END PGP SIGNATURE----- --lrZ03NoBR/3+SXJZ-- --===============0470752529== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KZHJpLWRldmVs IG1haWxpbmcgbGlzdApkcmktZGV2ZWxAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlz dHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vZHJpLWRldmVsCg== --===============0470752529==--