[6/6] raw/cnxk_bphy: use named value for queue count

Message ID 20210726135815.81201-7-tduszynski@marvell.com (mailing list archive)
State Accepted, archived
Delegated to: Jerin Jacob
Headers
Series common/cnxk: sync with local codebase |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/github-robot success github build: passed
ci/Intel-compilation success Compilation OK
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-testing success Testing PASS
ci/intel-Testing success Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS

Commit Message

Tomasz Duszynski July 26, 2021, 1:58 p.m. UTC
  From: Jakub Palider <jpalider@marvell.com>

Queue counter is used in a few places so it was given some
reasonable name.

Signed-off-by: Jakub Palider <jpalider@marvell.com>
---
 drivers/raw/cnxk_bphy/cnxk_bphy.c     | 2 ++
 drivers/raw/cnxk_bphy/cnxk_bphy_irq.h | 3 ++-
 2 files changed, 4 insertions(+), 1 deletion(-)
  

Comments

Jerin Jacob Sept. 28, 2021, 9:18 a.m. UTC | #1
On Mon, Jul 26, 2021 at 7:29 PM Tomasz Duszynski <tduszynski@marvell.com> wrote:
>
> From: Jakub Palider <jpalider@marvell.com>
>
> Queue counter is used in a few places so it was given some
> reasonable name.
>
> Signed-off-by: Jakub Palider <jpalider@marvell.com>

Series Acked-by: Jerin Jacob <jerinj@marvell.com>
Series applied to dpdk-next-net-mrvl/for-next-net. Thanks.


> ---
>  drivers/raw/cnxk_bphy/cnxk_bphy.c     | 2 ++
>  drivers/raw/cnxk_bphy/cnxk_bphy_irq.h | 3 ++-
>  2 files changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/raw/cnxk_bphy/cnxk_bphy.c b/drivers/raw/cnxk_bphy/cnxk_bphy.c
> index affc5c3e83..030beff05e 100644
> --- a/drivers/raw/cnxk_bphy/cnxk_bphy.c
> +++ b/drivers/raw/cnxk_bphy/cnxk_bphy.c
> @@ -51,6 +51,8 @@ bphy_rawdev_selftest(uint16_t dev_id)
>         queues = rte_rawdev_queue_count(dev_id);
>         if (queues == 0)
>                 return -ENODEV;
> +       if (queues != BPHY_QUEUE_CNT)
> +               return -EINVAL;
>
>         ret = rte_rawdev_start(dev_id);
>         if (ret)
> diff --git a/drivers/raw/cnxk_bphy/cnxk_bphy_irq.h b/drivers/raw/cnxk_bphy/cnxk_bphy_irq.h
> index b55147b93e..f141677e2a 100644
> --- a/drivers/raw/cnxk_bphy/cnxk_bphy_irq.h
> +++ b/drivers/raw/cnxk_bphy/cnxk_bphy_irq.h
> @@ -23,10 +23,11 @@ struct bphy_irq_queue {
>  };
>
>  struct bphy_device {
> +#define BPHY_QUEUE_CNT 1
>         struct roc_bphy_irq_chip *irq_chip;
>         struct bphy_mem mem;
>         /* bphy irq interface supports single queue only */
> -       struct bphy_irq_queue queues[1];
> +       struct bphy_irq_queue queues[BPHY_QUEUE_CNT];
>  };
>
>  int cnxk_bphy_intr_init(uint16_t dev_id);
> --
> 2.25.1
>
  

Patch

diff --git a/drivers/raw/cnxk_bphy/cnxk_bphy.c b/drivers/raw/cnxk_bphy/cnxk_bphy.c
index affc5c3e83..030beff05e 100644
--- a/drivers/raw/cnxk_bphy/cnxk_bphy.c
+++ b/drivers/raw/cnxk_bphy/cnxk_bphy.c
@@ -51,6 +51,8 @@  bphy_rawdev_selftest(uint16_t dev_id)
 	queues = rte_rawdev_queue_count(dev_id);
 	if (queues == 0)
 		return -ENODEV;
+	if (queues != BPHY_QUEUE_CNT)
+		return -EINVAL;
 
 	ret = rte_rawdev_start(dev_id);
 	if (ret)
diff --git a/drivers/raw/cnxk_bphy/cnxk_bphy_irq.h b/drivers/raw/cnxk_bphy/cnxk_bphy_irq.h
index b55147b93e..f141677e2a 100644
--- a/drivers/raw/cnxk_bphy/cnxk_bphy_irq.h
+++ b/drivers/raw/cnxk_bphy/cnxk_bphy_irq.h
@@ -23,10 +23,11 @@  struct bphy_irq_queue {
 };
 
 struct bphy_device {
+#define BPHY_QUEUE_CNT 1
 	struct roc_bphy_irq_chip *irq_chip;
 	struct bphy_mem mem;
 	/* bphy irq interface supports single queue only */
-	struct bphy_irq_queue queues[1];
+	struct bphy_irq_queue queues[BPHY_QUEUE_CNT];
 };
 
 int cnxk_bphy_intr_init(uint16_t dev_id);