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 8C8BE5398 for ; Mon, 11 Mar 2019 18:37:40 +0100 (CET) Received: from mx1.tetrasec.net (mail.local [127.0.0.1]) by mx1.tetrasec.net (Postfix) with ESMTP id EF8759E1F68; Mon, 11 Mar 2019 17:37:39 +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 302599E1F6A; Mon, 11 Mar 2019 17:37:38 +0000 (UTC) From: Natanael Copa To: dev@dpdk.org Cc: Natanael Copa Date: Mon, 11 Mar 2019 18:36:57 +0100 Message-Id: <20190311173702.24471-11-ncopa@alpinelinux.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190311173702.24471-1-ncopa@alpinelinux.org> References: <20190311173702.24471-1-ncopa@alpinelinux.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Subject: [dpdk-dev] [PATCH 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: Mon, 11 Mar 2019 17:37:40 -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 --- Note that err.h is not in POSIX standard either, but is implemented in mu= sl libc. 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