# \[PATCH\] video: fbdev: remove set but not used 'ulBestVCO'

- Subsystems: FRAMEBUFFER LAYER, THE REST
- Maintainers: Helge Deller, Linus Torvalds
- Status: LANDED (1c46f4e44af9 · 2020-09-08 11:33)
- Landed in mainline as 1c46f4e44af9 on 2020-09-08.
- List: linux-fbdev
- 2 messages, 2 authors
- Page: https://ratatoskr.run/linux-fbdev/2020/08/6085150/t

## \[PATCH\] video: fbdev: remove set but not used 'ulBestVCO'

- From: Jason Yan \<yanaijie@huawei.com\>
- Date: 2020-08-27 14:53:21 
- Message: https://ratatoskr.run/linux-fbdev/2020/08/6085150.md

```text
This addresses the following gcc warning with "make W=1":

drivers/video/fbdev/kyro/STG4000InitDevice.c: In function
‘ProgramClock’:
drivers/video/fbdev/kyro/STG4000InitDevice.c:123:6: warning: variable
‘ulBestVCO’ set but not used [-Wunused-but-set-variable]
  123 |  u32 ulBestVCO = 0, ulBestClk = 0, ulBestScore = 0;
      |      ^~~~~~~~~

Reported-by: Hulk Robot <redacted>
Signed-off-by: Jason Yan <yanaijie@huawei.com>
---
 drivers/video/fbdev/kyro/STG4000InitDevice.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/video/fbdev/kyro/STG4000InitDevice.c b/drivers/video/fbdev/kyro/STG4000InitDevice.c
index edaeec2d9590..21875d3c2dc2 100644
--- a/drivers/video/fbdev/kyro/STG4000InitDevice.c
+++ b/drivers/video/fbdev/kyro/STG4000InitDevice.c
@@ -120,7 +120,7 @@ u32 ProgramClock(u32 refClock,
 {
 	u32 R = 0, F = 0, OD = 0, ODIndex = 0;
 	u32 ulBestR = 0, ulBestF = 0, ulBestOD = 0;
-	u32 ulBestVCO = 0, ulBestClk = 0, ulBestScore = 0;
+	u32 ulBestClk = 0, ulBestScore = 0;
 	u32 ulScore, ulPhaseScore, ulVcoScore;
 	u32 ulTmp = 0, ulVCO;
 	u32 ulScaleClockReq, ulMinClock, ulMaxClock;
@@ -189,7 +189,6 @@ u32 ProgramClock(u32 refClock,
 						ulScore = ulPhaseScore + ulVcoScore;
 
 						if (!ulBestScore) {
-							ulBestVCO = ulVCO;
 							ulBestOD = OD;
 							ulBestF = F;
 							ulBestR = R;
@@ -206,7 +205,6 @@ u32 ProgramClock(u32 refClock,
                           but we shall keep this code in case new restrictions come into play
                           --------------------------------------------------------------------------*/
 						if ((ulScore >= ulBestScore) && (OD > 0)) {
-							ulBestVCO = ulVCO;
 							ulBestOD = OD;
 							ulBestF = F;
 							ulBestR = R;
-- 
2.25.4
```

## Re: \[PATCH\] video: fbdev: remove set but not used 'ulBestVCO'

- From: Bartlomiej Zolnierkiewicz \<hidden\>
- Date: 2020-09-08 12:39:27 
- Message: https://ratatoskr.run/linux-fbdev/2020/09/6097404.md

```text

On 8/27/20 3:00 PM, Jason Yan wrote:
> This addresses the following gcc warning with "make W=1":
> 
> drivers/video/fbdev/kyro/STG4000InitDevice.c: In function
> ‘ProgramClock’:
> drivers/video/fbdev/kyro/STG4000InitDevice.c:123:6: warning: variable
> ‘ulBestVCO’ set but not used [-Wunused-but-set-variable]
>   123 |  u32 ulBestVCO = 0, ulBestClk = 0, ulBestScore = 0;
>       |      ^~~~~~~~~
> 
> Reported-by: Hulk Robot <redacted>
> Signed-off-by: Jason Yan <yanaijie@huawei.com>

Applied to drm-misc-next tree, thanks.

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics

> ---
>  drivers/video/fbdev/kyro/STG4000InitDevice.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/video/fbdev/kyro/STG4000InitDevice.c b/drivers/video/fbdev/kyro/STG4000InitDevice.c
> index edaeec2d9590..21875d3c2dc2 100644
> --- a/drivers/video/fbdev/kyro/STG4000InitDevice.c
> +++ b/drivers/video/fbdev/kyro/STG4000InitDevice.c
> @@ -120,7 +120,7 @@ u32 ProgramClock(u32 refClock,
>  {
>  	u32 R = 0, F = 0, OD = 0, ODIndex = 0;
>  	u32 ulBestR = 0, ulBestF = 0, ulBestOD = 0;
> -	u32 ulBestVCO = 0, ulBestClk = 0, ulBestScore = 0;
> +	u32 ulBestClk = 0, ulBestScore = 0;
>  	u32 ulScore, ulPhaseScore, ulVcoScore;
>  	u32 ulTmp = 0, ulVCO;
>  	u32 ulScaleClockReq, ulMinClock, ulMaxClock;
> @@ -189,7 +189,6 @@ u32 ProgramClock(u32 refClock,
>  						ulScore = ulPhaseScore + ulVcoScore;
>  
>  						if (!ulBestScore) {
> -							ulBestVCO = ulVCO;
>  							ulBestOD = OD;
>  							ulBestF = F;
>  							ulBestR = R;
> @@ -206,7 +205,6 @@ u32 ProgramClock(u32 refClock,
>                            but we shall keep this code in case new restrictions come into play
>                            --------------------------------------------------------------------------*/
>  						if ((ulScore >= ulBestScore) && (OD > 0)) {
> -							ulBestVCO = ulVCO;
>  							ulBestOD = OD;
>  							ulBestF = F;
>  							ulBestR = R;
> 
```
