summaryrefslogtreecommitdiff
path: root/util/bincfg
diff options
context:
space:
mode:
authorDenis 'GNUtoo' Carikli <GNUtoo@no-log.org>2018-01-12 05:24:23 +0100
committerNico Huber <nico.h@gmx.de>2018-01-18 13:49:12 +0000
commitf73914d1aa76e9d99fe8f815a955cf9acb1e8711 (patch)
treee9f2478d68516eddaa1014604a78fe0c8d43f9b4 /util/bincfg
parent780e931eed8937bd8e304449913f487fa1d056c5 (diff)
util/bincfg: Fix some whitespaces
Change-Id: I674a3f58a576948dc3c0cd32ef06b42ef13353ee Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@no-log.org> Reviewed-on: https://review.coreboot.org/23240 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Diffstat (limited to 'util/bincfg')
-rw-r--r--util/bincfg/bincfg.y28
1 files changed, 19 insertions, 9 deletions
diff --git a/util/bincfg/bincfg.y b/util/bincfg/bincfg.y
index 7a098cd258..28feb599b1 100644
--- a/util/bincfg/bincfg.y
+++ b/util/bincfg/bincfg.y
@@ -81,7 +81,8 @@ static unsigned char* value_to_bits (unsigned int v, unsigned int w)
static void append_field_to_blob (unsigned char b[], unsigned int w)
{
unsigned int i, j;
- binary->blb = (unsigned char *) realloc (binary->blb, binary->bloblen + w);
+ binary->blb = (unsigned char *) realloc (binary->blb,
+ binary->bloblen + w);
check_pointer(binary->blb);
for (j = 0, i = binary->bloblen; i < binary->bloblen + w; i++, j++) {
binary->blb[i] = VALID_BIT | (b[j] & 1);
@@ -98,7 +99,9 @@ static void set_bitfield(char *name, unsigned int value)
bf->value = value & 0xffffffff;
i = (1 << bf->width) - 1;
if (bf->width > 8 * sizeof (unsigned int)) {
- fprintf(stderr, "Overflow in bitfield, truncating bits to fit\n");
+ fprintf(stderr,
+ "Overflow in bitfield, truncating bits to"
+ " fit\n");
bf->value = value & i;
}
//fprintf(stderr, "Setting `%s` = %d\n", bf->name, bf->value);
@@ -144,7 +147,8 @@ static void create_new_bitfields(char *name, unsigned int n, unsigned int width)
struct field *putsym (char const *sym_name, unsigned int w)
{
if (getsym(sym_name)) {
- fprintf(stderr, "Cannot add duplicate named bitfield `%s`\n", sym_name);
+ fprintf(stderr, "Cannot add duplicate named bitfield `%s`\n",
+ sym_name);
return 0;
}
struct field *ptr = (struct field *) malloc (sizeof (struct field));
@@ -339,7 +343,8 @@ static void generate_binary(void)
struct field *ptr;
if (binary->bloblen % 8) {
- fprintf (stderr, "ERROR: Spec must be multiple of 8 bits wide\n");
+ fprintf (stderr,
+ "ERROR: Spec must be multiple of 8 bits wide\n");
exit (1);
}
@@ -404,7 +409,8 @@ input:
;
blob:
- '%' eof { generate_setter_bitfields(binary->actualblob); }
+ '%' eof { generate_setter_bitfields(
+ binary->actualblob); }
;
spec:
@@ -504,7 +510,8 @@ int main (int argc, char *argv[])
/* Open output and parse string - output to fp */
if ((fp = fopen(argv[3], "wb")) == NULL) {
- printf("Error: Could not open output file: %s\n",argv[3]);
+ printf("Error: Could not open output file: %s\n",
+ argv[3]);
exit(1);
}
ret = parse_string(parsestring);
@@ -520,20 +527,23 @@ int main (int argc, char *argv[])
/* Load Actual Binary */
if ((fp = fopen(argv[3], "rb")) == NULL) {
- printf("Error: Could not open binary file: %s\n",argv[3]);
+ printf("Error: Could not open binary file: %s\n",
+ argv[3]);
exit(1);
}
fseek(fp, 0, SEEK_END);
binary->lenactualblob = ftell(fp);
fseek(fp, 0, SEEK_SET);
- binary->actualblob = (unsigned char *) malloc (binary->lenactualblob);
+ binary->actualblob = (unsigned char *)malloc(
+ binary->lenactualblob);
check_pointer(binary->actualblob);
fread(binary->actualblob, 1, binary->lenactualblob, fp);
fclose(fp);
/* Open output and parse - output to fp */
if ((fp = fopen(argv[4], "w")) == NULL) {
- printf("Error: Could not open output file: %s\n",argv[4]);
+ printf("Error: Could not open output file: %s\n",
+ argv[4]);
exit(1);
}
ret = parse_string(parsestring);