From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thierry Reding Subject: Re: [radeon-alex:drm-next-4.12-wip 34/40] drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c:620:4: warning: left shift count >= width of type Date: Mon, 13 Feb 2017 08:24:13 +0100 Message-ID: <20170213072413.GA13451@ulmo.ba.sec> References: <201702110342.VxXxgZZq%fengguang.wu@intel.com> <66324f2c-cb75-5c11-42b6-c47c5456b52b@vodafone.de> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1505514029==" Return-path: Received: from mail-wm0-x241.google.com (mail-wm0-x241.google.com [IPv6:2a00:1450:400c:c09::241]) by gabe.freedesktop.org (Postfix) with ESMTPS id D07E26E33C for ; Mon, 13 Feb 2017 07:24:16 +0000 (UTC) Received: by mail-wm0-x241.google.com with SMTP id c85so17647339wmi.1 for ; Sun, 12 Feb 2017 23:24:16 -0800 (PST) In-Reply-To: <66324f2c-cb75-5c11-42b6-c47c5456b52b@vodafone.de> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: Christian =?utf-8?B?S8O2bmln?= Cc: Junwei Zhang , Alex Deucher , Nicolai =?utf-8?Q?H=C3=A4hnle?= , dri-devel@lists.freedesktop.org, Christian =?utf-8?B?S8O2bmln?= List-Id: dri-devel@lists.freedesktop.org --===============1505514029== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="fdj2RfSjLxBAspz7" Content-Disposition: inline --fdj2RfSjLxBAspz7 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Feb 11, 2017 at 08:55:50AM +0100, Christian K=C3=B6nig wrote: > Mhm, guys any idea why the build bot is spamming us with that warning? >=20 > The type is 64bit and the shift is 63, so that should work fine. 1UL will be an unsigned long, which is 64 bit on 64 bit architectures only. Xtensa is a 32 bit platform, hence 1UL will effectively be 32 bits and 1UL << 63 would effectively be 0. I think the safe thing to do here would be to change 1UL to 1ULL to make sure there are enough bits. unsigned long long is guaranteed to be at least 64 bits. Alternatively if you no longer want to support 32 bit architectures you could depend on the Kconfig symbol 64BIT, but I suspect you don't want to do that. Thierry > Am 10.02.2017 um 20:48 schrieb kbuild test robot: > > tree: git://people.freedesktop.org/~agd5f/linux.git drm-next-4.12-wip > > head: d32ff0ea8e22964abcc6406e00a0646f2bfb94c7 > > commit: 382a21d981661dbc8198c37dc95707e1e381ce76 [34/40] drm/amdgpu: IO= CTL interface for PRT support v4 > > config: xtensa-allmodconfig (attached as .config) > > compiler: xtensa-linux-gcc (GCC) 4.9.0 > > reproduce: > > wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-test= s.git/plain/sbin/make.cross -O ~/bin/make.cross > > chmod +x ~/bin/make.cross > > git checkout 382a21d981661dbc8198c37dc95707e1e381ce76 > > # save the attached .config to linux build tree > > make.cross ARCH=3Dxtensa > >=20 > > All warnings (new ones prefixed by >>): > >=20 > > drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c: In function 'amdgpu_gem_va= _ioctl': > > > > drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c:620:4: warning: left shift = count >=3D width of type > > va_flags |=3D AMDGPU_PTE_PRT; > > ^ > >=20 > > vim +620 drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c > >=20 > > 604 r =3D -ENOENT; > > 605 goto error_backoff; > > 606 } > > 607 } else { > > 608 bo_va =3D fpriv->prt_va; > > 609 } > > 610=09 > > 611 switch (args->operation) { > > 612 case AMDGPU_VA_OP_MAP: > > 613 if (args->flags & AMDGPU_VM_PAGE_READABLE) > > 614 va_flags |=3D AMDGPU_PTE_READABLE; > > 615 if (args->flags & AMDGPU_VM_PAGE_WRITEABLE) > > 616 va_flags |=3D AMDGPU_PTE_WRITEABLE; > > 617 if (args->flags & AMDGPU_VM_PAGE_EXECUTABLE) > > 618 va_flags |=3D AMDGPU_PTE_EXECUTABLE; > > 619 if (args->flags & AMDGPU_VM_PAGE_PRT) > > > 620 va_flags |=3D AMDGPU_PTE_PRT; > > 621 r =3D amdgpu_vm_bo_map(adev, bo_va, args->va_address, > > 622 args->offset_in_bo, args->map_size, > > 623 va_flags); > > 624 break; > > 625 case AMDGPU_VA_OP_UNMAP: > > 626 r =3D amdgpu_vm_bo_unmap(adev, bo_va, args->va_address); > > 627 break; > > 628 default: > >=20 > > --- > > 0-DAY kernel test infrastructure Open Source Technology = Center > > https://lists.01.org/pipermail/kbuild-all Intel Corpo= ration > >=20 > >=20 > > _______________________________________________ > > dri-devel mailing list > > dri-devel@lists.freedesktop.org > > https://lists.freedesktop.org/mailman/listinfo/dri-devel >=20 >=20 > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel --fdj2RfSjLxBAspz7 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEiOrDCAFJzPfAjcif3SOs138+s6EFAlihXxoACgkQ3SOs138+ s6GKNg/+PM3Dv8M+4rDrsH/JbRbF5tNFX48CldmedYZrcW6B9qxATJljLOvOJq0f hpgzSYnxR5uM9qPA/zv9vBbmchGNtDd4vAxVcLT3Y1odLZ0OW6w7IADTWMMv8zMe lylttOqq4qdJQX91V212OjxR8QdSy8cl4s4n6oQJ+DuV7clfRsFjrfu1Xe04OD73 hmUPY0ffuMTKNjgPCgd1ujZO/nJykLD6xKfiaWnqQQhFmL8pi+ogTON0wzpSESFh UKDHnCuUjvCYyO7IAN0cbqVLSgOv66xDBLPjZ2GZ8fwJG1OD+lqJOYzt8AgN6aoV irpIZgcKwnnGQFpU9oko9dzTqxI067qYjYde/HfK0uGS9uNM7VaWod3VR/wqTM3b QC5SCJlyjiF7h35TqvymF3THuvxRf/5NQumYmNuPsFIKjJQfTXbx7x+ISVVerhZX ayG7k89nK0O6gX+TpOms50fyehpCUeL3XVD8s5akvIxtkYSZIXlmLQFtH8nhUeEI QV3Lr2pSaWSP5i38GEx8sjUYTsBaalf5xuerd9+5zhGf1TInTWbj7Aw/6wqVg4bn Zs2S3dzHNz4YNRiIvuNIKBjTX31b89ecNChUHFwT2RWPUF0X0a6t3gb8wspaj1++ p/QtJd84M1YI/uK4/kblUnQM/XhSQegwo8Ru8CV7Lgp/4SaHjbQ= =zGPT -----END PGP SIGNATURE----- --fdj2RfSjLxBAspz7-- --===============1505514029== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KZHJpLWRldmVs IG1haWxpbmcgbGlzdApkcmktZGV2ZWxAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlz dHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vZHJpLWRldmVsCg== --===============1505514029==--