Commit 314d56d0 authored by Alan Coopersmith's avatar Alan Coopersmith 🛫

Make SiSRegInit & SiSSetLVDSetc args match in both headers that define them

Adds include of "sis_dac.h" to init.c to force compilers to compare the
definitions, making it obvious that sis_dac.h defined an extra argument
to SiSSetLVDSetc that the function itself didn't have, and that SiSRegInit
expected an unsigned long (in the form of SISIOADDRESS), not the unsigned
short that sis_dac.h claimed to pass it.

Found by the Parfait 1.0 bug checking tool:

Error: Function Call Mismatch
   Function call with extra args: Forward declaration of function 'SiSSetLVDSetc' does not match its definition
      Function expects 1 argument (SiS_Private*); given 2 (SiS_Private*, unsigned short)
        at line 604 of driver/xf86-video-sis/src/sis_dac.c in function 'SiS300Restore'.
          Function defined at line 1153 of driver/xf86-video-sis/src/init.c.
[repeated for each call]
Signed-off-by: Alan Coopersmith's avatarAlan Coopersmith <alan.coopersmith@oracle.com>
parent aa79b0f5
......@@ -59,6 +59,7 @@
#endif
#include "init.h"
#include "sis_dac.h"
#ifdef SIS300
#include "300vtbl.h"
......
......@@ -601,7 +601,7 @@ SiS300Restore(ScrnInfoPtr pScrn, SISRegPtr sisReg)
if(!(pSiS->UseVESA)) {
if(pSiS->VBFlags2 & VB2_LVDS) {
SiSRegInit(pSiS->SiS_Pr, pSiS->RelIO + 0x30);
SiSSetLVDSetc(pSiS->SiS_Pr, 0);
SiSSetLVDSetc(pSiS->SiS_Pr);
SiS_GetVBType(pSiS->SiS_Pr);
SiS_UnLockCRT2(pSiS->SiS_Pr);
SiS_DisableBridge(pSiS->SiS_Pr);
......@@ -990,7 +990,7 @@ SiS301Restore(ScrnInfoPtr pScrn, SISRegPtr sisReg)
Part4max = 0x1b;
SiSRegInit(pSiS->SiS_Pr, pSiS->RelIO + 0x30);
SiSSetLVDSetc(pSiS->SiS_Pr, 0);
SiSSetLVDSetc(pSiS->SiS_Pr);
SiS_GetVBType(pSiS->SiS_Pr);
SiS_DisableBridge(pSiS->SiS_Pr);
SiS_UnLockCRT2(pSiS->SiS_Pr);
......@@ -1084,7 +1084,7 @@ SiS301BRestore(ScrnInfoPtr pScrn, SISRegPtr sisReg)
} /* TODO for 307 */
SiSRegInit(pSiS->SiS_Pr, pSiS->RelIO + 0x30);
SiSSetLVDSetc(pSiS->SiS_Pr, 0);
SiSSetLVDSetc(pSiS->SiS_Pr);
SiS_GetVBType(pSiS->SiS_Pr);
SiS_DisableBridge(pSiS->SiS_Pr);
SiS_UnLockCRT2(pSiS->SiS_Pr);
......@@ -1193,7 +1193,7 @@ SiSLVDSChrontelRestore(ScrnInfoPtr pScrn, SISRegPtr sisReg)
int i;
SiSRegInit(pSiS->SiS_Pr, pSiS->RelIO + 0x30);
SiSSetLVDSetc(pSiS->SiS_Pr, 0);
SiSSetLVDSetc(pSiS->SiS_Pr);
SiS_GetVBType(pSiS->SiS_Pr);
SiS_DisableBridge(pSiS->SiS_Pr);
if(pSiS->ChipType == SIS_730) {
......
......@@ -72,7 +72,7 @@ extern void SiS_DisplayOn(struct SiS_Private *SiS_Pr);
extern unsigned char SiS_GetSetModeID(ScrnInfoPtr pScrn, unsigned char id);
extern void SiS_SetEnableDstn(struct SiS_Private *SiS_Pr, int enable);
extern void SiS_SetEnableFstn(struct SiS_Private *SiS_Pr, int enable);
extern void SiSRegInit(struct SiS_Private *SiS_Pr, unsigned short BaseAddr);
extern void SiSSetLVDSetc(struct SiS_Private *SiS_Pr, unsigned short ModeNo);
extern void SiSRegInit(struct SiS_Private *SiS_Pr, SISIOADDRESS BaseAddr);
extern void SiSSetLVDSetc(struct SiS_Private *SiS_Pr);
extern void SiS_GetVBType(struct SiS_Private *SiS_Pr);
/* End of init.c/init301.c imports */
......@@ -7413,7 +7413,7 @@ SISSave(ScrnInfoPtr pScrn)
#ifdef SIS_PC_PLATFORM
if(pSiS->VGAMemBase) {
SiSRegInit(pSiS->SiS_Pr, pSiS->RelIO+0x30);
SiSSetLVDSetc(pSiS->SiS_Pr, 0);
SiSSetLVDSetc(pSiS->SiS_Pr);
SiS_GetVBType(pSiS->SiS_Pr);
SiS_DisableBridge(pSiS->SiS_Pr);
SiSVGASave(pScrn, sisReg, SISVGA_SR_FONTS);
......@@ -8089,7 +8089,7 @@ SISRestore(ScrnInfoPtr pScrn)
if(flags & SISVGA_SR_FONTS) {
SiSRegInit(pSiS->SiS_Pr, pSiS->RelIO+0x30);
SiSSetLVDSetc(pSiS->SiS_Pr, 0);
SiSSetLVDSetc(pSiS->SiS_Pr);
SiS_GetVBType(pSiS->SiS_Pr);
SiS_DisableBridge(pSiS->SiS_Pr);
SiSVGAProtect(pScrn, TRUE);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment