All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Fabio M. De Francesco" <fmdefrancesco@gmail.com>
To: Julia Lawall <julia.lawall@inria.fr>
Cc: outreachy-kernel <outreachy-kernel@googlegroups.com>,
	gregkh@linuxfoundation.org
Subject: Re: Variables defined, (sometimes) assigned, and never used
Date: Fri, 09 Apr 2021 22:26:33 +0200	[thread overview]
Message-ID: <1845136.ylLD8seOMz@localhost.localdomain> (raw)
In-Reply-To: <alpine.DEB.2.22.394.2104092213000.23056@hadrien>

On Friday, April 9, 2021 10:14:09 PM CEST Julia Lawall wrote:
> On Fri, 9 Apr 2021, Fabio M. De Francesco wrote:
> > When compiling with flag W=1 a lot of warnings about variables defined
> > but never used show up. If one read the source sometimes it's clear
> > that the original author placed them there because she/he wants to use
> > the variable for doing something in a future release of the driver.
> > I've also seen a comment like /* TODO */ near some unused variables.
> > 
> > I thought to delete a couple of variables that are declared, may be
> > also
> > assigned as a result of some expression, but neither  used within a
> > function or returned to the caller.
> > 
> > What to do with those (currently) unnecessary variables? Should we
> > remove them or let everything as is?
> 
> Generally, code that is not used is not wanted.  But use some common
> sense.
> 
> Be sure to compile the code.  It can happen that the variable is only
> used by a macro.  Not very nice, but it can happen.
> 
> julia

I'll check carefully that the resulting code can still work. I'm a bit 
tired of removing camelcase and the like :(

Thanks,

Fabio





      reply	other threads:[~2021-04-09 20:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-09 20:09 Variables defined, (sometimes) assigned, and never used Fabio M. De Francesco
2021-04-09 20:14 ` Julia Lawall
2021-04-09 20:26   ` Fabio M. De Francesco [this message]

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=1845136.ylLD8seOMz@localhost.localdomain \
    --to=fmdefrancesco@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=julia.lawall@inria.fr \
    --cc=outreachy-kernel@googlegroups.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.