drm/mgag200: Initialize delta variable in PLL compute function
Subsystems (3)
Thomas Zimmermann
maintainerPATCH 1/1 drm/mgag200: Initialize delta variable in PLL compute function
Initialize delta variable in PLL compute function for G200SE, rev 00 to the maximum value. Fixes uninitialized usage.
smatch warnings:
drivers/gpu/drm/mgag200/mgag200_pll.c:142 mgag200_pixpll_compute_g200se_00() \
error: uninitialized symbol 'delta'.
--- drivers/gpu/drm/mgag200/mgag200_pll.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/mgag200/mgag200_pll.c +1 -0
@@ -124,6 +124,7 @@ static int mgag200_pixpll_compute_g200se_00(struct mgag200_pll *pixpll, long clounsigned int computed; m = n = p = s =0 ; + delta =0xffffffff ; permitteddelta = clock *5 /1000 ;for (testp =8 ; testp >0 ; testp /=2 ) {
--
2.32.0
Quoted 8 lines · Thomas Zimmermann
Initialize delta variable in PLL compute function for G200SE, rev 00 to the maximum value. Fixes uninitialized usage.
smatch warnings:
drivers/gpu/drm/mgag200/mgag200_pll.c:142mgag200_pixpll_compute_g200se_00()\
error: uninitialized symbol 'delta'.
Quoted 8 lines
Signed-off-by Thomas Zimmermann <[email protected]>Fixes 2545ac960364 ("drm/mgag200: Abstract pixel PLL via struct mgag200_pll")Reported-by kernel test robot <[email protected]>Reported-by Dan Carpenter <[email protected]>Cc Thomas Zimmermann <[email protected]>Cc Sam Ravnborg <[email protected]>Cc Dave Airlie <[email protected]>
I checked a bit your integer types, and there's a fair bit of inconsistency for what you're using for clock. unsigned int, long, int can all be found somewhere. But that's different story. -Daniel
Quoted 19 lines
--- drivers/gpu/drm/mgag200/mgag200_pll.c | 1 + 1 file changed, 1 insertion(+)drivers/gpu/drm/mgag200/mgag200_pll.c +1
-1@@ -124,6 +124,7 @@ static int mgag200_pixpll_compute_g200se_00(struct mgag200_pll *pixpll, long clounsigned int computed; m = n = p = s =0 ; + delta =0xffffffff ; permitteddelta = clock *5 /1000 ;for (testp =8 ; testp >0 ; testp /=2 ) { --2.32.0
Signature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch
Thomas Zimmermann
maintainerHi
Am 17.08.21 um 21:50 schrieb Daniel Vetter:
Quoted 18 lines · Thomas Zimmermann
Quoted 8 lines
Initialize delta variable in PLL compute function for G200SE, rev 00 to the maximum value. Fixes uninitialized usage.
smatch warnings:
drivers/gpu/drm/mgag200/mgag200_pll.c:142mgag200_pixpll_compute_g200se_00()\
error: uninitialized symbol 'delta'.Quoted 8 lines
Signed-off-by Thomas Zimmermann <[email protected]>Fixes 2545ac960364 ("drm/mgag200: Abstract pixel PLL via struct mgag200_pll")Reported-by kernel test robot <[email protected]>Reported-by Dan Carpenter <[email protected]>Cc Thomas Zimmermann <[email protected]>Cc Sam Ravnborg <[email protected]>Cc Dave Airlie <[email protected]>
Quoted 5 lines
Reviewed-by Daniel Vetter <[email protected]>I checked a bit your integer types, and there's a fair bit of inconsistency for what you're using for clock. unsigned int, long, int can all be found somewhere. But that's different story.
Better not look at the PLL code if you value your eyesight. I untangled the computation of the values from the register setup, but I don't dare to change the algorithms.
In principle, most devices should be able to share a single algorithm for computing the values and writing them out. But somehow they all differ. Maybe some minimal cleanup can be done. Without actual HW for testing, I'd rather not touch the logic.
Best regards
Thomas
Quoted 23 lines
-Daniel
Quoted 19 lines
--- drivers/gpu/drm/mgag200/mgag200_pll.c | 1 + 1 file changed, 1 insertion(+)drivers/gpu/drm/mgag200/mgag200_pll.c +1
-1@@ -124,6 +124,7 @@ static int mgag200_pixpll_compute_g200se_00(struct mgag200_pll *pixpll, long clounsigned int computed; m = n = p = s =0 ; + delta =0xffffffff ; permitteddelta = clock *5 /1000 ;for (testp =8 ; testp >0 ; testp /=2 ) { --2.32.0
Signature · 6 lines
Thomas Zimmermann Graphics Driver Developer SUSE Software Solutions Germany GmbH Maxfeldstr. 5, 90409 Nürnberg, Germany (HRB 36809, AG Nürnberg) Geschäftsführer: Felix Imendörffer