All of lore.kernel.org
 help / color / mirror / Atom feed
From: Roland Kammerer <roland.kammerer@linbit.com>
To: punit vara <punitvara@gmail.com>, drbd-dev@lists.linbit.com
Subject: Re: [Drbd-dev] [DRBD-user] [PATCH 1/6] block: Remove unneeded variable err for returning 0
Date: Wed, 28 Oct 2015 10:17:31 +0100	[thread overview]
Message-ID: <20151028091731.GK1947@rck.sh> (raw)
In-Reply-To: <CABXAfNL=WkXT8m-hcay9Mii+GePugKf=OQyqUdsdLGKf489=PA@mail.gmail.com>

On Wed, Oct 28, 2015 at 12:41:28AM +0530, punit vara wrote:
> On Mon, Oct 26, 2015 at 12:18 AM, Punit Vara <punitvara@gmail.com> wrote:
> > This patch is to the mg_disk.c file that removes unnecessary err
> > and fixes  following warning reported by coccicheck:
> >
> > Unneeded variable: "err". Return "0" on line 1077
> >
> > Signed-off-by: Punit Vara <punitvara@gmail.com>
> > ---
> >  drivers/block/mg_disk.c | 3 +--
> >  1 file changed, 1 insertion(+), 2 deletions(-)
> >
> > diff --git a/drivers/block/mg_disk.c b/drivers/block/mg_disk.c
> > index 145ce2a..d6f3feb 100644
> > --- a/drivers/block/mg_disk.c
> > +++ b/drivers/block/mg_disk.c
> > @@ -1038,7 +1038,6 @@ static int mg_remove(struct platform_device *plat_dev)
> >  {
> >         struct mg_drv_data *prv_data = plat_dev->dev.platform_data;
> >         struct mg_host *host = prv_data->host;
> > -       int err = 0;
> >
> >         /* delete timer */
> >         del_timer_sync(&host->timer);
> > @@ -1074,7 +1073,7 @@ static int mg_remove(struct platform_device *plat_dev)
> >         /* free mg_host */
> >         kfree(host);
> >
> > -       return err;
> > +       return 0;
> >  }
> >
> >  static struct platform_driver mg_disk_driver = {
> > --
> > 2.5.3
> >
> Anybody going to review this patches please and I dont know who is
> maintainer for all these patches

Hi,

hm, so if it always returns the same value, why not make the function
"void" and change the call sites? The compiler optimizes it anyways,
this does not save anything.

Like the rest of your patch set, it does not really improve anything.
These style/whitespace fixes will happen anyways when someone is
actually working on the _code_...

So thank you for your input, valid points, but as long as there is a
single item on my todo-list, I - again highly personal view - don't care
about whitespace patches.

Regards, rck

  reply	other threads:[~2015-10-28  9:17 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-25 18:48 [PATCH 0/6] Fix coding style issues Punit Vara
2015-10-25 18:48 ` [PATCH 1/6] block: Remove unneeded variable err for returning 0 Punit Vara
2015-10-27 19:11   ` punit vara
2015-10-28  9:17     ` Roland Kammerer [this message]
2015-10-25 18:48 ` [PATCH 2/6] block: drbd: Remove unnedded semicolon Punit Vara
2015-10-25 18:48 ` [PATCH 3/6] block: " Punit Vara
2015-10-25 18:48 ` [PATCH 4/6] block: Coding style fix for comma and open , close parenthesis Punit Vara
2015-10-25 18:48 ` [PATCH 5/6] " Punit Vara
2015-10-25 18:48 ` [PATCH 6/6] " Punit Vara
2015-10-25 18:55   ` punit vara

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=20151028091731.GK1947@rck.sh \
    --to=roland.kammerer@linbit.com \
    --cc=drbd-dev@lists.linbit.com \
    --cc=punitvara@gmail.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.