From: Greg KH <gregkh@linuxfoundation.org>
To: YueHaibing <yuehaibing@huawei.com>
Cc: eric@anholt.net, wahrenst@gmx.net, inf.braun@fau.de,
nishkadg.linux@gmail.com, devel@driverdev.osuosl.org,
linux-kernel@vger.kernel.org,
bcm-kernel-feedback-list@broadcom.com,
linux-rpi-kernel@lists.infradead.org,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH -next] staging: vc04_services: fix used-but-set-variable warning
Date: Thu, 25 Jul 2019 16:49:13 +0200 [thread overview]
Message-ID: <20190725144913.GC29688@kroah.com> (raw)
In-Reply-To: <20190725142716.49276-1-yuehaibing@huawei.com>
On Thu, Jul 25, 2019 at 10:27:16PM +0800, YueHaibing wrote:
> use variables 'local_entity_uc' and 'local_uc',
> mute gcc used-but-set-variable warning:
>
> drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c: In function vchiq_release_internal:
> drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c:2827:16: warning:
> variable local_entity_uc set but not used [-Wunused-but-set-variable]
> drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c:2827:6: warning:
> variable local_uc set but not used [-Wunused-but-set-variable]
>
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> ---
> drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
> index cc4383d..04e6427 100644
> --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
> +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
> @@ -2861,15 +2861,13 @@ vchiq_release_internal(struct vchiq_state *state, struct vchiq_service *service)
> } else {
> vchiq_log_info(vchiq_susp_log_level,
> "%s %s count %d, state count %d - suspending",
> - __func__, entity, *entity_uc,
> - arm_state->videocore_use_count);
> + __func__, entity, local_entity_uc, local_uc);
> vchiq_arm_vcsuspend(state);
> }
> } else
> vchiq_log_trace(vchiq_susp_log_level,
> "%s %s count %d, state count %d",
> - __func__, entity, *entity_uc,
> - arm_state->videocore_use_count);
> + __func__, entity, local_entity_uc, local_uc);
Are you sure this is the correct way to solve this?
Why not just remove the local variables instead, as obviously they are
not being used.
thanks,
greg k-h
next prev parent reply other threads:[~2019-07-25 14:49 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-25 14:27 [PATCH -next] staging: vc04_services: fix used-but-set-variable warning YueHaibing
2019-07-25 14:49 ` Greg KH [this message]
2019-07-26 9:26 ` [PATCH v2 " YueHaibing
2019-07-26 15:57 ` Stefan Wahren
2019-07-27 1:33 ` Yuehaibing
2019-07-27 1:35 ` [PATCH v3 -next] staging: vc04_services: fix unused-but-set-variable warning YueHaibing
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=20190725144913.GC29688@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=devel@driverdev.osuosl.org \
--cc=eric@anholt.net \
--cc=inf.braun@fau.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rpi-kernel@lists.infradead.org \
--cc=nishkadg.linux@gmail.com \
--cc=wahrenst@gmx.net \
--cc=yuehaibing@huawei.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