qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Juan Quintela <quintela@redhat.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH 02/12] ide: Remove cast in pci_register_bar
Date: Wed,  7 Oct 2009 16:56:19 +0200	[thread overview]
Message-ID: <d28189b21154fe9a75b8270cb04e8229a5dc00d3.1254927186.git.quintela@redhat.com> (raw)
In-Reply-To: <cover.1254927186.git.quintela@redhat.com>
In-Reply-To: <cover.1254927186.git.quintela@redhat.com>

We already have a PCIDevice at that point

Signed-off-by: Juan Quintela <quintela@redhat.com>
---
 hw/ide/pci.c |   18 ++++++------------
 1 files changed, 6 insertions(+), 12 deletions(-)

diff --git a/hw/ide/pci.c b/hw/ide/pci.c
index 0e2c7d7..9d7fdd4 100644
--- a/hw/ide/pci.c
+++ b/hw/ide/pci.c
@@ -413,16 +413,11 @@ static int pci_cmd646_ide_initfn(PCIDevice *dev)
         pci_conf[0x51] |= 0x08; /* enable IDE1 */
     }

-    pci_register_bar((PCIDevice *)d, 0, 0x8,
-                     PCI_ADDRESS_SPACE_IO, ide_map);
-    pci_register_bar((PCIDevice *)d, 1, 0x4,
-                     PCI_ADDRESS_SPACE_IO, ide_map);
-    pci_register_bar((PCIDevice *)d, 2, 0x8,
-                     PCI_ADDRESS_SPACE_IO, ide_map);
-    pci_register_bar((PCIDevice *)d, 3, 0x4,
-                     PCI_ADDRESS_SPACE_IO, ide_map);
-    pci_register_bar((PCIDevice *)d, 4, 0x10,
-                     PCI_ADDRESS_SPACE_IO, bmdma_map);
+    pci_register_bar(dev, 0, 0x8, PCI_ADDRESS_SPACE_IO, ide_map);
+    pci_register_bar(dev, 1, 0x4, PCI_ADDRESS_SPACE_IO, ide_map);
+    pci_register_bar(dev, 2, 0x8, PCI_ADDRESS_SPACE_IO, ide_map);
+    pci_register_bar(dev, 3, 0x4, PCI_ADDRESS_SPACE_IO, ide_map);
+    pci_register_bar(dev, 4, 0x10, PCI_ADDRESS_SPACE_IO, bmdma_map);

     pci_conf[0x3d] = 0x01; // interrupt on pin 1

@@ -477,8 +472,7 @@ static int pci_piix_ide_initfn(PCIIDEState *d)
     qemu_register_reset(piix3_reset, d);
     piix3_reset(d);

-    pci_register_bar((PCIDevice *)d, 4, 0x10,
-                     PCI_ADDRESS_SPACE_IO, bmdma_map);
+    pci_register_bar(&d->dev, 4, 0x10, PCI_ADDRESS_SPACE_IO, bmdma_map);

     register_savevm("ide", 0, 3, pci_ide_save, pci_ide_load, d);

-- 
1.6.2.5

  parent reply	other threads:[~2009-10-07 14:56 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-07 14:56 [Qemu-devel] [PATCH 00/12] PCI IDE cleanup Juan Quintela
2009-10-07 14:56 ` [Qemu-devel] [PATCH 01/12] ide: change cast to DO_UPCAST Juan Quintela
2009-10-07 14:56 ` Juan Quintela [this message]
2009-10-07 14:56 ` [Qemu-devel] [PATCH 03/12] ide: Remove duplicated definitions Juan Quintela
2009-10-07 14:56 ` [Qemu-devel] [PATCH 04/12] ide: remove uselsess casts from void * Juan Quintela
2009-10-07 14:56 ` [Qemu-devel] [PATCH 05/12] ide: create ide/pci.h for common ide pci definitions Juan Quintela
2009-10-07 14:56 ` [Qemu-devel] [PATCH 06/12] ide: export needed ide-pci functions for split Juan Quintela
2009-10-07 14:56 ` [Qemu-devel] [PATCH 07/12] ide: split cmd646 and piix from pci.c Juan Quintela
2009-10-07 14:56 ` [Qemu-devel] [PATCH 08/12] ide: PCIIDEState type field is not needed anymore Juan Quintela
2009-10-07 14:56 ` [Qemu-devel] [PATCH 09/12] ide: 'secondary' field is only used by cmd646 Juan Quintela
2009-10-07 14:56 ` [Qemu-devel] [PATCH 10/12] ide: cmd646 we can get the pci device with container_of Juan Quintela
2009-10-07 14:56 ` [Qemu-devel] [PATCH 11/12] ide: cmd646 ->unit has just the value that we want Juan Quintela
2009-10-07 14:56 ` [Qemu-devel] [PATCH 12/12] ide: BMDMAState don't need a pci_dev field anymore Juan Quintela

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d28189b21154fe9a75b8270cb04e8229a5dc00d3.1254927186.git.quintela@redhat.com \
    --to=quintela@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).