From: Johan Hovold <johan@kernel.org>
To: Viresh Kumar <viresh.kumar@linaro.org>
Cc: Nathan Chancellor <natechancellor@gmail.com>,
greybus-dev@lists.linaro.org, devel@driverdev.osuosl.org,
Alex Elder <elder@kernel.org>, Johan Hovold <johan@kernel.org>,
linux-kernel@vger.kernel.org
Subject: Re: [greybus-dev] [PATCH] staging: greybus: Remove unused local variable
Date: Mon, 7 May 2018 09:20:11 +0200 [thread overview]
Message-ID: <20180507072011.GL2285@localhost> (raw)
In-Reply-To: <20180507050546.qiuigbsohhallell@vireshk-i7>
On Mon, May 07, 2018 at 10:35:46AM +0530, Viresh Kumar wrote:
> On 05-05-18, 23:50, Nathan Chancellor wrote:
> > Fixes the following W=1 warning: variable ‘intf_id’ set but
> > not used [-Wunused-but-set-variable]
> >
> > Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
> > ---
> > drivers/staging/greybus/svc.c | 3 ---
> > 1 file changed, 3 deletions(-)
> >
> > diff --git a/drivers/staging/greybus/svc.c b/drivers/staging/greybus/svc.c
> > index a874fed761a1..a2bb7e1a3db3 100644
> > --- a/drivers/staging/greybus/svc.c
> > +++ b/drivers/staging/greybus/svc.c
> > @@ -1137,7 +1137,6 @@ static int gb_svc_intf_reset_recv(struct gb_operation *op)
> > struct gb_svc *svc = gb_connection_get_data(op->connection);
> > struct gb_message *request = op->request;
> > struct gb_svc_intf_reset_request *reset;
> > - u8 intf_id;
> >
> > if (request->payload_size < sizeof(*reset)) {
> > dev_warn(&svc->dev, "short reset request received (%zu < %zu)\n",
> > @@ -1146,8 +1145,6 @@ static int gb_svc_intf_reset_recv(struct gb_operation *op)
> > }
> > reset = request->payload;
> >
> > - intf_id = reset->intf_id;
> > -
> > /* FIXME Reset the interface here */
> >
> > return 0;
>
> Don't you get a new error after removing this, i.e "reset set but unused" ? Or
> the sizeof() operation on that suppresses those warnings ..
That was my initial reaction as well, but I failed to notice the sizeof
which prevents the new warning.
> Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Acked-by: Johan Hovold <johan@kernel.org>
Thanks,
Johan
prev parent reply other threads:[~2018-05-07 7:20 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-06 6:50 [PATCH] staging: greybus: Remove unused local variable Nathan Chancellor
2018-05-07 5:05 ` [greybus-dev] " Viresh Kumar
2018-05-07 7:20 ` Johan Hovold [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=20180507072011.GL2285@localhost \
--to=johan@kernel.org \
--cc=devel@driverdev.osuosl.org \
--cc=elder@kernel.org \
--cc=greybus-dev@lists.linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=natechancellor@gmail.com \
--cc=viresh.kumar@linaro.org \
/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.