All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next] staging: vc04_services: fix used-but-set-variable warning
@ 2019-07-25 14:27 YueHaibing
  0 siblings, 0 replies; 7+ messages in thread
From: YueHaibing @ 2019-07-25 14:27 UTC (permalink / raw)
  To: eric, wahrenst, gregkh, inf.braun, nishkadg.linux
  Cc: devel, YueHaibing, linux-kernel, bcm-kernel-feedback-list,
	linux-rpi-kernel, linux-arm-kernel

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);
 
 unlock:
 	write_unlock_bh(&arm_state->susp_res_lock);
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH -next] staging: vc04_services: fix used-but-set-variable warning
  2019-07-25 14:49   ` Greg KH
  (?)
@ 2019-07-26  8:51   ` Yuehaibing
  -1 siblings, 0 replies; 7+ messages in thread
From: Yuehaibing @ 2019-07-26  8:51 UTC (permalink / raw)
  To: Greg KH
  Cc: devel, linux-kernel, eric, bcm-kernel-feedback-list, wahrenst,
	nishkadg.linux, inf.braun, linux-arm-kernel, linux-rpi-kernel


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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH -next] staging: vc04_services: fix used-but-set-variable warning
  2019-07-25 14:27 ` YueHaibing
@ 2019-07-25 14:49   ` Greg KH
  -1 siblings, 0 replies; 7+ messages in thread
From: Greg KH @ 2019-07-25 14:49 UTC (permalink / raw)
  To: YueHaibing
  Cc: eric, wahrenst, inf.braun, nishkadg.linux, devel, linux-kernel,
	bcm-kernel-feedback-list, linux-rpi-kernel, linux-arm-kernel

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH -next] staging: vc04_services: fix used-but-set-variable warning
  2019-07-25 14:27 ` YueHaibing
  (?)
@ 2019-07-25 14:49 ` Greg KH
  -1 siblings, 0 replies; 7+ messages in thread
From: Greg KH @ 2019-07-25 14:49 UTC (permalink / raw)
  To: YueHaibing
  Cc: devel, linux-kernel, eric, bcm-kernel-feedback-list, wahrenst,
	nishkadg.linux, inf.braun, linux-arm-kernel, linux-rpi-kernel

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH -next] staging: vc04_services: fix used-but-set-variable warning
@ 2019-07-25 14:49   ` Greg KH
  0 siblings, 0 replies; 7+ messages in thread
From: Greg KH @ 2019-07-25 14:49 UTC (permalink / raw)
  To: YueHaibing
  Cc: devel, linux-kernel, eric, bcm-kernel-feedback-list, wahrenst,
	nishkadg.linux, inf.braun, linux-arm-kernel, linux-rpi-kernel

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

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH -next] staging: vc04_services: fix used-but-set-variable warning
@ 2019-07-25 14:27 ` YueHaibing
  0 siblings, 0 replies; 7+ messages in thread
From: YueHaibing @ 2019-07-25 14:27 UTC (permalink / raw)
  To: eric, wahrenst, gregkh, inf.braun, nishkadg.linux
  Cc: linux-kernel, devel, linux-rpi-kernel, linux-arm-kernel,
	bcm-kernel-feedback-list, YueHaibing

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);
 
 unlock:
 	write_unlock_bh(&arm_state->susp_res_lock);
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH -next] staging: vc04_services: fix used-but-set-variable warning
@ 2019-07-25 14:27 ` YueHaibing
  0 siblings, 0 replies; 7+ messages in thread
From: YueHaibing @ 2019-07-25 14:27 UTC (permalink / raw)
  To: eric, wahrenst, gregkh, inf.braun, nishkadg.linux
  Cc: devel, YueHaibing, linux-kernel, bcm-kernel-feedback-list,
	linux-rpi-kernel, linux-arm-kernel

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);
 
 unlock:
 	write_unlock_bh(&arm_state->susp_res_lock);
-- 
2.7.4



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

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-07-26  8:51 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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: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 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.