From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============8449637795434249358==" MIME-Version: 1.0 From: Jarkko Sakkinen To: kbuild-all@lists.01.org Subject: Re: [bp:tip-x86-sgx 11/25] arch/x86/kernel/cpu/sgx/encl.h:45:19: warning: variable 'encl' set but not used Date: Wed, 18 Nov 2020 17:01:29 +0200 Message-ID: <20201118150129.GA30164@kernel.org> In-Reply-To: <20201118104254.GA8122@zn.tnic> List-Id: --===============8449637795434249358== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable On Wed, Nov 18, 2020 at 11:42:54AM +0100, Borislav Petkov wrote: > On Wed, Nov 18, 2020 at 11:23:55AM +0800, kernel test robot wrote: > > tree: https://git.kernel.org/pub/scm/linux/kernel/git/bp/bp.git tip-x= 86-sgx > > head: 56e2d0eff4f8db87cf77d9c8481041878177c680 > > commit: 4b634f57cac2e1d28cfa0ca961e561362fc3f957 [11/25] x86/sgx: Add a= n SGX misc driver interface > > config: x86_64-allyesconfig (attached as .config) > > compiler: gcc-9 (Debian 9.3.0-15) 9.3.0 > > reproduce (this is a W=3D1 build): > > # https://git.kernel.org/pub/scm/linux/kernel/git/bp/bp.git/com= mit/?id=3D4b634f57cac2e1d28cfa0ca961e561362fc3f957 > > git remote add bp https://git.kernel.org/pub/scm/linux/kernel/g= it/bp/bp.git > > git fetch --no-tags bp tip-x86-sgx > > git checkout 4b634f57cac2e1d28cfa0ca961e561362fc3f957 > > # save the attached .config to linux build tree > > make W=3D1 ARCH=3Dx86_64 = > > = > > If you fix the issue, kindly add following tag as appropriate > > Reported-by: kernel test robot > > = > > All warnings (new ones prefixed by >>): > > = > > In file included from arch/x86/kernel/cpu/sgx/driver.c:11: > > arch/x86/kernel/cpu/sgx/encl.h: In function 'sgx_encl_find': > > >> arch/x86/kernel/cpu/sgx/encl.h:45:19: warning: variable 'encl' set b= ut not used [-Wunused-but-set-variable] > > 45 | struct sgx_encl *encl; > > | ^~~~ > > = > > vim +/encl +45 arch/x86/kernel/cpu/sgx/encl.h > > = > > 40 = > > 41 static inline int sgx_encl_find(struct mm_struct *mm, unsigned l= ong addr, > > 42 struct vm_area_struct **vma) > > 43 { > > 44 struct vm_area_struct *result; > > > 45 struct sgx_encl *encl; > > 46 = > > 47 result =3D find_vma(mm, addr); > > 48 if (!result || result->vm_ops !=3D &sgx_vm_ops || addr < result= ->vm_start) > > 49 return -EINVAL; > > 50 = > > 51 encl =3D result->vm_private_data; > = > Looks like that encl needs to go, judging by: > = > * Do not check !vm_private_data in sgx_encl_find(), as the enclave is > created at VFS open. > = > in patch 11. > = > Jarkko? Yes, it is useless. > -- = > Regards/Gruss, > Boris. > = > SUSE Software Solutions Germany GmbH, GF: Felix Imend=C3=B6rffer, HRB 368= 09, AG N=C3=BCrnberg = /Jarkko --===============8449637795434249358==--