linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Suren Baghdasaryan <surenb@google.com>
To: "Fabio M. De Francesco" <fmdefrancesco@gmail.com>
Cc: "Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Arve Hjønnevåg" <arve@android.com>,
	"Todd Kjos" <tkjos@android.com>,
	"Martijn Coenen" <maco@android.com>,
	"Joel Fernandes" <joel@joelfernandes.org>,
	"Christian Brauner" <christian@brauner.io>,
	"Hridya Valsaraju" <hridya@google.com>,
	LKML <linux-kernel@vger.kernel.org>,
	linux-staging@lists.linux.dev
Subject: Re: [PATCH] staging: android: Remove set but unused variable in ashmem.c
Date: Fri, 23 Jul 2021 13:14:46 -0700	[thread overview]
Message-ID: <CAJuCfpF37KXw2SG37_XoRyhGWc+uueU0NaxcEfU1=FH-rRm+bQ@mail.gmail.com> (raw)
In-Reply-To: <20210723200514.10139-1-fmdefrancesco@gmail.com>

On Fri, Jul 23, 2021 at 1:05 PM Fabio M. De Francesco
<fmdefrancesco@gmail.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@gmail.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
>

  reply	other threads:[~2021-07-23 20:15 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-23 20:05 [PATCH] staging: android: Remove set but unused variable in ashmem.c Fabio M. De Francesco
2021-07-23 20:14 ` Suren Baghdasaryan [this message]
2021-07-24  7:49   ` Fabio M. De Francesco
2021-07-26 13:44     ` Dan Carpenter
2021-07-28 12:00       ` Fabio M. De Francesco
2021-07-24  2:53 ` kernel test robot
2021-07-24  3:14 ` kernel test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAJuCfpF37KXw2SG37_XoRyhGWc+uueU0NaxcEfU1=FH-rRm+bQ@mail.gmail.com' \
    --to=surenb@google.com \
    --cc=arve@android.com \
    --cc=christian@brauner.io \
    --cc=fmdefrancesco@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hridya@google.com \
    --cc=joel@joelfernandes.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=maco@android.com \
    --cc=tkjos@android.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).