summaryrefslogtreecommitdiffstats
path: root/flashrom.c
diff options
context:
space:
mode:
authorUwe Hermann <uwe@hermann-uwe.de>2008-10-18 21:14:13 +0000
committerUwe Hermann <uwe@hermann-uwe.de>2008-10-18 21:14:13 +0000
commit394131ef1447aa9019f9b03797955fb4fdda74bd (patch)
tree8be1ee454d786c1aae0ea45be068e22b2a7c70a5 /flashrom.c
parenta88daa731de1612641a9a8df2a63f5529ac7a6b1 (diff)
downloadast2050-flashrom-394131ef1447aa9019f9b03797955fb4fdda74bd.zip
ast2050-flashrom-394131ef1447aa9019f9b03797955fb4fdda74bd.tar.gz
Coding-style fixes for flashrom, partly indent-aided
Corresponding to flashrom svn r326 and coreboot v2 svn r3669. Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de> Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
Diffstat (limited to 'flashrom.c')
-rw-r--r--flashrom.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/flashrom.c b/flashrom.c
index 093f2ea..4f1b488 100644
--- a/flashrom.c
+++ b/flashrom.c
@@ -74,8 +74,10 @@ struct pci_dev *pci_card_find(uint16_t vendor, uint16_t device,
for (temp = pacc->devices; temp; temp = temp->next)
if (pci_filter_match(&filter, temp)) {
- if ((card_vendor == pci_read_word(temp, PCI_SUBSYSTEM_VENDOR_ID)) &&
- (card_device == pci_read_word(temp, PCI_SUBSYSTEM_ID)))
+ if ((card_vendor ==
+ pci_read_word(temp, PCI_SUBSYSTEM_VENDOR_ID))
+ && (card_device ==
+ pci_read_word(temp, PCI_SUBSYSTEM_ID)))
return temp;
}
@@ -131,7 +133,6 @@ struct flashchip *probe_flash(struct flashchip *first_flash, int force)
*/
size = getpagesize();
}
-
#ifdef TS5300
// FIXME: Wrong place for this decision
// FIXME: This should be autodetected. It is trivial.
@@ -154,7 +155,8 @@ struct flashchip *probe_flash(struct flashchip *first_flash, int force)
if (flash->probe(flash) != 1)
goto notfound;
- if (first_flash == flashchips || flash->model_id != GENERIC_DEVICE_ID)
+ if (first_flash == flashchips
+ || flash->model_id != GENERIC_DEVICE_ID)
break;
notfound:
@@ -193,7 +195,7 @@ int verify_flash(struct flashchip *flash, uint8_t *buf)
printf("0x%08x ", idx);
}
printf("FAILED! Expected=0x%02x, Read=0x%02x\n",
- *(buf + idx), *(buf2 + idx));
+ *(buf + idx), *(buf2 + idx));
return 1;
}
@@ -220,7 +222,8 @@ void print_supported_chips(void)
void usage(const char *name)
{
- printf("usage: %s [-rwvEVfLhR] [-c chipname] [-s exclude_start]\n", name);
+ printf("usage: %s [-rwvEVfLhR] [-c chipname] [-s exclude_start]\n",
+ name);
printf(" [-e exclude_end] [-m [vendor:]part] [-l file.layout] [-i imagename] [file]\n");
printf
(" -r | --read: read flash and save into file\n"
@@ -383,8 +386,7 @@ int main(int argc, char *argv[])
#else
if (iopl(3) != 0) {
#endif
- fprintf(stderr, "ERROR: Could not get IO privileges (%s).\nYou need to be root.\n",
- strerror(errno));
+ fprintf(stderr, "ERROR: Could not get IO privileges (%s).\nYou need to be root.\n", strerror(errno));
exit(1);
}
@@ -395,7 +397,7 @@ int main(int argc, char *argv[])
pci_scan_bus(pacc); /* We want to get the list of devices */
/* Open the memory device UNCACHED. That's important for MMIO. */
- if ((fd_mem = open(MEM_DEV, O_RDWR|O_SYNC)) < 0) {
+ if ((fd_mem = open(MEM_DEV, O_RDWR | O_SYNC)) < 0) {
perror("Error: Can not access memory using " MEM_DEV
". You need to be root.");
exit(1);
@@ -420,7 +422,8 @@ int main(int argc, char *argv[])
board_flash_enable(lb_vendor, lb_part);
for (i = 0; i < ARRAY_SIZE(flashes); i++) {
- flashes[i] = probe_flash(i ? flashes[i - 1] + 1 : flashchips, 0);
+ flashes[i] =
+ probe_flash(i ? flashes[i - 1] + 1 : flashchips, 0);
if (!flashes[i])
for (i++; i < ARRAY_SIZE(flashes); i++)
flashes[i] = NULL;
@@ -468,7 +471,8 @@ int main(int argc, char *argv[])
if (exclude_end_position - exclude_start_position > 0)
memset(buf + exclude_start_position, 0,
- exclude_end_position - exclude_start_position);
+ exclude_end_position -
+ exclude_start_position);
fwrite(buf, sizeof(char), size, image);
fclose(image);
OpenPOWER on IntegriCloud