ide: change identify_data type to uint8_t
authorJuan Quintela <quintela@redhat.com>
Wed, 7 Oct 2009 15:58:34 +0000 (17:58 +0200)
committerAnthony Liguori <aliguori@us.ibm.com>
Tue, 27 Oct 2009 17:28:44 +0000 (12:28 -0500)
It is used everywhere as uint8_t except in one place.  Cast to uint16_t
in that place
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
hw/ide/core.c
hw/ide/internal.h

index e1433b2b2ee9d01c521a4e183ad7e2af58fcc754..aeff0344a96e840987493c8281672968ad7a1fc0 100644 (file)
@@ -1942,28 +1942,29 @@ void ide_ioport_write(void *opaque, uint32_t addr, uint32_t val)
                 break;
             case 0x03: { /* set transfer mode */
                uint8_t val = s->nsector & 0x07;
+                uint16_t *identify_data = (uint16_t *)s->identify_data;
 
                switch (s->nsector >> 3) {
                    case 0x00: /* pio default */
                    case 0x01: /* pio mode */
-                       put_le16(s->identify_data + 62,0x07);
-                       put_le16(s->identify_data + 63,0x07);
-                       put_le16(s->identify_data + 88,0x3f);
+                       put_le16(identify_data + 62,0x07);
+                       put_le16(identify_data + 63,0x07);
+                       put_le16(identify_data + 88,0x3f);
                        break;
                     case 0x02: /* sigle word dma mode*/
-                       put_le16(s->identify_data + 62,0x07 | (1 << (val + 8)));
-                       put_le16(s->identify_data + 63,0x07);
-                       put_le16(s->identify_data + 88,0x3f);
+                       put_le16(identify_data + 62,0x07 | (1 << (val + 8)));
+                       put_le16(identify_data + 63,0x07);
+                       put_le16(identify_data + 88,0x3f);
                        break;
                    case 0x04: /* mdma mode */
-                       put_le16(s->identify_data + 62,0x07);
-                       put_le16(s->identify_data + 63,0x07 | (1 << (val + 8)));
-                       put_le16(s->identify_data + 88,0x3f);
+                       put_le16(identify_data + 62,0x07);
+                       put_le16(identify_data + 63,0x07 | (1 << (val + 8)));
+                       put_le16(identify_data + 88,0x3f);
                        break;
                    case 0x08: /* udma mode */
-                       put_le16(s->identify_data + 62,0x07);
-                       put_le16(s->identify_data + 63,0x07);
-                       put_le16(s->identify_data + 88,0x3f | (1 << (val + 8)));
+                       put_le16(identify_data + 62,0x07);
+                       put_le16(identify_data + 63,0x07);
+                       put_le16(identify_data + 88,0x3f | (1 << (val + 8)));
                        break;
                    default:
                        goto abort_cmd;
index 2e40431104588d5dc142a6253997c585a269b901..c55fa52b3ba020d3c70e5b57993cfa38db394f06 100644 (file)
@@ -374,7 +374,7 @@ struct IDEState {
     int64_t nb_sectors;
     int mult_sectors;
     int identify_set;
-    uint16_t identify_data[256];
+    uint8_t identify_data[512];
     int drive_serial;
     char drive_serial_str[21];
     /* ide regs */