dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] video/fbdev/sis: fix typos in SiS_GetModeID()
@ 2022-07-18 12:43 Rustam Subkhankulov
  2022-07-26  7:17 ` Helge Deller
  0 siblings, 1 reply; 2+ messages in thread
From: Rustam Subkhankulov @ 2022-07-18 12:43 UTC (permalink / raw)
  To: Thomas Winischhofer
  Cc: ldv-project, linux-fbdev, Rustam Subkhankulov, Helge Deller,
	linux-kernel, dri-devel, Alexey Khoroshilov

The second operand of a '&&' operator has no impact on expression
result for cases 400 and 512 in SiS_GetModeID().

Judging by the logic and the names of the variables, in both cases a
typo was made.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Signed-off-by: Rustam Subkhankulov <subkhankulov@ispras.ru>
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
---
 drivers/video/fbdev/sis/init.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/video/fbdev/sis/init.c b/drivers/video/fbdev/sis/init.c
index b568c646a76c..2ba91d62af92 100644
--- a/drivers/video/fbdev/sis/init.c
+++ b/drivers/video/fbdev/sis/init.c
@@ -355,12 +355,12 @@ SiS_GetModeID(int VGAEngine, unsigned int VBFlags, int HDisplay, int VDisplay,
 		}
 		break;
 	case 400:
-		if((!(VBFlags & CRT1_LCDA)) || ((LCDwidth >= 800) && (LCDwidth >= 600))) {
+		if((!(VBFlags & CRT1_LCDA)) || ((LCDwidth >= 800) && (LCDheight >= 600))) {
 			if(VDisplay == 300) ModeIndex = ModeIndex_400x300[Depth];
 		}
 		break;
 	case 512:
-		if((!(VBFlags & CRT1_LCDA)) || ((LCDwidth >= 1024) && (LCDwidth >= 768))) {
+		if((!(VBFlags & CRT1_LCDA)) || ((LCDwidth >= 1024) && (LCDheight >= 768))) {
 			if(VDisplay == 384) ModeIndex = ModeIndex_512x384[Depth];
 		}
 		break;
-- 
2.25.1


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

* Re: [PATCH] video/fbdev/sis: fix typos in SiS_GetModeID()
  2022-07-18 12:43 [PATCH] video/fbdev/sis: fix typos in SiS_GetModeID() Rustam Subkhankulov
@ 2022-07-26  7:17 ` Helge Deller
  0 siblings, 0 replies; 2+ messages in thread
From: Helge Deller @ 2022-07-26  7:17 UTC (permalink / raw)
  To: Rustam Subkhankulov, Thomas Winischhofer
  Cc: Alexey Khoroshilov, ldv-project, linux-fbdev, linux-kernel, dri-devel

On 7/18/22 14:43, Rustam Subkhankulov wrote:
> The second operand of a '&&' operator has no impact on expression
> result for cases 400 and 512 in SiS_GetModeID().
>
> Judging by the logic and the names of the variables, in both cases a
> typo was made.
>
> Found by Linux Verification Center (linuxtesting.org) with SVACE.
>
> Signed-off-by: Rustam Subkhankulov <subkhankulov@ispras.ru>
> Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")

applied to fbdev git tree.

Thanks!
Helge


> ---
>  drivers/video/fbdev/sis/init.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/video/fbdev/sis/init.c b/drivers/video/fbdev/sis/init.c
> index b568c646a76c..2ba91d62af92 100644
> --- a/drivers/video/fbdev/sis/init.c
> +++ b/drivers/video/fbdev/sis/init.c
> @@ -355,12 +355,12 @@ SiS_GetModeID(int VGAEngine, unsigned int VBFlags, int HDisplay, int VDisplay,
>  		}
>  		break;
>  	case 400:
> -		if((!(VBFlags & CRT1_LCDA)) || ((LCDwidth >= 800) && (LCDwidth >= 600))) {
> +		if((!(VBFlags & CRT1_LCDA)) || ((LCDwidth >= 800) && (LCDheight >= 600))) {
>  			if(VDisplay == 300) ModeIndex = ModeIndex_400x300[Depth];
>  		}
>  		break;
>  	case 512:
> -		if((!(VBFlags & CRT1_LCDA)) || ((LCDwidth >= 1024) && (LCDwidth >= 768))) {
> +		if((!(VBFlags & CRT1_LCDA)) || ((LCDwidth >= 1024) && (LCDheight >= 768))) {
>  			if(VDisplay == 384) ModeIndex = ModeIndex_512x384[Depth];
>  		}
>  		break;


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

end of thread, other threads:[~2022-07-26  7:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-18 12:43 [PATCH] video/fbdev/sis: fix typos in SiS_GetModeID() Rustam Subkhankulov
2022-07-26  7:17 ` Helge Deller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).