diff options
author | Aleksander Morgado <aleksander@aleksander.es> | 2018-09-12 15:45:49 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2018-09-17 09:50:41 +0200 |
commit | e42a40dcae5fbb62ae92443a27a1ad62a5493f24 (patch) | |
tree | f037f19d7adbd4a6596081e987892f87ca280f07 /common/ratp/mw.c | |
parent | 51c2a0a8d4513b8ea3b852dfc7915098265f370e (diff) | |
download | barebox-e42a40dcae5fbb62ae92443a27a1ad62a5493f24.tar.gz barebox-e42a40dcae5fbb62ae92443a27a1ad62a5493f24.tar.xz |
ratp: use pr_ macros to print messages
Following suggestions in other patch reviews, the RAPT commands are
updated to use pr_err() instead of plain printf() to report errors
to the user.
Signed-off-by: Aleksander Morgado <aleksander@aleksander.es>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'common/ratp/mw.c')
-rw-r--r-- | common/ratp/mw.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/common/ratp/mw.c b/common/ratp/mw.c index 3234d7dacb..0579da3c16 100644 --- a/common/ratp/mw.c +++ b/common/ratp/mw.c @@ -16,6 +16,8 @@ * */ +#define pr_fmt(fmt) "barebox-ratp: mw: " fmt + #include <common.h> #include <ratp_bb.h> #include <init.h> @@ -77,7 +79,7 @@ static int ratp_cmd_mw(const struct ratp_bb *req, int req_len, /* At least message header should be valid */ if (req_len < sizeof(*mw_req)) { - printf("ratp mw ignored: size mismatch (%d < %zu)\n", + pr_err("ignored: size mismatch (%d < %zu)\n", req_len, sizeof (*mw_req)); ret = -EINVAL; goto out; @@ -86,7 +88,7 @@ static int ratp_cmd_mw(const struct ratp_bb *req, int req_len, /* Validate buffer position and size */ buffer_offset = be16_to_cpu(mw_req->buffer_offset); if (req_len < buffer_offset) { - printf("ratp mw ignored: invalid buffer offset (%d < %hu)\n", + pr_err("ignored: invalid buffer offset (%d < %hu)\n", req_len, buffer_offset); ret = -EINVAL; goto out; @@ -97,13 +99,13 @@ static int ratp_cmd_mw(const struct ratp_bb *req, int req_len, /* Validate path position and size */ path_offset = be16_to_cpu(mw_req->path_offset); if (path_offset != 0) { - printf("ratp mw ignored: invalid path offset\n"); + pr_err("ignored: invalid path offset\n"); ret = -EINVAL; goto out; } path_size = be16_to_cpu(mw_req->path_size); if (!path_size) { - printf("ratp mw ignored: no filepath given\n"); + pr_err("ignored: no filepath given\n"); ret = -EINVAL; goto out; } @@ -111,7 +113,7 @@ static int ratp_cmd_mw(const struct ratp_bb *req, int req_len, /* Validate data position and size */ data_offset = be16_to_cpu(mw_req->data_offset); if (data_offset != (path_offset + path_size)) { - printf("ratp mw ignored: invalid path offset\n"); + pr_err("ignored: invalid path offset\n"); ret = -EINVAL; goto out; } @@ -123,7 +125,7 @@ static int ratp_cmd_mw(const struct ratp_bb *req, int req_len, /* Validate buffer size */ if (buffer_size < (path_size + data_size)) { - printf("ratp mw ignored: size mismatch (%d < %hu): path or data not be fully given\n", + pr_err("ignored: size mismatch (%d < %hu): path or data not be fully given\n", req_len, path_size + data_size); ret = -EINVAL; goto out; |