[PATCH v3 3/4] bus/ifpga: use C linkage where appropriate in driver header
David Marchand
david.marchand at redhat.com
Tue Oct 22 21:27:44 CEST 2024
On Mon, Oct 21, 2024 at 8:01 PM Mattias Rönnblom <hofors at lysator.liu.se> wrote:
>
> On 2024-10-21 18:04, David Marchand wrote:
> > This driver was missed when cleaning up most of the headers.
> >
> > Fixes: 719834a6849e ("use C linkage where appropriate in headers")
> >
> > Signed-off-by: David Marchand <david.marchand at redhat.com>
> > ---
> > drivers/bus/ifpga/bus_ifpga_driver.h | 8 ++++----
> > 1 file changed, 4 insertions(+), 4 deletions(-)
> >
> > diff --git a/drivers/bus/ifpga/bus_ifpga_driver.h b/drivers/bus/ifpga/bus_ifpga_driver.h
> > index 5bbe36d6e0..a42afc7d75 100644
> > --- a/drivers/bus/ifpga/bus_ifpga_driver.h
> > +++ b/drivers/bus/ifpga/bus_ifpga_driver.h
> > @@ -11,16 +11,16 @@
> > * RTE Intel FPGA Bus Interface
> > */
> >
> > -#ifdef __cplusplus
> > -extern "C" {
> > -#endif /* __cplusplus */
> > -
> > #include <rte_compat.h>
> > #include <dev_driver.h>
> > #include <rte_pci.h>
> > #include <rte_interrupts.h>
> > #include <rte_spinlock.h>
> >
> > +#ifdef __cplusplus
> > +extern "C" {
> > +#endif /* __cplusplus */
> > +
> > #define IFPGA_BUS_NAME ifpga
> >
> > /* Forward declarations */
>
> My effort was limited to the headers passed to chkincs, which I'm
> guessing is the public API headers.
There were many headers that got changed in commit 719834a6849e ("use
C linkage where appropriate in headers") while not being in the
exported headers list, which is what chkincs checks.
For example,
$ git show --stat 719834a6849e | grep raw/ifpga
drivers/raw/ifpga/afu_pmd_core.h | 8 ++++----
drivers/raw/ifpga/afu_pmd_he_hssi.h | 6 +++---
drivers/raw/ifpga/afu_pmd_he_lpbk.h | 6 +++---
drivers/raw/ifpga/afu_pmd_he_mem.h | 6 +++---
drivers/raw/ifpga/afu_pmd_n3000.h | 6 +++---
drivers/raw/ifpga/rte_pmd_afu.h | 4 ++--
drivers/raw/ifpga/rte_pmd_ifpga.h | 4 ++--
$ grep chkincs.*afu build/build.ninja
>
> Internal headers shouldn't have any #ifdef __cpluspus at all, anywhere.
>
Internal headers, I agree, though commit 719834a6849e ("use C linkage
where appropriate in headers") did change some.
For drivers headers that are exported, it is another story, some
people seem to like C++ for writing out of tree drivers.
And this is what this patch of mine is about.
--
David Marchand
More information about the dev
mailing list