RE: [PATCH V4 2/2] PCI/portdrv: Add #defines for the AER and DPC Interrupt Message Number masks

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

 



From: Dongdong Liu
> Sent: 11 October 2017 11:53
> In the AER case, the mask isn't strictly necessary because there are no
> higher-order bits above the Interrupt Message Number, but using a #define
> will make it possible to grep for it.
> 
> Suggested-by: Bjorn Helgaas <bhelgaas@xxxxxxxxxx>
> Signed-off-by: Dongdong Liu <liudongdong3@xxxxxxxxxx>
> ---
>  drivers/pci/pcie/portdrv_core.c | 4 ++--
>  include/uapi/linux/pci_regs.h   | 2 ++
>  2 files changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/pci/pcie/portdrv_core.c b/drivers/pci/pcie/portdrv_core.c
> index 9692379..2b48297 100644
> --- a/drivers/pci/pcie/portdrv_core.c
> +++ b/drivers/pci/pcie/portdrv_core.c
> @@ -116,7 +116,7 @@ static int pcie_port_enable_irq_vec(struct pci_dev *dev, int *irqs, int mask)
>  		 */
>  		pos = pci_find_ext_capability(dev, PCI_EXT_CAP_ID_ERR);
>  		pci_read_config_dword(dev, pos + PCI_ERR_ROOT_STATUS, &reg32);
> -		entry = reg32 >> 27;
> +		entry = (reg32 & PCI_ERR_ROOT_AER_IRQ) >> 27;

You've still got the hard coded 27 - which is almost more important than the mask.
Perhaps define things so this is:
		entry = PCI_ERR_ROOT_AER_IRQ(reg32);

Think I'd shift then mask with 0x1f.

	David




[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