From: Aleksander Morgado <aleksander@aleksander.es>
To: barebox@lists.infradead.org
Cc: andrew.smirnov@gmail.com, Aleksander Morgado <aleksander@aleksander.es>
Subject: [PATCH v2 7/7] ratp: fix incorrect whitespaces in method calls
Date: Wed, 12 Sep 2018 15:45:50 +0200 [thread overview]
Message-ID: <20180912134550.3970-8-aleksander@aleksander.es> (raw)
In-Reply-To: <20180912134550.3970-1-aleksander@aleksander.es>
This is a simple coding style fix to avoid the whitespace before the
open-parenthesis in method calls.
Signed-off-by: Aleksander Morgado <aleksander@aleksander.es>
---
common/ratp/getenv.c | 12 ++++++------
common/ratp/md.c | 8 ++++----
common/ratp/mw.c | 6 +++---
common/ratp/reset.c | 4 ++--
4 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/common/ratp/getenv.c b/common/ratp/getenv.c
index b40963488..fdb4b0b28 100644
--- a/common/ratp/getenv.c
+++ b/common/ratp/getenv.c
@@ -27,20 +27,20 @@
static int ratp_cmd_getenv(const struct ratp_bb *req, int req_len,
struct ratp_bb **rsp, int *rsp_len)
{
- int dlen = req_len - sizeof (struct ratp_bb);
+ int dlen = req_len - sizeof(struct ratp_bb);
char *varname;
const char *value;
- varname = xstrndup ((const char *)req->data, dlen);
- value = getenv (varname);
- free (varname);
+ varname = xstrndup((const char *)req->data, dlen);
+ value = getenv(varname);
+ free(varname);
- dlen = strlen (value);
+ dlen = strlen(value);
*rsp_len = sizeof(struct ratp_bb) + dlen;
*rsp = xzalloc(*rsp_len);
(*rsp)->type = cpu_to_be16(BB_RATP_TYPE_GETENV_RETURN);
- memcpy ((*rsp)->data, value, dlen);
+ memcpy((*rsp)->data, value, dlen);
return 0;
}
diff --git a/common/ratp/md.c b/common/ratp/md.c
index 2e5a956cb..9ce7e99df 100644
--- a/common/ratp/md.c
+++ b/common/ratp/md.c
@@ -124,7 +124,7 @@ static int ratp_cmd_md(const struct ratp_bb *req, int req_len,
/* At least message header should be valid */
if (req_len < sizeof(*md_req)) {
pr_err("ignored: size mismatch (%d < %zu)\n",
- req_len, sizeof (*md_req));
+ req_len, sizeof(*md_req));
ret = -EINVAL;
goto out;
}
@@ -162,8 +162,8 @@ static int ratp_cmd_md(const struct ratp_bb *req, int req_len,
goto out;
}
- addr = be16_to_cpu (md_req->addr);
- size = be16_to_cpu (md_req->size);
+ addr = be16_to_cpu(md_req->addr);
+ size = be16_to_cpu(md_req->size);
path = xstrndup((const char *)&buffer[path_offset], path_size);
out:
@@ -193,7 +193,7 @@ out:
*rsp = (struct ratp_bb *)md_rsp;
*rsp_len = md_rsp_len;
- free (path);
+ free(path);
return ret;
}
diff --git a/common/ratp/mw.c b/common/ratp/mw.c
index 0579da3c1..55e79bbaf 100644
--- a/common/ratp/mw.c
+++ b/common/ratp/mw.c
@@ -80,7 +80,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)) {
pr_err("ignored: size mismatch (%d < %zu)\n",
- req_len, sizeof (*mw_req));
+ req_len, sizeof(*mw_req));
ret = -EINVAL;
goto out;
}
@@ -131,7 +131,7 @@ static int ratp_cmd_mw(const struct ratp_bb *req, int req_len,
goto out;
}
- addr = be16_to_cpu (mw_req->addr);
+ addr = be16_to_cpu(mw_req->addr);
path = xstrndup((const char *)&buffer[path_offset], path_size);
fd = open_and_lseek(path, O_RWSIZE_1 | O_WRONLY, addr);
@@ -164,7 +164,7 @@ out:
*rsp = (struct ratp_bb *)mw_rsp;
*rsp_len = sizeof(*mw_rsp);
- free (path);
+ free(path);
return ret;
}
diff --git a/common/ratp/reset.c b/common/ratp/reset.c
index 5439f344f..d0229d5d6 100644
--- a/common/ratp/reset.c
+++ b/common/ratp/reset.c
@@ -36,8 +36,8 @@ static int ratp_cmd_reset(const struct ratp_bb *req, int req_len,
{
struct ratp_bb_reset *reset_req = (struct ratp_bb_reset *)req;
- if (req_len < sizeof (*reset_req)) {
- pr_err("ignored: size mismatch (%d < %zu)\n", req_len, sizeof (*reset_req));
+ if (req_len < sizeof(*reset_req)) {
+ pr_err("ignored: size mismatch (%d < %zu)\n", req_len, sizeof(*reset_req));
return 2;
}
--
2.19.0
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2018-09-12 13:46 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-12 13:45 [PATCH v2 0/7] RATP i2c and GPIO support Aleksander Morgado
2018-09-12 13:45 ` [PATCH v2 1/7] ratp: implement i2c read/write support Aleksander Morgado
2018-09-12 13:45 ` [PATCH v2 2/7] bbremote: " Aleksander Morgado
2018-09-12 13:45 ` [PATCH v2 3/7] ratp: implement support for GPIO commands Aleksander Morgado
2018-09-12 13:45 ` [PATCH v2 4/7] bbremote: implement support for GPIO operations Aleksander Morgado
2018-09-12 13:45 ` [PATCH v2 5/7] ratp: use __packed instead of the full form Aleksander Morgado
2018-09-12 13:45 ` [PATCH v2 6/7] ratp: use pr_ macros to print messages Aleksander Morgado
2018-09-12 13:45 ` Aleksander Morgado [this message]
2018-09-17 7:50 ` [PATCH v2 0/7] RATP i2c and GPIO support Sascha Hauer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180912134550.3970-8-aleksander@aleksander.es \
--to=aleksander@aleksander.es \
--cc=andrew.smirnov@gmail.com \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox