From: Kerim Gueney <gueneykerim@gmail.com>
To: linux-kernel@vger.kernel.org
Date: Sun, 11 May 2014 00:08:15 +0200 [thread overview]
Message-ID: <20140510220815.GA24329@HAF> (raw)
>From fcea4cf1bfac7cd2ae6398bbc15a7d543b238bb1 Mon Sep 17 00:00:00 2001
From: Kerim Gueney <gueneykerim@gmail.com>
Date: Sat, 10 May 2014 23:02:24 +0200
Subject: [PATCH] firmware: Coding style issue
Janitorial cleanup of 11 or so (coding style) errors
---
firmware/ihex2fw.c | 38 +++++++++++++++++++++-----------------
1 file changed, 21 insertions(+), 17 deletions(-)
diff --git a/firmware/ihex2fw.c b/firmware/ihex2fw.c
index cf38e15..e6f8bb4 100644
--- a/firmware/ihex2fw.c
+++ b/firmware/ihex2fw.c
@@ -26,9 +26,9 @@
struct ihex_binrec {
struct ihex_binrec *next; /* not part of the real data structure */
- uint32_t addr;
- uint16_t len;
- uint8_t data[];
+ uint32_t addr;
+ uint16_t len;
+ uint8_t data[];
};
/**
@@ -36,31 +36,33 @@ struct ihex_binrec {
**/
static uint8_t nybble(const uint8_t n)
{
- if (n >= '0' && n <= '9') return n - '0';
- else if (n >= 'A' && n <= 'F') return n - ('A' - 10);
- else if (n >= 'a' && n <= 'f') return n - ('a' - 10);
- return 0;
+ if (n >= '0' && n <= '9')
+ return n - '0';
+ else if (n >= 'A' && n <= 'F')
+ return n - ('A' - 10);
+ else if (n >= 'a' && n <= 'f')
+ return n - ('a' - 10);
+ return 0;
}
static uint8_t hex(const uint8_t *data, uint8_t *crc)
{
- uint8_t val = (nybble(data[0]) << 4) | nybble(data[1]);
- *crc += val;
- return val;
+ uint8_t val = (nybble(data[0]) << 4) | nybble(data[1]);
+ *crc += val;
+ return val;
}
static int process_ihex(uint8_t *data, ssize_t size);
static void file_record(struct ihex_binrec *record);
static int output_records(int outfd);
-static int sort_records = 0;
-static int wide_records = 0;
-static int include_jump = 0;
+static int sort_records;
+static int wide_records;
+static int include_jump;
static int usage(void)
{
- fprintf(stderr, "ihex2fw: Convert ihex files into binary "
- "representation for use by Linux kernel\n");
+ fprintf(stderr, "ihex2fw: Convert ihex files into binary representation for use by Linux kernel\n");
fprintf(stderr, "usage: ihex2fw [<options>] <src.HEX> <dst.fw>\n");
fprintf(stderr, " -w: wide records (16-bit length)\n");
fprintf(stderr, " -s: sort records by address\n");
@@ -141,8 +143,10 @@ static int process_ihex(uint8_t *data, ssize_t size)
next_record:
/* search for the start of record character */
while (i < size) {
- if (data[i] == '\n') line++;
- if (data[i++] == ':') break;
+ if (data[i] == '\n')
+ line++;
+ if (data[i++] == ':')
+ break;
}
/* Minimum record length would be about 10 characters */
--
1.9.1
reply other threads:[~2014-05-10 22:08 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20140510220815.GA24329@HAF \
--to=gueneykerim@gmail.com \
--cc=linux-kernel@vger.kernel.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