Re: [PATCH 9/9] pci/msi: style cleanups

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

 



On Wed, 2008-06-04 at 13:53 +0900, Hidetoshi Seto wrote:
> checkpatch said that msi.c has 22 errors and 6 warnings, and also
> that msi.h has 3 errors.  This patch cleans them all.

Hey, just a few comments ..

> diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
> index f62f941..b5decf3 100644
> --- a/drivers/pci/msi.c
> +++ b/drivers/pci/msi.c
> @@ -54,7 +53,8 @@ arch_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
>  	return 0;
>  }
>  
> -void __attribute__ ((weak)) arch_teardown_msi_irq(unsigned int irq)
> +void __attribute__ ((weak))
> +arch_teardown_msi_irq(unsigned int irq)
>  {
>  	return;
>  }

If you're going to bother touching it, at least use __weak? And then put
it back on one line.

> @@ -192,16 +192,16 @@ void read_msi_msg(unsigned int irq, struct msi_msg *msg)
>  	}
>  	case PCI_CAP_ID_MSIX:
>  	{
> -		void __iomem *base;
> -		base = entry->mask_base +
> +		void __iomem *ofs;
> +		ofs = entry->mask_base +
>  			entry->msi_attrib.entry_nr * PCI_MSIX_ENTRY_SIZE;
>  
> -		msg->address_lo = readl(base + PCI_MSIX_ENTRY_LOWER_ADDR_OFFSET);
> -		msg->address_hi = readl(base + PCI_MSIX_ENTRY_UPPER_ADDR_OFFSET);
> -		msg->data = readl(base + PCI_MSIX_ENTRY_DATA_OFFSET);
> - 		break;
> - 	}
> - 	default:
> +		msg->address_lo = readl(ofs + PCI_MSIX_ENTRY_LOWER_ADDR_OFFSET);
> +		msg->address_hi = readl(ofs + PCI_MSIX_ENTRY_UPPER_ADDR_OFFSET);
> +		msg->data = readl(ofs + PCI_MSIX_ENTRY_DATA_OFFSET);
> +		break;
> +	}

Is that just s/base/ofs/? If so that's just pointless churn IMHO.

> @@ -230,15 +230,13 @@ void write_msi_msg(unsigned int irq, struct msi_msg *msg)
>  	}
>  	case PCI_CAP_ID_MSIX:
>  	{
> -		void __iomem *base;
> -		base = entry->mask_base +
> +		void __iomem *ofs;
> +		ofs = entry->mask_base +
>  			entry->msi_attrib.entry_nr * PCI_MSIX_ENTRY_SIZE;
>  
> -		writel(msg->address_lo,
> -			base + PCI_MSIX_ENTRY_LOWER_ADDR_OFFSET);
> -		writel(msg->address_hi,
> -			base + PCI_MSIX_ENTRY_UPPER_ADDR_OFFSET);
> -		writel(msg->data, base + PCI_MSIX_ENTRY_DATA_OFFSET);
> +		writel(msg->address_lo, ofs + PCI_MSIX_ENTRY_LOWER_ADDR_OFFSET);
> +		writel(msg->address_hi, ofs + PCI_MSIX_ENTRY_UPPER_ADDR_OFFSET);
> +		writel(msg->data, ofs + PCI_MSIX_ENTRY_DATA_OFFSET);
>  		break;

Ditto.

cheers

-- 
Michael Ellerman
OzLabs, IBM Australia Development Lab

wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)

We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person

Attachment: signature.asc
Description: This is a digitally signed message part


[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux