All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yuehaibing <yuehaibing@huawei.com>
To: Greg KH <gregkh@linuxfoundation.org>
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
Subject: Re: [PATCH -next] staging: vc04_services: fix used-but-set-variable warning
Date: Fri, 26 Jul 2019 16:51:28 +0800	[thread overview]
Message-ID: <afc8b261-3832-2c4f-a3e0-d1b4f98ffb61@huawei.com> (raw)
In-Reply-To: <20190725144913.GC29688@kroah.com>


On 2019/7/25 22:49, Greg KH wrote:
> 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.

It seems they are equivalent

2852         local_uc = --arm_state->videocore_use_count;
2853         local_entity_uc = --(*entity_uc);

However, I will resend as your suggestion. Thanks!

> 
> thanks,
> 
> greg k-h
> 
> .
> 


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2019-07-26  8:51 UTC|newest]

Thread overview: 15+ 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:27 ` YueHaibing
2019-07-25 14:49 ` Greg KH
2019-07-25 14:49 ` Greg KH
2019-07-25 14:49   ` Greg KH
2019-07-26  8:51   ` Yuehaibing [this message]
2019-07-26  9:26 ` [PATCH v2 " YueHaibing
2019-07-26  9:26   ` YueHaibing
2019-07-26 15:57   ` Stefan Wahren
2019-07-26 15:57     ` Stefan Wahren
2019-07-27  1:33     ` Yuehaibing
2019-07-27  1:33       ` Yuehaibing
2019-07-27  1:35 ` [PATCH v3 -next] staging: vc04_services: fix unused-but-set-variable warning YueHaibing
2019-07-27  1:35   ` YueHaibing
  -- strict thread matches above, loose matches on Subject: below --
2019-07-25 14:27 [PATCH -next] staging: vc04_services: fix used-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=afc8b261-3832-2c4f-a3e0-d1b4f98ffb61@huawei.com \
    --to=yuehaibing@huawei.com \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=eric@anholt.net \
    --cc=gregkh@linuxfoundation.org \
    --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 \
    /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.