WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [PATCH 2/2] ioemu: Enable guest OS to program D0-D3hot s

To: Yuji Shimada <shimada-yxb@xxxxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH 2/2] ioemu: Enable guest OS to program D0-D3hot states of an assigned device
From: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
Date: Wed, 4 Feb 2009 19:14:39 +0900
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx, Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
Delivery-date: Wed, 04 Feb 2009 02:15:05 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <20090203185158.5A4B.SHIMADA-YXB@xxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <20090203184921.5A45.SHIMADA-YXB@xxxxxxxxxxxxxxx> <20090203185158.5A4B.SHIMADA-YXB@xxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.6i
On Tue, Feb 03, 2009 at 06:54:45PM +0900, Yuji Shimada wrote:
> This patch enables guest OS to program D0-D3hot states of assigned
> device.
> 
> Thanks,

Hi. Just a minor nit.

LIST_FOREACH() and LIST_FIRST() should be used instead
of direct use of lh_first, le_next for consistency.
Many "switch(len) case [124] pci_{read, write}_{byte, word, long}():"
are duplicated. The duplication can be removed by using something like
the followings (NOTE: I didn't compile it)

static uint32_t __pci_read_config(struct pci_dev *pci_dev,
                                  uint32_t address, int len)
{
    uint32_t val = 0xffffffff;

    switch (len) {
    case 1:
        val = pci_read_byte(pci_dev, address);
        break;
    case 2:
        val = pci_read_word(pci_dev, address);
        break;
    case 4:
        val = pci_read_long(pci_dev, address);
        break;
    }
    return val;
}

static void __pci_write_config(struct pci_dev *pci_dev,
                               uint32_t address, int len, uint32_t val)
{
    switch (len) {
    case 1:
        pci_write_byte(pci_dev, address, val);
        break;
    case 2:
        pci_write_word(pci_dev, address, val);
        break;
    case 4:
        pci_write_long(pci_dev, address, val);
        break;
    }
}


thanks,
-- 
yamahata

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>