On Saturday 25 August 2007, Dor Laor wrote:

> +static int debug = 3;
> +module_param(debug, int, 0);
> +MODULE_PARM_DESC(debug, "Debug level (0=none,...,16=all)");
> +
> +#define DPRINTK(klevel, fmt, args...) \
> +     if (('0' + debug) >= (int)(klevel[1])) \
> +             printk(klevel "%s:%d: " fmt, \
> +                     __FUNCTION__, __LINE__, ## args)

You shouldn't need this, just use pr_debug, or remove all calls to DPRINTK.

> +static int get_device_key(struct pci_dev *pdev, unsigned int *key)
> +{
> +        unsigned long ioaddr;

ioaddr should be a void __iomem *, not unsigned long.

> +        int rc;
> +        unsigned long pio_start, pio_end, pio_flags, pio_len;
> +
> +        rc = pci_enable_device(pdev);
> +        if (rc)
> +                goto err_out;
> +
> +        pio_start = pci_resource_start (pdev, 0);
> +        pio_end = pci_resource_end (pdev, 0);
> +        pio_flags = pci_resource_flags (pdev, 0);
> +        pio_len = pci_resource_len (pdev, 0);

write-only variables?

> +        DPRINTK(KERN_DEBUG, "PIO region size == 0x%lx\n", pio_len);
> +
> +        rc = pci_request_regions (pdev, "kvm_virtio");
> +        if (rc) {
> +             DPRINTK(KERN_DEBUG, "Failed register pci region\n");
> +                goto err_out;
> +     }

whitespace broken.

> +        ioaddr = (unsigned long)pci_iomap(pdev, 0, 0);
> +        if (!ioaddr) {
> +                printk(KERN_ERR "%s: cannot map PIO, aborting\n",
> pci_name(pdev));
> +                rc = -EIO;
> +                goto err_out;
> +        }

Use pcim_iomap in new code, and remove the iomap calls.

> +     DPRINTK(KERN_DEBUG, "ioaddr is %lx\n", ioaddr);
> +     *key = ioread32((void __iomem*)ioaddr);

kill the casts as well.

        Arnd <><

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel

Reply via email to