From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <drc@linux.vnet.ibm.com>
Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com
 [148.163.158.5]) by dpdk.org (Postfix) with ESMTP id 698F71B398
 for <dev@dpdk.org>; Wed, 10 Apr 2019 23:37:10 +0200 (CEST)
Received: from pps.filterd (m0098420.ppops.net [127.0.0.1])
 by mx0b-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id
 x3ALYi8I173498 for <dev@dpdk.org>; Wed, 10 Apr 2019 17:37:09 -0400
Received: from e32.co.us.ibm.com (e32.co.us.ibm.com [32.97.110.150])
 by mx0b-001b2d01.pphosted.com with ESMTP id 2rspmbn225-1
 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT)
 for <dev@dpdk.org>; Wed, 10 Apr 2019 17:37:09 -0400
Received: from localhost
 by e32.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only!
 Violators will be prosecuted
 for <dev@dpdk.org> from <drc@linux.vnet.ibm.com>;
 Wed, 10 Apr 2019 22:37:08 +0100
Received: from b03cxnp08027.gho.boulder.ibm.com (9.17.130.19)
 by e32.co.us.ibm.com (192.168.1.132) with IBM ESMTP SMTP Gateway: Authorized
 Use Only! Violators will be prosecuted; 
 (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256)
 Wed, 10 Apr 2019 22:37:06 +0100
Received: from b03ledav002.gho.boulder.ibm.com
 (b03ledav002.gho.boulder.ibm.com [9.17.130.233])
 by b03cxnp08027.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id
 x3ALb5XI61341782
 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK);
 Wed, 10 Apr 2019 21:37:05 GMT
Received: from b03ledav002.gho.boulder.ibm.com (unknown [127.0.0.1])
 by IMSVA (Postfix) with ESMTP id A59EB13604F;
 Wed, 10 Apr 2019 21:37:05 +0000 (GMT)
Received: from b03ledav002.gho.boulder.ibm.com (unknown [127.0.0.1])
 by IMSVA (Postfix) with ESMTP id 3BDC4136059;
 Wed, 10 Apr 2019 21:37:05 +0000 (GMT)
Received: from oprom9.localdomain (unknown [9.40.204.34])
 by b03ledav002.gho.boulder.ibm.com (Postfix) with ESMTP;
 Wed, 10 Apr 2019 21:37:05 +0000 (GMT)
From: David Christensen <drc@linux.vnet.ibm.com>
To: thomas@monjalon.net, ferruh.yigit@intel.com, arybchenko@solarflare.com
Cc: dev@dpdk.org, radhika.chirra@ibm.com,
 David Christensen <drc@linux.vnet.ibm.com>, stable@dpdk.org
Date: Wed, 10 Apr 2019 16:36:54 -0500
X-Mailer: git-send-email 1.8.3.1
In-Reply-To: <1554927376-93022-1-git-send-email-drc@linux.vnet.ibm.com>
References: <1554927376-93022-1-git-send-email-drc@linux.vnet.ibm.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-TM-AS-GCONF: 00
x-cbid: 19041021-0004-0000-0000-000014FB133F
X-IBM-SpamModules-Scores: 
X-IBM-SpamModules-Versions: BY=3.00010904; HX=3.00000242; KW=3.00000007;
 PH=3.00000004; SC=3.00000284; SDB=6.01187235; UDB=6.00621865; IPR=6.00967998; 
 MB=3.00026383; MTD=3.00000008; XFM=3.00000015; UTC=2019-04-10 21:37:08
X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused
x-cbparentid: 19041021-0005-0000-0000-00008B365105
Message-Id: <1554932214-96522-1-git-send-email-drc@linux.vnet.ibm.com>
X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, ,
 definitions=2019-04-10_10:, , signatures=0
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0
 priorityscore=1501
 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0
 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0
 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx
 scancount=1 engine=8.0.1-1810050000 definitions=main-1904100140
Subject: [dpdk-dev] [PATCH v2] ethdev: missing typecast causes C++ build
	error
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Wed, 10 Apr 2019 21:37:10 -0000

The function eth_dev_pci_specific_init is missing a typecast to
(struct rte_pci_device *) for the input argument bus_device.
This causes build issues in the GNU C++ compiler.

[CXX]       g++ -o utils/pcap_handle.o -c utils/pcap_handle.cc -g3·
-ggdb3 -mcpu=native -mtune=native -isystem·
/home/rchirra/gen/io/ppc64include -std=gnu++11 -flax-vector-conversions·
-Werror -isystem /home/rchirra/gen/io

In file included from drivers/pmd.cc:7:0:
/home/rchirra/gen/io/deps/dpdk/build/include/rte_ethdev_pci.h:
In function ‘int eth_dev_pci_specific_init(rte_eth_dev*, void*)’:
/home/rchirra/gen/io/deps/dpdk/build/include/rte_ethdev_pci.h:75:35:·
error: invalid conversion from ‘void*’ to ‘rte_pci_device*’
[-fpermissive]
  struct rte_pci_device *pci_dev = bus_device;
                                   ^~~~~~~~~~
make[1]: *** [drivers/pmd.o] Error 1

$ g++ --version
g++ (Ubuntu 7.3.0-27ubuntu1~18.04) 7.3.0

Cc: stable@dpdk.org

Signed-off-by: David Christensen <drc@linux.vnet.ibm.com>
Tested-by: Radhika Chirra <radhika.chirra@ibm.com>
---
v2:
* Mmodified subject line to indicate a C++ compiler issue
* Added error output from the compiler

 lib/librte_ethdev/rte_ethdev_pci.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/librte_ethdev/rte_ethdev_pci.h b/lib/librte_ethdev/rte_ethdev_pci.h
index 23257e9..a325311 100644
--- a/lib/librte_ethdev/rte_ethdev_pci.h
+++ b/lib/librte_ethdev/rte_ethdev_pci.h
@@ -72,7 +72,7 @@
 
 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;
+	struct rte_pci_device *pci_dev = (struct rte_pci_device *)bus_device;
 
 	if (!pci_dev)
 		return -ENODEV;
-- 
1.8.3.1

From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from dpdk.org (dpdk.org [92.243.14.124])
	by dpdk.space (Postfix) with ESMTP id 6C7F4A0096
	for <public@inbox.dpdk.org>; Wed, 10 Apr 2019 23:37:13 +0200 (CEST)
Received: from [92.243.14.124] (localhost [127.0.0.1])
	by dpdk.org (Postfix) with ESMTP id C69D41B399;
	Wed, 10 Apr 2019 23:37:11 +0200 (CEST)
Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com
 [148.163.158.5]) by dpdk.org (Postfix) with ESMTP id 698F71B398
 for <dev@dpdk.org>; Wed, 10 Apr 2019 23:37:10 +0200 (CEST)
Received: from pps.filterd (m0098420.ppops.net [127.0.0.1])
 by mx0b-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id
 x3ALYi8I173498 for <dev@dpdk.org>; Wed, 10 Apr 2019 17:37:09 -0400
Received: from e32.co.us.ibm.com (e32.co.us.ibm.com [32.97.110.150])
 by mx0b-001b2d01.pphosted.com with ESMTP id 2rspmbn225-1
 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT)
 for <dev@dpdk.org>; Wed, 10 Apr 2019 17:37:09 -0400
Received: from localhost
 by e32.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only!
 Violators will be prosecuted
 for <dev@dpdk.org> from <drc@linux.vnet.ibm.com>;
 Wed, 10 Apr 2019 22:37:08 +0100
Received: from b03cxnp08027.gho.boulder.ibm.com (9.17.130.19)
 by e32.co.us.ibm.com (192.168.1.132) with IBM ESMTP SMTP Gateway: Authorized
 Use Only! Violators will be prosecuted; 
 (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256)
 Wed, 10 Apr 2019 22:37:06 +0100
Received: from b03ledav002.gho.boulder.ibm.com
 (b03ledav002.gho.boulder.ibm.com [9.17.130.233])
 by b03cxnp08027.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id
 x3ALb5XI61341782
 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK);
 Wed, 10 Apr 2019 21:37:05 GMT
Received: from b03ledav002.gho.boulder.ibm.com (unknown [127.0.0.1])
 by IMSVA (Postfix) with ESMTP id A59EB13604F;
 Wed, 10 Apr 2019 21:37:05 +0000 (GMT)
Received: from b03ledav002.gho.boulder.ibm.com (unknown [127.0.0.1])
 by IMSVA (Postfix) with ESMTP id 3BDC4136059;
 Wed, 10 Apr 2019 21:37:05 +0000 (GMT)
Received: from oprom9.localdomain (unknown [9.40.204.34])
 by b03ledav002.gho.boulder.ibm.com (Postfix) with ESMTP;
 Wed, 10 Apr 2019 21:37:05 +0000 (GMT)
From: David Christensen <drc@linux.vnet.ibm.com>
To: thomas@monjalon.net, ferruh.yigit@intel.com, arybchenko@solarflare.com
Cc: dev@dpdk.org, radhika.chirra@ibm.com,
 David Christensen <drc@linux.vnet.ibm.com>, stable@dpdk.org
Date: Wed, 10 Apr 2019 16:36:54 -0500
X-Mailer: git-send-email 1.8.3.1
In-Reply-To: <1554927376-93022-1-git-send-email-drc@linux.vnet.ibm.com>
References: <1554927376-93022-1-git-send-email-drc@linux.vnet.ibm.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
X-TM-AS-GCONF: 00
x-cbid: 19041021-0004-0000-0000-000014FB133F
X-IBM-SpamModules-Scores: 
X-IBM-SpamModules-Versions: BY=3.00010904; HX=3.00000242; KW=3.00000007;
 PH=3.00000004; SC=3.00000284; SDB=6.01187235; UDB=6.00621865; IPR=6.00967998; 
 MB=3.00026383; MTD=3.00000008; XFM=3.00000015; UTC=2019-04-10 21:37:08
X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused
x-cbparentid: 19041021-0005-0000-0000-00008B365105
Message-Id: <1554932214-96522-1-git-send-email-drc@linux.vnet.ibm.com>
X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, ,
 definitions=2019-04-10_10:, , signatures=0
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0
 priorityscore=1501
 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0
 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0
 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx
 scancount=1 engine=8.0.1-1810050000 definitions=main-1904100140
Subject: [dpdk-dev] [PATCH v2] ethdev: missing typecast causes C++ build
	error
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>
Message-ID: <20190410213654.uB--gSqamc7iYRCGki3wLTqI1Jsj3Lb7UL8F5gvg7iE@z>

The function eth_dev_pci_specific_init is missing a typecast to
(struct rte_pci_device *) for the input argument bus_device.
This causes build issues in the GNU C++ compiler.

[CXX]       g++ -o utils/pcap_handle.o -c utils/pcap_handle.cc -g3·
-ggdb3 -mcpu=native -mtune=native -isystem·
/home/rchirra/gen/io/ppc64include -std=gnu++11 -flax-vector-conversions·
-Werror -isystem /home/rchirra/gen/io

In file included from drivers/pmd.cc:7:0:
/home/rchirra/gen/io/deps/dpdk/build/include/rte_ethdev_pci.h:
In function ‘int eth_dev_pci_specific_init(rte_eth_dev*, void*)’:
/home/rchirra/gen/io/deps/dpdk/build/include/rte_ethdev_pci.h:75:35:·
error: invalid conversion from ‘void*’ to ‘rte_pci_device*’
[-fpermissive]
  struct rte_pci_device *pci_dev = bus_device;
                                   ^~~~~~~~~~
make[1]: *** [drivers/pmd.o] Error 1

$ g++ --version
g++ (Ubuntu 7.3.0-27ubuntu1~18.04) 7.3.0

Cc: stable@dpdk.org

Signed-off-by: David Christensen <drc@linux.vnet.ibm.com>
Tested-by: Radhika Chirra <radhika.chirra@ibm.com>
---
v2:
* Mmodified subject line to indicate a C++ compiler issue
* Added error output from the compiler

 lib/librte_ethdev/rte_ethdev_pci.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/librte_ethdev/rte_ethdev_pci.h b/lib/librte_ethdev/rte_ethdev_pci.h
index 23257e9..a325311 100644
--- a/lib/librte_ethdev/rte_ethdev_pci.h
+++ b/lib/librte_ethdev/rte_ethdev_pci.h
@@ -72,7 +72,7 @@
 
 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;
+	struct rte_pci_device *pci_dev = (struct rte_pci_device *)bus_device;
 
 	if (!pci_dev)
 		return -ENODEV;
-- 
1.8.3.1