summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2024-01-10 16:57:44 -0800
committerAlan Coopersmith <alan.coopersmith@oracle.com>2024-01-10 17:20:07 -0800
commit058fbc23b3b8b0b55663b10f3de8dcafb2d09b72 (patch)
treefdcbaba6eec3794edbac1936cac350f62396d6b9
parentd9db1f64514cfee060af59dbac07e77dafeae95a (diff)
Fix warning: declaration of ‘tmp’ shadows a previous local [-Wshadow]
s3v_driver.c: In function ‘S3VModeInit’: s3v_driver.c:3103:12: warning: declaration of ‘tmp’ shadows a previous local [-Wshadow] 3103 | int tmp = vganew->CRTC[4] + ((i&0x10)<<4) + ps3v->HorizScaleFactor; | ^~~ s3v_driver.c:2577:17: note: shadowed declaration is here 2577 | unsigned char tmp = 0; | ^~~ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r--src/s3v_driver.c39
1 files changed, 20 insertions, 19 deletions
diff --git a/src/s3v_driver.c b/src/s3v_driver.c
index 913f6c5..6f14c76 100644
--- a/src/s3v_driver.c
+++ b/src/s3v_driver.c
@@ -2574,7 +2574,6 @@ S3VModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
S3VPtr ps3v = S3VPTR(pScrn);
int width, dclk;
int i, j;
- unsigned char tmp = 0;
/* Store values to current mode register structs */
S3VRegPtr new = &ps3v->ModeReg;
@@ -2626,24 +2625,26 @@ S3VModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
/* Start with MMIO, linear addr. regs */
VGAOUT8(vgaCRIndex, 0x3a);
- tmp = VGAIN8(vgaCRReg);
- if( S3_ViRGE_GX2_SERIES(ps3v->Chipset)
- /* MXTESTME */ || S3_ViRGE_MX_SERIES(ps3v->Chipset) )
- {
- if(ps3v->pci_burst)
- /*new->CR3A = (tmp & 0x38) | 0x10; / ENH 256, PCI burst */
- /* Don't clear reserved bits... */
- new->CR3A = (tmp & 0x7f) | 0x10; /* ENH 256, PCI burst */
- else
- new->CR3A = tmp | 0x90; /* ENH 256, no PCI burst! */
- }
- else
- {
- if(ps3v->pci_burst)
- new->CR3A = (tmp & 0x7f) | 0x15; /* ENH 256, PCI burst */
- else
- new->CR3A = tmp | 0x95; /* ENH 256, no PCI burst! */
- }
+ {
+ unsigned char tmp = VGAIN8(vgaCRReg);
+ if (S3_ViRGE_GX2_SERIES(ps3v->Chipset)
+ /* MXTESTME */ || S3_ViRGE_MX_SERIES(ps3v->Chipset) )
+ {
+ if (ps3v->pci_burst)
+ /*new->CR3A = (tmp & 0x38) | 0x10; / ENH 256, PCI burst */
+ /* Don't clear reserved bits... */
+ new->CR3A = (tmp & 0x7f) | 0x10; /* ENH 256, PCI burst */
+ else
+ new->CR3A = tmp | 0x90; /* ENH 256, no PCI burst! */
+ }
+ else
+ {
+ if (ps3v->pci_burst)
+ new->CR3A = (tmp & 0x7f) | 0x15; /* ENH 256, PCI burst */
+ else
+ new->CR3A = tmp | 0x95; /* ENH 256, no PCI burst! */
+ }
+ }
VGAOUT8(vgaCRIndex, 0x55);