From: Ferruh Yigit <ferruh.yigit@intel.com>
To: Bruce Richardson <bruce.richardson@intel.com>, <dev@dpdk.org>
Cc: Thomas Monjalon <thomas@monjalon.net>,
Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>,
Stephen Hemminger <stephen@networkplumber.org>
Subject: Re: [PATCH 1/3] ethdev: fix missing cast for C++ compatibility
Date: Wed, 16 Feb 2022 10:32:43 +0000 [thread overview]
Message-ID: <69adf34b-6914-8b54-b35b-c968d72a1b33@intel.com> (raw)
In-Reply-To: <20220215173029.1893710-2-bruce.richardson@intel.com>
On 2/15/2022 5:30 PM, Bruce Richardson wrote:
> C++ does not allow implicit conversion to/from void*, so we need an
> explicit cast to allow the driver sdk header to be included from C++
> code.
>
I remember patches removing explicit "void *" cast, in the past,
to document, is the rule as following:
- public and sdk headers should support c++, hence these files
must have explicit "void *" cast
- .c files should NOT have explicit "void *" cast
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> ---
> lib/ethdev/ethdev_pci.h | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/lib/ethdev/ethdev_pci.h b/lib/ethdev/ethdev_pci.h
> index 71aa4b2e98..d2bc3fe5e0 100644
> --- a/lib/ethdev/ethdev_pci.h
> +++ b/lib/ethdev/ethdev_pci.h
> @@ -46,8 +46,9 @@ rte_eth_copy_pci_info(struct rte_eth_dev *eth_dev,
> }
>
> static inline int
> -eth_dev_pci_specific_init(struct rte_eth_dev *eth_dev, void *bus_device) {
> - struct rte_pci_device *pci_dev = bus_device;
> +eth_dev_pci_specific_init(struct rte_eth_dev *eth_dev, void *bus_device)
> +{
> + struct rte_pci_device *pci_dev = (struct rte_pci_device *)bus_device;
>
> if (!pci_dev)
> return -ENODEV;
next prev parent reply other threads:[~2022-02-16 10:32 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-15 17:30 [PATCH 0/3] extend C++ compatibility checks Bruce Richardson
2022-02-15 17:30 ` [PATCH 1/3] ethdev: fix missing cast for C++ compatibility Bruce Richardson
2022-02-16 10:32 ` Ferruh Yigit [this message]
2022-02-16 11:01 ` Bruce Richardson
2022-02-15 17:30 ` [PATCH 2/3] buildtools/chkincs: check sdk headers " Bruce Richardson
2022-02-15 17:30 ` [PATCH 3/3] buildtools/chkincs: add checks for missing C++ guards Bruce Richardson
2022-02-17 8:06 ` [PATCH 0/3] extend C++ compatibility checks Tyler Retzlaff
2022-02-22 14:21 ` Thomas Monjalon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=69adf34b-6914-8b54-b35b-c968d72a1b33@intel.com \
--to=ferruh.yigit@intel.com \
--cc=andrew.rybchenko@oktetlabs.ru \
--cc=bruce.richardson@intel.com \
--cc=dev@dpdk.org \
--cc=stephen@networkplumber.org \
--cc=thomas@monjalon.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).