2020-06-02 09:24:35

by Piotr Stankiewicz

[permalink] [raw]
Subject: [PATCH 14/15] net: hns3: use PCI_IRQ_MSI_TYPES where appropriate

Seeing as there is shorthand available to use when asking for any type
of interrupt, or any type of message signalled interrupt, leverage it.

Signed-off-by: Piotr Stankiewicz <[email protected]>
Reviewed-by: Andy Shevchenko <[email protected]>
---
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 3 +--
drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c | 2 +-
2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
index a758f9ae32be..c49313e87170 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
@@ -2334,8 +2334,7 @@ static int hclge_init_msi(struct hclge_dev *hdev)
int i;

vectors = pci_alloc_irq_vectors(pdev, HNAE3_MIN_VECTOR_NUM,
- hdev->num_msi,
- PCI_IRQ_MSI | PCI_IRQ_MSIX);
+ hdev->num_msi, PCI_IRQ_MSI_TYPES);
if (vectors < 0) {
dev_err(&pdev->dev,
"failed(%d) to allocate MSI/MSI-X vectors\n",
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c
index e02d427131ee..002a40e65ab7 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c
@@ -2342,7 +2342,7 @@ static int hclgevf_init_msi(struct hclgevf_dev *hdev)
else
vectors = pci_alloc_irq_vectors(pdev, HNAE3_MIN_VECTOR_NUM,
hdev->num_msi,
- PCI_IRQ_MSI | PCI_IRQ_MSIX);
+ PCI_IRQ_MSI_TYPES);

if (vectors < 0) {
dev_err(&pdev->dev,
--
2.17.2


2020-06-02 15:41:56

by Andy Shevchenko

[permalink] [raw]
Subject: Re: [PATCH 14/15] net: hns3: use PCI_IRQ_MSI_TYPES where appropriate

On Tue, Jun 2, 2020 at 12:26 PM Piotr Stankiewicz
<[email protected]> wrote:
>
> Seeing as there is shorthand available to use when asking for any type
> of interrupt, or any type of message signalled interrupt, leverage it.

...

> vectors = pci_alloc_irq_vectors(pdev, HNAE3_MIN_VECTOR_NUM,
> - hdev->num_msi,
> - PCI_IRQ_MSI | PCI_IRQ_MSIX);
> + hdev->num_msi, PCI_IRQ_MSI_TYPES);

...

> vectors = pci_alloc_irq_vectors(pdev, HNAE3_MIN_VECTOR_NUM,

> hdev->num_msi,
> - PCI_IRQ_MSI | PCI_IRQ_MSIX);
> + PCI_IRQ_MSI_TYPES);

One line as above?

--
With Best Regards,
Andy Shevchenko

2020-06-03 08:54:32

by Piotr Stankiewicz

[permalink] [raw]
Subject: RE: [PATCH 14/15] net: hns3: use PCI_IRQ_MSI_TYPES where appropriate

> -----Original Message-----
> From: Andy Shevchenko <[email protected]>
> Sent: Tuesday, June 2, 2020 5:39 PM
>
> On Tue, Jun 2, 2020 at 12:26 PM Piotr Stankiewicz
> <[email protected]> wrote:
> >
> > Seeing as there is shorthand available to use when asking for any type
> > of interrupt, or any type of message signalled interrupt, leverage it.
>
> ...
>
> > vectors = pci_alloc_irq_vectors(pdev, HNAE3_MIN_VECTOR_NUM,
> > - hdev->num_msi,
> > - PCI_IRQ_MSI | PCI_IRQ_MSIX);
> > + hdev->num_msi, PCI_IRQ_MSI_TYPES);
>
> ...
>
> > vectors = pci_alloc_irq_vectors(pdev, HNAE3_MIN_VECTOR_NUM,
>
> > hdev->num_msi,
> > - PCI_IRQ_MSI | PCI_IRQ_MSIX);
> > + PCI_IRQ_MSI_TYPES);
>
> One line as above?
>

It would push the line above 80 characters.

> --
> With Best Regards,
> Andy Shevchenko

BR,
Piotr

2020-06-03 10:39:15

by Andy Shevchenko

[permalink] [raw]
Subject: Re: [PATCH 14/15] net: hns3: use PCI_IRQ_MSI_TYPES where appropriate

On Wed, Jun 3, 2020 at 11:50 AM Stankiewicz, Piotr
<[email protected]> wrote:
> > -----Original Message-----
> > From: Andy Shevchenko <[email protected]>
> > Sent: Tuesday, June 2, 2020 5:39 PM
> > On Tue, Jun 2, 2020 at 12:26 PM Piotr Stankiewicz
> > <[email protected]> wrote:

...

> > > hdev->num_msi,
> > > - PCI_IRQ_MSI | PCI_IRQ_MSIX);
> > > + PCI_IRQ_MSI_TYPES);
> >
> > One line as above?
> >
>
> It would push the line above 80 characters.

It's now relaxed limit, but if it is only few characters, I wouldn't care.

--
With Best Regards,
Andy Shevchenko