[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJuCfpF37KXw2SG37_XoRyhGWc+uueU0NaxcEfU1=FH-rRm+bQ@mail.gmail.com>
Date: Fri, 23 Jul 2021 13:14:46 -0700
From: Suren Baghdasaryan <surenb@...gle.com>
To: "Fabio M. De Francesco" <fmdefrancesco@...il.com>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Arve Hjønnevåg <arve@...roid.com>,
Todd Kjos <tkjos@...roid.com>,
Martijn Coenen <maco@...roid.com>,
Joel Fernandes <joel@...lfernandes.org>,
Christian Brauner <christian@...uner.io>,
Hridya Valsaraju <hridya@...gle.com>,
LKML <linux-kernel@...r.kernel.org>,
linux-staging@...ts.linux.dev
Subject: Re: [PATCH] staging: android: Remove set but unused variable in ashmem.c
On Fri, Jul 23, 2021 at 1:05 PM Fabio M. De Francesco
<fmdefrancesco@...il.com> wrote:
>
> Remove variable 'inode' tnat is set but unused. Issue detected
> by building with warning option -Wunused-but-set-variable.
>
> Signed-off-by: Fabio M. De Francesco <fmdefrancesco@...il.com>
> ---
> drivers/staging/android/ashmem.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/drivers/staging/android/ashmem.c b/drivers/staging/android/ashmem.c
> index ddbde3f8430e..606e988d3f63 100644
> --- a/drivers/staging/android/ashmem.c
> +++ b/drivers/staging/android/ashmem.c
> @@ -406,7 +406,6 @@ static int ashmem_mmap(struct file *file, struct vm_area_struct *vma)
> if (!asma->file) {
> char *name = ASHMEM_NAME_DEF;
> struct file *vmfile;
> - struct inode *inode;
>
> if (asma->name[ASHMEM_NAME_PREFIX_LEN] != '\0')
> name = asma->name;
> @@ -418,7 +417,6 @@ static int ashmem_mmap(struct file *file, struct vm_area_struct *vma)
> goto out;
> }
> vmfile->f_mode |= FMODE_LSEEK;
> - inode = file_inode(vmfile);
> lockdep_set_class(&inode->i_rwsem, &backing_shmem_inode_class);
How about its usage in the above lockdep_set_class(&inode->i_rwsem,
...) call? I'm guessing you are building with CONFIG_LOCKDEP=n.
Have you tried adding __maybe_unused in inode variable definition to
get rid of the warning?
> asma->file = vmfile;
> /*
> --
> 2.32.0
>
Powered by blists - more mailing lists