From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <liang-min.wang@intel.com>
Received: from mga14.intel.com (mga14.intel.com [192.55.52.115])
 by dpdk.org (Postfix) with ESMTP id 0B280C9D0
 for <dev@dpdk.org>; Fri, 26 Jun 2015 19:05:41 +0200 (CEST)
Received: from fmsmga003.fm.intel.com ([10.253.24.29])
 by fmsmga103.fm.intel.com with ESMTP; 26 Jun 2015 10:05:30 -0700
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.13,686,1427785200"; d="scan'208";a="514761924"
Received: from orsmsx108.amr.corp.intel.com ([10.22.240.6])
 by FMSMGA003.fm.intel.com with ESMTP; 26 Jun 2015 10:05:26 -0700
Received: from orsmsx114.amr.corp.intel.com (10.22.240.10) by
 ORSMSX108.amr.corp.intel.com (10.22.240.6) with Microsoft SMTP Server (TLS)
 id 14.3.224.2; Fri, 26 Jun 2015 10:05:26 -0700
Received: from fmsmsx120.amr.corp.intel.com (10.18.124.208) by
 ORSMSX114.amr.corp.intel.com (10.22.240.10) with Microsoft SMTP Server (TLS)
 id 14.3.224.2; Fri, 26 Jun 2015 10:05:26 -0700
Received: from FMSMSX110.amr.corp.intel.com ([169.254.14.199]) by
 fmsmsx120.amr.corp.intel.com ([169.254.15.219]) with mapi id 14.03.0224.002;
 Fri, 26 Jun 2015 10:05:25 -0700
From: "Wang, Liang-min" <liang-min.wang@intel.com>
To: Stephen Hemminger <stephen@networkplumber.org>
Thread-Topic: [dpdk-dev] [PATCH v8 1/5] ethdev: add apis to support access
 device info
Thread-Index: AQHQsBwzt/YjESx1tEy8AsSzuIc6j52/dfQA//+NsjA=
Date: Fri, 26 Jun 2015 17:05:25 +0000
Message-ID: <B6CB929FEBC10D4FAC4BCA7EF2298E257177998E@FMSMSX110.amr.corp.intel.com>
References: <1432946276-9424-1-git-send-email-liang-min.wang@intel.com>
 <1435328807-15788-1-git-send-email-liang-min.wang@intel.com>
 <1435328807-15788-2-git-send-email-liang-min.wang@intel.com>
 <20150626095158.4725a924@urahara>
In-Reply-To: <20150626095158.4725a924@urahara>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.1.200.107]
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH v8 1/5] ethdev: add apis to support access
 device info
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: patches and discussions about DPDK <dev.dpdk.org>
List-Unsubscribe: <http://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <http://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Fri, 26 Jun 2015 17:05:42 -0000



> -----Original Message-----
> From: Stephen Hemminger [mailto:stephen@networkplumber.org]
> Sent: Friday, June 26, 2015 12:52 PM
> To: Wang, Liang-min
> Cc: dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v8 1/5] ethdev: add apis to support access
> device info
>=20
> On Fri, 26 Jun 2015 10:26:43 -0400
> Liang-Min Larry Wang <liang-min.wang@intel.com> wrote:
>=20
> > add new apis:
> > - rte_eth_dev_default_mac_addr_set
> > - rte_eth_dev_reg_length
> > - rte_eth_dev_reg_info
> > - rte_eth_dev_eeprom_length
> > - rte_eth_dev_get_eeprom
> > - rte_eth_dev_set_eeprom
> >
> > to enable reading device parameters (mac-addr, register,
> > eeprom) based upon ethtool alike
> > data parameter specification.
> >
> > Signed-off-by: Liang-Min Larry Wang <liang-min.wang@intel.com>
>=20
> I agree in principal, but has lots of style issues (see report from check=
patch).
>=20
> ERROR: spaces required around that '=3D' (ctx:VxW)
> #193: FILE: lib/librte_ether/rte_ethdev.c:3677:
> +	if ((dev=3D &rte_eth_devices[port_id]) =3D=3D NULL) {
>  	        ^
>=20
> ERROR: do not use assignment in if condition
> #193: FILE: lib/librte_ether/rte_ethdev.c:3677:
> +	if ((dev=3D &rte_eth_devices[port_id]) =3D=3D NULL) {
>=20
> ERROR: spaces required around that '=3D' (ctx:VxW)
> #213: FILE: lib/librte_ether/rte_ethdev.c:3697:
> +	if ((dev=3D &rte_eth_devices[port_id]) =3D=3D NULL) {
>  	        ^
>=20
> ERROR: do not use assignment in if condition
> #213: FILE: lib/librte_ether/rte_ethdev.c:3697:
> +	if ((dev=3D &rte_eth_devices[port_id]) =3D=3D NULL) {
>=20
> ERROR: spaces required around that '=3D' (ctx:VxW)
> #232: FILE: lib/librte_ether/rte_ethdev.c:3716:
> +	if ((dev=3D &rte_eth_devices[port_id]) =3D=3D NULL) {
>  	        ^
>=20
> ERROR: do not use assignment in if condition
> #232: FILE: lib/librte_ether/rte_ethdev.c:3716:
> +	if ((dev=3D &rte_eth_devices[port_id]) =3D=3D NULL) {
>=20
> ERROR: spaces required around that '=3D' (ctx:VxW)
> #251: FILE: lib/librte_ether/rte_ethdev.c:3735:
> +	if ((dev=3D &rte_eth_devices[port_id]) =3D=3D NULL) {
>  	        ^
>=20
> ERROR: do not use assignment in if condition
> #251: FILE: lib/librte_ether/rte_ethdev.c:3735:
> +	if ((dev=3D &rte_eth_devices[port_id]) =3D=3D NULL) {
>=20
> ERROR: spaces required around that '=3D' (ctx:VxW)
> #270: FILE: lib/librte_ether/rte_ethdev.c:3754:
> +	if ((dev=3D &rte_eth_devices[port_id]) =3D=3D NULL) {
>  	        ^
>=20
> ERROR: do not use assignment in if condition
> #270: FILE: lib/librte_ether/rte_ethdev.c:3754:
> +	if ((dev=3D &rte_eth_devices[port_id]) =3D=3D NULL) {

This part of code is the same as coding in other part of the same file such=
 as:

int
rte_eth_dev_bypass_wd_timeout_show(uint8_t port_id, uint32_t *wd_timeout)
{
	struct rte_eth_dev *dev;

	if (!rte_eth_dev_is_valid_port(port_id)) {
		PMD_DEBUG_TRACE("Invalid port_id=3D%d\n", port_id);
		return -ENODEV;
	}

	if ((dev=3D &rte_eth_devices[port_id]) =3D=3D NULL) {
		PMD_DEBUG_TRACE("Invalid port device\n");
		return -ENODEV;
	}

	FUNC_PTR_OR_ERR_RET(*dev->dev_ops->bypass_wd_timeout_show, -ENOTSUP);
	(*dev->dev_ops->bypass_wd_timeout_show)(dev, wd_timeout);
	return 0;
}
I would suggest that someone (either you or me) to do a code cleaning after=
 all patches for DPDK 2.1 have been decided. Does that sound good to you?