From mboxrd@z Thu Jan 1 00:00:00 1970 From: Greg KH Subject: Re: [PATCH -next] staging: vc04_services: fix used-but-set-variable warning Date: Thu, 25 Jul 2019 16:49:13 +0200 Message-ID: <20190725144913.GC29688__12663.1970678986$1564066174$gmane$org@kroah.com> References: <20190725142716.49276-1-yuehaibing@huawei.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <20190725142716.49276-1-yuehaibing@huawei.com> List-Id: Linux Driver Project Developer List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: driverdev-devel-bounces@linuxdriverproject.org To: YueHaibing Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, eric@anholt.net, bcm-kernel-feedback-list@broadcom.com, wahrenst@gmx.net, nishkadg.linux@gmail.com, inf.braun@fau.de, linux-arm-kernel@lists.infradead.org, linux-rpi-kernel@lists.infradead.org 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 > Signed-off-by: YueHaibing > --- > 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