Skip to contentSkip to conversation

drivers/block/ahci.c: Fix GCC 4.6 build warning

PATCH New Kumar Gala 2 participants 6 messages Nov 9, 2011 – Nov 16, 2011 Block layer

lore
Share & tools
lore

Kumar Gala

author
#0 lore raw

PATCH 1/3 drivers/block/ahci.c: Fix GCC 4.6 build warning

Fix:

ahci.c: In function 'ata_scsiop_read10':
ahci.c:564:6: warning: variable 'lba' set but not used [-Wunused-but-set-variable]

---
 drivers/block/ahci.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)
drivers/block/ahci.c +0 -3
index 015b341..7b2ec50 100644
@@ -561,12 +561,9 @@ static int ata_scsiop_inquiry(ccb *pccb)
  */
 static int ata_scsiop_read10(ccb * pccb)
 {
-	u64 lba = 0;
 	u32 len = 0;
 	u8 fis[20];
 
-	lba = (((u64) pccb->cmd[2]) << 24) | (((u64) pccb->cmd[3]) << 16)
-	    | (((u64) pccb->cmd[4]) << 8) | ((u64) pccb->cmd[5]);
 	len = (((u32) pccb->cmd[7]) << 8) | ((u32) pccb->cmd[8]);
 
 	/* For 10-byte and 16-byte SCSI R/W commands, transfer
Signature · 1 line
1.7.3.4
author
#1 lore raw

PATCH 2/3 drivers/bios_emulator/x86emu/ops.c: Fix GCC 4.6 build warning

Fix:

x86emu/ops.c: In function 'x86emuOp_int3':
x86emu/ops.c:3521:9: warning: variable 'tmp' set but not used [-Wunused-but-set-variable] x86emu/ops.c: In function 'x86emuOp_int_IMM':
x86emu/ops.c:3549:9: warning: variable 'tmp' set but not used [-Wunused-but-set-variable] x86emu/ops.c: In function 'x86emuOp_into':
x86emu/ops.c:3579:9: warning: variable 'tmp' set but not used [-Wunused-but-set-variable] x86emu/ops.c: In function 'x86emuOp_aad':
x86emu/ops.c:3993:8: warning: variable 'a' set but not used [-Wunused-but-set-variable]

---
 drivers/bios_emulator/x86emu/ops.c |   15 ++++-----------
 1 files changed, 4 insertions(+), 11 deletions(-)
drivers/bios_emulator/x86emu/ops.c +4 -11
index c836a20..f8e093d 100644
@@ -3518,11 +3518,9 @@ Handles opcode 0xcc
 ****************************************************************************/
 void x86emuOp_int3(u8 X86EMU_UNUSED(op1))
 {
-    u16 tmp;
-
     START_OF_INSTR();
     DECODE_PRINTF("INT 3\n");
-    tmp = (u16) mem_access_word(3 * 4 + 2);
+    (void)mem_access_word(3 * 4 + 2);
     /* access the segment register */
     TRACE_AND_STEP();
 	if (_X86EMU_intrTab[3]) {
@@ -3546,14 +3544,13 @@ Handles opcode 0xcd
 ****************************************************************************/
 void x86emuOp_int_IMM(u8 X86EMU_UNUSED(op1))
 {
-    u16 tmp;
     u8 intnum;
 
     START_OF_INSTR();
     DECODE_PRINTF("INT\t");
     intnum = fetch_byte_imm();
     DECODE_PRINTF2("%x\n", intnum);
-    tmp = mem_access_word(intnum * 4 + 2);
+    (void)mem_access_word(intnum * 4 + 2);
     TRACE_AND_STEP();
 	if (_X86EMU_intrTab[intnum]) {
 		(*_X86EMU_intrTab[intnum])(intnum);
@@ -3576,13 +3573,11 @@ Handles opcode 0xce
 ****************************************************************************/
 void x86emuOp_into(u8 X86EMU_UNUSED(op1))
 {
-    u16 tmp;
-
     START_OF_INSTR();
     DECODE_PRINTF("INTO\n");
     TRACE_AND_STEP();
     if (ACCESS_FLAG(F_OF)) {
-	tmp = mem_access_word(4 * 4 + 2);
+	(void)mem_access_word(4 * 4 + 2);
 		if (_X86EMU_intrTab[4]) {
 			(*_X86EMU_intrTab[4])(4);
 	} else {
@@ -3990,11 +3985,9 @@ Handles opcode 0xd5
 ****************************************************************************/
 void x86emuOp_aad(u8 X86EMU_UNUSED(op1))
 {
-    u8 a;
-
     START_OF_INSTR();
     DECODE_PRINTF("AAD\n");
-    a = fetch_byte_imm();
+    (void)fetch_byte_imm();
     TRACE_AND_STEP();
     M.x86.R_AX = aad_word(M.x86.R_AX);
     DECODE_CLEAR_SEGOVR();
Signature · 1 line
1.7.3.4
author
#2 lore raw

PATCH 3/3 drivers/block/sata_sil3114.c: Fix GCC 4.6 build warning

Fix:

sata_sil3114.c: In function 'scan_sata':
sata_sil3114.c:793:7: warning: array subscript is above array bounds [-Warray-bounds] sata_sil3114.c:794:7: warning: array subscript is above array bounds [-Warray-bounds] sata_sil3114.c:795:39: warning: array subscript is above array bounds [-Warray-bounds] sata_sil3114.c:795:7: warning: array subscript is above array bounds [-Warray-bounds] sata_sil3114.c:797:7: warning: array subscript is above array bounds [-Warray-bounds] sata_sil3114.c:800:7: warning: array subscript is above array bounds [-Warray-bounds] sata_sil3114.c:801:7: warning: array subscript is above array bounds [-Warray-bounds] sata_sil3114.c:802:39: warning: array subscript is above array bounds [-Warray-bounds] sata_sil3114.c:802:7: warning: array subscript is above array bounds [-Warray-bounds] sata_sil3114.c:804:7: warning: array subscript is above array bounds [-Warray-bounds]

---
 drivers/block/sata_sil3114.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
drivers/block/sata_sil3114.c +4 -0
index 1e60636..34fe038 100644
@@ -782,6 +782,7 @@ int scan_sata (int dev)
 		    (iobase[5] + VND_TF2_CH0) | ATA_PCI_CTL_OFS;
 		port[0].ioaddr.bmdma_addr = iobase[5] + VND_BMDMA_CH0;
 		break;
+#if (CONFIG_SYS_SATA_MAX_DEVICE >= 1)
 	case 1:
 		port[1].port_no = 0;
 		port[1].ioaddr.cmd_addr = iobase[5] + VND_TF0_CH1;
@@ -789,6 +790,7 @@ int scan_sata (int dev)
 		    (iobase[5] + VND_TF2_CH1) | ATA_PCI_CTL_OFS;
 		port[1].ioaddr.bmdma_addr = iobase[5] + VND_BMDMA_CH1;
 		break;
+#elif (CONFIG_SYS_SATA_MAX_DEVICE >= 2)
 	case 2:
 		port[2].port_no = 0;
 		port[2].ioaddr.cmd_addr = iobase[5] + VND_TF0_CH2;
@@ -796,6 +798,7 @@ int scan_sata (int dev)
 		    (iobase[5] + VND_TF2_CH2) | ATA_PCI_CTL_OFS;
 		port[2].ioaddr.bmdma_addr = iobase[5] + VND_BMDMA_CH2;
 		break;
+#elif (CONFIG_SYS_SATA_MAX_DEVICE >= 3)
 	case 3:
 		port[3].port_no = 0;
 		port[3].ioaddr.cmd_addr = iobase[5] + VND_TF0_CH3;
@@ -803,6 +806,7 @@ int scan_sata (int dev)
 		    (iobase[5] + VND_TF2_CH3) | ATA_PCI_CTL_OFS;
 		port[3].ioaddr.bmdma_addr = iobase[5] + VND_BMDMA_CH3;
 		break;
+#endif
 	default:
 		printf ("Tried to scan unknown port: ata%d\n", dev);
 		return 1;
Signature · 1 line
1.7.3.4
#3 lore raw

PATCH 3/3 drivers/block/sata_sil3114.c: Fix GCC 4.6 build warning

Dear Kumar Gala,

Quoted 14 lines · In message <[email protected]> you…

Fix:

sata_sil3114.c: In function 'scan_sata':
sata_sil3114.c:793:7: warning: array subscript is above array bounds [-Warray-bounds] sata_sil3114.c:794:7: warning: array subscript is above array bounds [-Warray-bounds] sata_sil3114.c:795:39: warning: array subscript is above array bounds [-Warray-bounds] sata_sil3114.c:795:7: warning: array subscript is above array bounds [-Warray-bounds] sata_sil3114.c:797:7: warning: array subscript is above array bounds [-Warray-bounds] sata_sil3114.c:800:7: warning: array subscript is above array bounds [-Warray-bounds] sata_sil3114.c:801:7: warning: array subscript is above array bounds [-Warray-bounds] sata_sil3114.c:802:39: warning: array subscript is above array bounds [-Warray-bounds] sata_sil3114.c:802:7: warning: array subscript is above array bounds [-Warray-bounds] sata_sil3114.c:804:7: warning: array subscript is above array bounds [-Warray-bounds]

Quoted 4 lines
---
 drivers/block/sata_sil3114.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Don't tell me how hard you work.  Tell me how much you get done.
                                                     -- James J. Ling
#4 lore raw

PATCH 2/3 drivers/bios_emulator/x86emu/ops.c: Fix GCC 4.6 build warning

In reply to Kumar Gala

Dear Kumar Gala,

Quoted 11 lines · In message <[email protected]> you…

Fix:

x86emu/ops.c: In function 'x86emuOp_int3':
x86emu/ops.c:3521:9: warning: variable 'tmp' set but not used [-Wunused-but-set-variable] x86emu/ops.c: In function 'x86emuOp_int_IMM':
x86emu/ops.c:3549:9: warning: variable 'tmp' set but not used [-Wunused-but-set-variable] x86emu/ops.c: In function 'x86emuOp_into':
x86emu/ops.c:3579:9: warning: variable 'tmp' set but not used [-Wunused-but-set-variable] x86emu/ops.c: In function 'x86emuOp_aad':
x86emu/ops.c:3993:8: warning: variable 'a' set but not used [-Wunused-but-set-variable]

Quoted 4 lines
---
 drivers/bios_emulator/x86emu/ops.c |   15 ++++-----------
 1 files changed, 4 insertions(+), 11 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

Signature · 4 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
I have a very small mind and must live with it.    -- Edsger Dijkstra
#5 lore raw

PATCH 1/3 drivers/block/ahci.c: Fix GCC 4.6 build warning

In reply to Kumar Gala

Dear Kumar Gala,

Quoted 9 lines · In message <[email protected]> you…

Fix:

ahci.c: In function 'ata_scsiop_read10':
ahci.c:564:6: warning: variable 'lba' set but not used [-Wunused-but-set-variable]

---
 drivers/block/ahci.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

Signature · 6 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Teenagers are people who express a burning desire to be different by
dressing exactly alike.
There are some strings. They're just not attached.