[v2,2/2] common/cnxk: add include for macro definition

Message ID 20220615171013.36426-3-bruce.richardson@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Jerin Jacob
Headers
Series add includes to help when editing in Eclipse |

Checks

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

Commit Message

Bruce Richardson June 15, 2022, 5:10 p.m. UTC
  The header file "roc_io.h" uses the "__plt_always_inline" macro but
don't include "roc_platform.h" to get the definition of it. This
inclusion is not necessary for compilation, but the lack of it can
confuse some indexers - such as those in eclipse, which reports the
lines:

"static __plt_always_inline uint64_t"

as possible definitions of a variable called "uint64_t". This confusion
leads to uint64_t being flagged as an unknown type in all other parts of
the project being indexed, e.g. across all of DPDK code.

Adding in the include of roc_platform.h makes it clear to the indexer
that those lines are  part of a function definition, and that allows
eclipse to correctly recognise uint64_t as a type from stdint.h

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
V2: fix copy-paste error, where header name replacement was missed
---
 drivers/common/cnxk/roc_io.h | 2 ++
 1 file changed, 2 insertions(+)

--
2.34.1
  

Comments

Jerin Jacob June 17, 2022, 1:18 p.m. UTC | #1
On Wed, Jun 15, 2022 at 10:41 PM Bruce Richardson
<bruce.richardson@intel.com> wrote:
>
> The header file "roc_io.h" uses the "__plt_always_inline" macro but
> don't include "roc_platform.h" to get the definition of it. This
> inclusion is not necessary for compilation, but the lack of it can
> confuse some indexers - such as those in eclipse, which reports the
> lines:
>
> "static __plt_always_inline uint64_t"
>
> as possible definitions of a variable called "uint64_t". This confusion
> leads to uint64_t being flagged as an unknown type in all other parts of
> the project being indexed, e.g. across all of DPDK code.
>
> Adding in the include of roc_platform.h makes it clear to the indexer
> that those lines are  part of a function definition, and that allows
> eclipse to correctly recognise uint64_t as a type from stdint.h
>
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>

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

1/2 patch is delegated to Thomas.

> ---
> V2: fix copy-paste error, where header name replacement was missed
> ---
>  drivers/common/cnxk/roc_io.h | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/drivers/common/cnxk/roc_io.h b/drivers/common/cnxk/roc_io.h
> index 62e98d9d00..9d73e263f7 100644
> --- a/drivers/common/cnxk/roc_io.h
> +++ b/drivers/common/cnxk/roc_io.h
> @@ -5,6 +5,8 @@
>  #ifndef _ROC_IO_H_
>  #define _ROC_IO_H_
>
> +#include "roc_platform.h" /* for __plt_always_inline macro */
> +
>  #define ROC_LMT_BASE_ID_GET(lmt_addr, lmt_id)                                  \
>         do {                                                                   \
>                 /* 32 Lines per core */                                        \
> --
> 2.34.1
>
  

Patch

diff --git a/drivers/common/cnxk/roc_io.h b/drivers/common/cnxk/roc_io.h
index 62e98d9d00..9d73e263f7 100644
--- a/drivers/common/cnxk/roc_io.h
+++ b/drivers/common/cnxk/roc_io.h
@@ -5,6 +5,8 @@ 
 #ifndef _ROC_IO_H_
 #define _ROC_IO_H_

+#include "roc_platform.h" /* for __plt_always_inline macro */
+
 #define ROC_LMT_BASE_ID_GET(lmt_addr, lmt_id)                                  \
 	do {                                                                   \
 		/* 32 Lines per core */                                        \