From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id E9E4BA0526; Fri, 10 Jul 2020 07:13:18 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id CBD6F1D67D; Fri, 10 Jul 2020 07:13:18 +0200 (CEST) Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-eopbgr80084.outbound.protection.outlook.com [40.107.8.84]) by dpdk.org (Postfix) with ESMTP id 033CD1D657 for ; Fri, 10 Jul 2020 07:13:17 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MzKKrtu/2yo0AatVSPZr8RpOInQXlKIkrVes31aGMHQhaKiyF8iQae3y2See9W5kx5SNddJHPuDRw2NnL2c1bo88HZSMvfszdSwmdDzKHnX09qBXQJHbiTgWDj5oxM41ANwNY+bgfCFpKsYS2Mqzk/dP/bLqIJY4W+Z4lPmnJHGF3ImUlo2pW0Pi6NBpKyD1dweYFiPBoCwdRPeZGBdBMcREk1G9hIMhFBV+pqMqpwxlB7JtBqxetlYapTcxpyV2ZUpzVPnfkeDg4/3dhUcXalV8IqAEa8BQrAfdqvXf/Cw6hS+jpLHEzS2WuONjnkFvvVwNZ4dPVQlBwn1+ZPMTvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=PtNML5ljUEIciD+8PuXsGwcuQvBwdXCkFxU21b24WPk=; b=bkCDXM7d+cAKy5mMF2MV3uWjbEuVUqosspz+8edUqxV6/Xx5rfTQaFU0mvZfmzuUMv31+HsOvw3dn7QcbGdj8lEo44oBmpoM9AR0qOgyUFx3RJtdyO+WcXPTKXv3F0iZMuhQRPKJOBHXnWMTkPRYBkWLOTCpEJ/64ZkGRaznExlx+gq7GSvTJDRn/XsphpRtp503cDDLbJSxNHXOIWldQVMDXZkSCtuDPnFochEHsJmIrS0qsjCSIa5BHbKHo+UnOGrXXZi9E/nDfhaD2lgrxAaloKqBrImOMoo6Y1YOuEOgRX1IqKXuVjU4PJF+BfyINQ8z8hT7lvrGjOprPOsMFQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=PtNML5ljUEIciD+8PuXsGwcuQvBwdXCkFxU21b24WPk=; b=oX2rlC8MxgnKUB38CHh3PLoMQtnwnT0Po9K0yAkUoGac8Gqz6hurYUJaD7qz3D/qbP3L+yEcypePOFlFe2YmsWQyDMDkkbZOcfzmNR7POVcVu0gFV3+2i8TzQwOZa80Z4skGhutLtAaYOaDNUPxtrg85lMCovlgIMBcYALsaLHQ= Received: from AM6PR04MB4456.eurprd04.prod.outlook.com (2603:10a6:20b:22::25) by AM7PR04MB6870.eurprd04.prod.outlook.com (2603:10a6:20b:107::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3174.23; Fri, 10 Jul 2020 05:13:16 +0000 Received: from AM6PR04MB4456.eurprd04.prod.outlook.com ([fe80::52:2324:96c9:f3ae]) by AM6PR04MB4456.eurprd04.prod.outlook.com ([fe80::52:2324:96c9:f3ae%7]) with mapi id 15.20.3153.029; Fri, 10 Jul 2020 05:13:16 +0000 From: Hemant Agrawal To: Natanael Copa , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v3 10/15] bus/dpaa: use warn(3) instead of error(3) to improve portability Thread-Index: AQHU2b95JyxsBLhsYkyW1Zjcn7X4MqkDPblw Date: Fri, 10 Jul 2020 05:13:16 +0000 Message-ID: References: <20190313170657.16688-1-ncopa@alpinelinux.org> <20190313170657.16688-11-ncopa@alpinelinux.org> In-Reply-To: <20190313170657.16688-11-ncopa@alpinelinux.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: alpinelinux.org; dkim=none (message not signed) header.d=none;alpinelinux.org; dmarc=none action=none header.from=nxp.com; x-originating-ip: [182.69.104.93] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 0b7fbcf9-3b94-45b6-50c5-08d8248ff3e5 x-ms-traffictypediagnostic: AM7PR04MB6870: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:843; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: TBVQhbPXjATFJ/I+x/4HWki7jtj9OmpeaJiUeyW46AkQgGacynw6sATNnx4+G/VAIu2iABlmYInkQ9/kTiJtgoB0Xy1wrLFiF49RmcEy22lNG9y4IXsidi8xmfGtRTSaHbsqx3INuotFFb/vVPw3UYaZAgSojT2BW/aCjs9bXCYQH79zOKlt+g38CgVn5J62hvoak5Eit7Co4NnsJQ9tirO5x1TlxFCD+X2Sl25dgqQdfBCrdAwaSrgT2CLvLt1kD9YZM2x7E0Mp9GtlPGJ4b+IlBLC3YmK5q29Hi80OoKfqrbCKn7PilHt4B9OibgBsrBIj6TlqnBc4xpRAiMQPZQ== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM6PR04MB4456.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(136003)(346002)(396003)(366004)(376002)(39860400002)(110136005)(7696005)(316002)(86362001)(33656002)(52536014)(83380400001)(186003)(2906002)(26005)(53546011)(55016002)(6506007)(5660300002)(478600001)(66446008)(9686003)(66556008)(66946007)(8936002)(44832011)(64756008)(71200400001)(66476007)(76116006); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: 7nT0L4sDqGsdsBxVpNFyXxCX5afwbJMQVze0HxBG0CdMlnia+b7xJ8nKJvQmdtZvewh5KGNaB0a2+v4hnDr7x5dD6cgUo6fGdko74oFjhdH4XBXFsqo4JxVwlE96oj+ef9gczEIpYYtyJOcstERlH6r+ZgovMk7WzC/lZcBMv+8kO1doOlen8M44zrCpdnhMPaFRUqnVjDDu2oBi4B5SO/9Pg3Zuzo+HHr898LlTicl/8KC6kvZaZIXfdetJ/5rUEcrypgJ9WgLExcF3zMBQBehSxjGqAkTqgtvjN1QPRJXCVB+Q7f9wlxcj7nsqV2EDQ1946D5+oIHDChHCIsh2yUCMAhNkQbL0zLYDKqC45/cwPsx0XivE+fml5Pu5hEwqzcSG3K9DL8eJAMvbqqR3eMjZcnsVelDYqK6UGpXDkolXpZtt+dyE7ThWTu0mJslxvWrKVyKcQVZC05DxS9Zhb9PCTWfCkR665z8Yi2pul/aXT25DDMIEwUtmFSGr9lLX x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB4456.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0b7fbcf9-3b94-45b6-50c5-08d8248ff3e5 X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Jul 2020 05:13:16.2161 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: vC7oUuSRg6yOaxKmq5sALFrdJmFR1jgB5kjHXMtPqEi9+1PC3jNf4uuY3LjWRUQqfDFpDOt/OGpWV/sVpFCIKw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR04MB6870 Subject: Re: [dpdk-dev] [PATCH v3 10/15] bus/dpaa: use warn(3) instead of error(3) to improve portability X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" NAK error is different from warning - the return value is also not carried.=20 -----Original Message----- From: dev On Behalf Of Natanael Copa Sent: Wednesday, March 13, 2019 10:37 PM To: dev@dpdk.org Cc: Natanael Copa Subject: [dpdk-dev] [PATCH v3 10/15] bus/dpaa: use warn(3) instead of error= (3) to improve portability Fix build with musl libc by using warn(3) instead of error(3). This also fixes error message for kzmalloc failures which previously would = have given "Unknown error -1". Signed-off-by: Natanael Copa --- drivers/bus/dpaa/base/fman/netcfg_layer.c | 4 ++-- drivers/bus/dpaa/base= /qbman/bman_driver.c | 6 +++--- drivers/bus/dpaa/base/qbman/qman_driver.c= | 12 ++++++------ drivers/bus/dpaa/include/compat.h | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/drivers/bus/dpaa/base/fman/netcfg_layer.c b/drivers/bus/dpaa/b= ase/fman/netcfg_layer.c index 6b5224203..0c3a1bfa3 100644 --- a/drivers/bus/dpaa/base/fman/netcfg_layer.c +++ b/drivers/bus/dpaa/base/fman/netcfg_layer.c @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include #include #include @@ -89,7 +89,7 @@ netcfg_acquire(void) */ skfd =3D socket(AF_PACKET, SOCK_RAW, 0); if (unlikely(skfd < 0)) { - error(0, errno, "%s(): open(SOCK_RAW)", __func__); + warn("%s(): open(SOCK_RAW)", __func__); return NULL; } =20 diff --git a/drivers/bus/dpaa/base/qbman/bman_driver.c b/drivers/bus/dpaa/b= ase/qbman/bman_driver.c index 750b756b9..dbe00d1c9 100644 --- a/drivers/bus/dpaa/base/qbman/bman_driver.c +++ b/drivers/bus/dpaa/base/qbman/bman_driver.c @@ -40,7 +40,7 @@ static int fsl_bman_portal_init(uint32_t idx, int is_shar= ed) ret =3D pthread_getaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset); if (ret) { - error(0, ret, "pthread_getaffinity_np()"); + warn("pthread_getaffinity_np()"); return ret; } pcfg.cpu =3D -1; @@ -60,7 +60,7 @@ static int fsl_bman_portal_init(uint32_t idx, int is_shar= ed) map.index =3D idx; ret =3D process_portal_map(&map); if (ret) { - error(0, ret, "process_portal_map()"); + warn("process_portal_map()"); return ret; } /* Make the portal's cache-[enabled|inhibited] regions */ @@ -105,7 +105,= 7 @@ static int fsl_bman_portal_finish(void) DPAA_BUG_ON(cfg !=3D &pcfg); ret =3D process_portal_unmap(&map.addr); if (ret) - error(0, ret, "process_portal_unmap()"); + warn("process_portal_unmap()"); return ret; } =20 diff --git a/drivers/bus/dpaa/base/qbman/qman_driver.c b/drivers/bus/dpaa/b= ase/qbman/qman_driver.c index ba153396d..163a66b30 100644 --- a/drivers/bus/dpaa/base/qbman/qman_driver.c +++ b/drivers/bus/dpaa/base/qbman/qman_driver.c @@ -41,7 +41,7 @@ static int fsl_qman_portal_init(uint32_t index, int is_sh= ared) ret =3D pthread_getaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset); if (ret) { - error(0, ret, "pthread_getaffinity_np()"); + warn("pthread_getaffinity_np()"); return ret; } qpcfg.cpu =3D -1; @@ -62,7 +62,7 @@ static int fsl_qman_portal_init(uint32_t index, int is_sh= ared) map.index =3D index; ret =3D process_portal_map(&map); if (ret) { - error(0, ret, "process_portal_map()"); + warn("process_portal_map()"); return ret; } qpcfg.channel =3D map.channel; @@ -109,7 +109,7 @@ static int fsl_qman_portal_finish(void) DPAA_BUG_ON(cfg !=3D &qpcfg); ret =3D process_portal_unmap(&map.addr); if (ret) - error(0, ret, "process_portal_unmap()"); + warn("process_portal_unmap()"); return ret; } =20 @@ -156,7 +156,7 @@ struct qman_portal *fsl_qman_portal_create(void) =20 q_pcfg =3D kzalloc((sizeof(struct qm_portal_config)), 0); if (!q_pcfg) { - error(0, -1, "q_pcfg kzalloc failed"); + warn("q_pcfg kzalloc failed"); return NULL; } =20 @@ -164,7 +164,7 @@ struct qman_portal *fsl_qman_portal_create(void) ret =3D pthread_getaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset); if (ret) { - error(0, ret, "pthread_getaffinity_np()"); + warn("pthread_getaffinity_np()"); kfree(q_pcfg); return NULL; } @@ -190,7 +190,7 @@ struct qman_portal *fsl_qman_portal_create(void) q_map.index =3D QBMAN_ANY_PORTAL_IDX; ret =3D process_portal_map(&q_map); if (ret) { - error(0, ret, "process_portal_map()"); + warn("process_portal_map()"); kfree(q_pcfg); return NULL; } diff --git a/drivers/bus/dpaa/include/compat.h b/drivers/bus/dpaa/include/c= ompat.h index 412265779..0c01c5514 100644 --- a/drivers/bus/dpaa/include/compat.h +++ b/drivers/bus/dpaa/include/compat.h @@ -33,7 +33,7 @@ #include #include #include -#include +#include #include #include #include -- 2.21.0