@@ -8,7 +8,7 @@
#include <dpaa_of.h>
#include <net/if.h>
#include <sys/ioctl.h>
-#include <error.h>
+#include <err.h>
#include <net/if_arp.h>
#include <assert.h>
#include <unistd.h>
@@ -90,7 +90,7 @@ netcfg_acquire(void)
*/
skfd = 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;
}
@@ -11,6 +11,7 @@
#include <process.h>
#include "bman_priv.h"
#include <sys/ioctl.h>
+#include <err.h>
/*
* Global variables of the max portal/pool number this bman version supported
@@ -40,7 +41,8 @@ static int fsl_bman_portal_init(uint32_t idx, int is_shared)
ret = pthread_getaffinity_np(pthread_self(), sizeof(cpu_set_t),
&cpuset);
if (ret) {
- error(0, ret, "pthread_getaffinity_np()");
+ errno = ret;
+ warn("pthread_getaffinity_np()");
return ret;
}
pcfg.cpu = -1;
@@ -60,7 +62,8 @@ static int fsl_bman_portal_init(uint32_t idx, int is_shared)
map.index = idx;
ret = process_portal_map(&map);
if (ret) {
- error(0, ret, "process_portal_map()");
+ errno = ret;
+ warn("process_portal_map()");
return ret;
}
/* Make the portal's cache-[enabled|inhibited] regions */
@@ -104,8 +107,10 @@ static int fsl_bman_portal_finish(void)
cfg = bman_destroy_affine_portal();
DPAA_BUG_ON(cfg != &pcfg);
ret = process_portal_unmap(&map.addr);
- if (ret)
- error(0, ret, "process_portal_unmap()");
+ if (ret) {
+ errno = ret;
+ warn("process_portal_unmap()");
+ }
return ret;
}
@@ -9,6 +9,8 @@
#include <process.h>
#include "qman_priv.h"
#include <sys/ioctl.h>
+#include <err.h>
+
#include <rte_branch_prediction.h>
/* Global variable containing revision id (even on non-control plane systems
@@ -50,7 +52,8 @@ static int fsl_qman_portal_init(uint32_t index, int is_shared)
map.index = index;
ret = process_portal_map(&map);
if (ret) {
- error(0, ret, "process_portal_map()");
+ errno = ret;
+ warn("process_portal_map()");
return ret;
}
qpcfg.channel = map.channel;
@@ -96,8 +99,10 @@ static int fsl_qman_portal_finish(void)
cfg = qman_destroy_affine_portal(NULL);
DPAA_BUG_ON(cfg != &qpcfg);
ret = process_portal_unmap(&map.addr);
- if (ret)
- error(0, ret, "process_portal_unmap()");
+ if (ret) {
+ errno = ret;
+ warn("process_portal_unmap()");
+ }
return ret;
}
@@ -146,7 +151,8 @@ struct qman_portal *fsl_qman_fq_portal_create(int *fd)
q_pcfg = kzalloc((sizeof(struct qm_portal_config)), 0);
if (!q_pcfg) {
- error(0, -1, "q_pcfg kzalloc failed");
+ /* kzalloc sets errno */
+ warn("q_pcfg kzalloc failed");
return NULL;
}
@@ -155,7 +161,8 @@ struct qman_portal *fsl_qman_fq_portal_create(int *fd)
q_map.index = QBMAN_ANY_PORTAL_IDX;
ret = process_portal_map(&q_map);
if (ret) {
- error(0, ret, "process_portal_map()");
+ errno = ret;
+ warn("process_portal_map()");
kfree(q_pcfg);
return NULL;
}