From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.tetrasec.net (mx1.tetrasec.net [74.117.190.25]) by dpdk.org (Postfix) with ESMTP id 8CCE85589 for ; Wed, 13 Mar 2019 18:07:31 +0100 (CET) Received: from mx1.tetrasec.net (mail.local [127.0.0.1]) by mx1.tetrasec.net (Postfix) with ESMTP id 115B09E03AF; Wed, 13 Mar 2019 17:07:31 +0000 (UTC) Received: from ncopa-desktop.lan (67.63.200.37.customer.cdi.no [37.200.63.67]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: n@tanael.org) by mx1.tetrasec.net (Postfix) with ESMTPSA id 29A9C9E1D58; Wed, 13 Mar 2019 17:07:30 +0000 (UTC) From: Natanael Copa To: dev@dpdk.org Cc: Natanael Copa Date: Wed, 13 Mar 2019 18:06:52 +0100 Message-Id: <20190313170657.16688-11-ncopa@alpinelinux.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190313170657.16688-1-ncopa@alpinelinux.org> References: <20190313170657.16688-1-ncopa@alpinelinux.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Subject: [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: , X-List-Received-Date: Wed, 13 Mar 2019 17:07:32 -0000 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= /base/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= /base/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_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; } pcfg.cpu =3D -1; @@ -60,7 +60,7 @@ static int fsl_bman_portal_init(uint32_t idx, int is_sh= ared) 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= /base/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_= shared) 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_= shared) 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= /compat.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 --=20 2.21.0