qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 02/13] ide: change identify_data type to uint8_t


From: Juan Quintela
Subject: [Qemu-devel] [PATCH 02/13] ide: change identify_data type to uint8_t
Date: Wed, 14 Oct 2009 13:37:42 +0200

It is used everywhere as uint8_t except in one place.  Cast to uint16_t
in that place

Signed-off-by: Juan Quintela <address@hidden>
---
 hw/ide/core.c     |   25 +++++++++++++------------
 hw/ide/internal.h |    2 +-
 2 files changed, 14 insertions(+), 13 deletions(-)

diff --git a/hw/ide/core.c b/hw/ide/core.c
index e1433b2..aeff034 100644
--- a/hw/ide/core.c
+++ b/hw/ide/core.c
@@ -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;
diff --git a/hw/ide/internal.h b/hw/ide/internal.h
index 2e40431..c55fa52 100644
--- a/hw/ide/internal.h
+++ b/hw/ide/internal.h
@@ -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 */
-- 
1.6.2.5





reply via email to

[Prev in Thread] Current Thread [Next in Thread]