Standardize on using __func__ instead of __FUNCTION__
The __func__ variant is standardized in C99 and recommended to be
used instead of __FUNCTION__ in the gcc info page.
Only _very_ old versions of gcc did not know about __func__, but we've
been using both __func__ and __FUNCTION__ for a long while now, and
nobody complained about this, so all our users seem to use recent
enough compilers.
Corresponding to flashrom svn r711.
Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de>
Acked-by: Stefan Reinauer <stepan@coresystems.de>
diff --git a/82802ab.c b/82802ab.c
index 28fa177..8aa189d 100644
--- a/82802ab.c
+++ b/82802ab.c
@@ -68,7 +68,7 @@
programmer_delay(10);
- printf_debug("%s: id1 0x%02x, id2 0x%02x\n", __FUNCTION__, id1, id2);
+ printf_debug("%s: id1 0x%02x, id2 0x%02x\n", __func__, id1, id2);
if (id1 != flash->manufacture_id || id2 != flash->model_id)
return 0;
diff --git a/am29f040b.c b/am29f040b.c
index 7f1269c..cde4b96 100644
--- a/am29f040b.c
+++ b/am29f040b.c
@@ -84,7 +84,7 @@
programmer_delay(10);
- printf_debug("%s: id1 0x%02x, id2 0x%02x\n", __FUNCTION__, id1, id2);
+ printf_debug("%s: id1 0x%02x, id2 0x%02x\n", __func__, id1, id2);
if (id1 == flash->manufacture_id && id2 == flash->model_id)
return 1;
diff --git a/en29f002a.c b/en29f002a.c
index b89eb31..14fccab 100644
--- a/en29f002a.c
+++ b/en29f002a.c
@@ -47,7 +47,7 @@
chip_writeb(0x55, bios + 0x2AA);
chip_writeb(0xF0, bios + 0x555);
- printf_debug("%s: id1 0x%02x, id2 0x%02x\n", __FUNCTION__, id1, id2);
+ printf_debug("%s: id1 0x%02x, id2 0x%02x\n", __func__, id1, id2);
if (id1 == flash->manufacture_id && id2 == flash->model_id)
return 1;
@@ -80,7 +80,7 @@
chip_writeb(0x55, bios + 0xAAA);
chip_writeb(0xF0, bios + 0x555);
- printf_debug("%s: id1 0x%x, id2 0x%x\n", __FUNCTION__, id1, id2);
+ printf_debug("%s: id1 0x%x, id2 0x%x\n", __func__, id1, id2);
if (id1 == flash->manufacture_id && id2 == flash->model_id)
return 1;
diff --git a/ft2232_spi.c b/ft2232_spi.c
index 00490fe..9bf1af3 100644
--- a/ft2232_spi.c
+++ b/ft2232_spi.c
@@ -285,7 +285,7 @@
l = total_size - i;
if ((r = spi_nbyte_program(i, &buf[i], l))) {
- fprintf(stderr, "%s: write fail %d\n", __FUNCTION__, r);
+ fprintf(stderr, "%s: write fail %d\n", __func__, r);
return 1;
}
diff --git a/ichspi.c b/ichspi.c
index 831dd9d..017040c 100644
--- a/ichspi.c
+++ b/ichspi.c
@@ -216,7 +216,7 @@
uint32_t opmenu[2];
if (op == NULL) {
- printf_debug("\n%s: null OPCODES pointer!\n", __FUNCTION__);
+ printf_debug("\n%s: null OPCODES pointer!\n", __func__);
return -1;
}
@@ -235,7 +235,7 @@
opmenu[1] = REGREAD32(ICH9_REG_OPMENU + 4);
break;
default:
- printf_debug("%s: unsupported chipset\n", __FUNCTION__);
+ printf_debug("%s: unsupported chipset\n", __func__);
return -1;
}
@@ -317,7 +317,7 @@
REGWRITE32(ICH9_REG_OPMENU + 4, opmenu[1]);
break;
default:
- printf_debug("%s: unsupported chipset\n", __FUNCTION__);
+ printf_debug("%s: unsupported chipset\n", __func__);
return -1;
}
@@ -610,7 +610,7 @@
return SPI_INVALID_LENGTH;
return ich9_run_opcode(op, offset, datalength, data);
default:
- printf_debug("%s: unsupported chipset\n", __FUNCTION__);
+ printf_debug("%s: unsupported chipset\n", __func__);
}
/* If we ever get here, something really weird happened */
diff --git a/it87spi.c b/it87spi.c
index 299725c..d58f837 100644
--- a/it87spi.c
+++ b/it87spi.c
@@ -168,7 +168,7 @@
} while (busy);
if (readcnt > 3) {
printf("%s called with unsupported readcnt %i.\n",
- __FUNCTION__, readcnt);
+ __func__, readcnt);
return SPI_INVALID_LENGTH;
}
switch (writecnt) {
@@ -198,7 +198,7 @@
break;
default:
printf("%s called with unsupported writecnt %i.\n",
- __FUNCTION__, writecnt);
+ __func__, writecnt);
return SPI_INVALID_LENGTH;
}
/*
diff --git a/jedec.c b/jedec.c
index 0e426d6..d51f122 100644
--- a/jedec.c
+++ b/jedec.c
@@ -145,7 +145,7 @@
chip_writeb(0xF0, bios + 0x5555);
programmer_delay(probe_timing_exit);
- printf_debug("%s: id1 0x%02x, id2 0x%02x", __FUNCTION__, largeid1, largeid2);
+ printf_debug("%s: id1 0x%02x, id2 0x%02x", __func__, largeid1, largeid2);
if (!oddparity(id1))
printf_debug(", id1 parity violation");
diff --git a/m29f400bt.c b/m29f400bt.c
index ace6dae..28e5da4 100644
--- a/m29f400bt.c
+++ b/m29f400bt.c
@@ -75,7 +75,7 @@
programmer_delay(10);
- printf_debug("%s: id1 0x%02x, id2 0x%02x\n", __FUNCTION__, id1, id2);
+ printf_debug("%s: id1 0x%02x, id2 0x%02x\n", __func__, id1, id2);
if (id1 == flash->manufacture_id && id2 == flash->model_id)
return 1;
diff --git a/mx29f002.c b/mx29f002.c
index d5c6041..f170360 100644
--- a/mx29f002.c
+++ b/mx29f002.c
@@ -36,7 +36,7 @@
programmer_delay(10);
- printf_debug("%s: id1 0x%02x, id2 0x%02x\n", __FUNCTION__, id1, id2);
+ printf_debug("%s: id1 0x%02x, id2 0x%02x\n", __func__, id1, id2);
if (id1 == flash->manufacture_id && id2 == flash->model_id)
return 1;
diff --git a/sharplhf00l04.c b/sharplhf00l04.c
index 53b9931..03bb2ce 100644
--- a/sharplhf00l04.c
+++ b/sharplhf00l04.c
@@ -60,7 +60,7 @@
programmer_delay(10);
- printf_debug("%s: id1 0x%02x, id2 0x%02x\n", __FUNCTION__, id1, id2);
+ printf_debug("%s: id1 0x%02x, id2 0x%02x\n", __func__, id1, id2);
if (id1 != flash->manufacture_id || id2 != flash->model_id)
return 0;
diff --git a/spi.c b/spi.c
index 7f678a1..7a17b24 100644
--- a/spi.c
+++ b/spi.c
@@ -264,7 +264,7 @@
id2 = (readarr[1] << 8) | readarr[2];
}
- printf_debug("%s: id1 0x%02x, id2 0x%02x\n", __FUNCTION__, id1, id2);
+ printf_debug("%s: id1 0x%02x, id2 0x%02x\n", __func__, id1, id2);
if (id1 == flash->manufacture_id && id2 == flash->model_id) {
/* Print the status register to tell the
@@ -321,7 +321,7 @@
id1 = readarr[0];
id2 = readarr[1];
- printf_debug("%s: id1 0x%x, id2 0x%x\n", __FUNCTION__, id1, id2);
+ printf_debug("%s: id1 0x%x, id2 0x%x\n", __func__, id1, id2);
if (id1 == flash->manufacture_id && id2 == flash->model_id) {
/* Print the status register to tell the
@@ -356,7 +356,7 @@
return 0;
id2 = readarr[0];
- printf_debug("%s: id 0x%x\n", __FUNCTION__, id2);
+ printf_debug("%s: id 0x%x\n", __func__, id2);
if (id2 != flash->model_id)
return 0;
diff --git a/sst28sf040.c b/sst28sf040.c
index 35f8c27..d3d7bdb 100644
--- a/sst28sf040.c
+++ b/sst28sf040.c
@@ -111,7 +111,7 @@
chip_writeb(RESET, bios);
programmer_delay(10);
- printf_debug("%s: id1 0x%02x, id2 0x%02x\n", __FUNCTION__, id1, id2);
+ printf_debug("%s: id1 0x%02x, id2 0x%02x\n", __func__, id1, id2);
if (id1 == flash->manufacture_id && id2 == flash->model_id)
return 1;
diff --git a/sst49lfxxxc.c b/sst49lfxxxc.c
index 848ccde..a421acf 100644
--- a/sst49lfxxxc.c
+++ b/sst49lfxxxc.c
@@ -141,7 +141,7 @@
chip_writeb(RESET, bios);
- printf_debug("%s: id1 0x%02x, id2 0x%02x\n", __FUNCTION__, id1, id2);
+ printf_debug("%s: id1 0x%02x, id2 0x%02x\n", __func__, id1, id2);
if (!(id1 == flash->manufacture_id && id2 == flash->model_id))
return 0;
diff --git a/stm50flw0x0x.c b/stm50flw0x0x.c
index 30b7d50..3a90d6b 100644
--- a/stm50flw0x0x.c
+++ b/stm50flw0x0x.c
@@ -80,7 +80,7 @@
chip_writeb(0xF0, bios + 0x5555);
programmer_delay(40);
- printf_debug("%s: id1 0x%02x, id2 0x%02x\n", __FUNCTION__, largeid1,
+ printf_debug("%s: id1 0x%02x, id2 0x%02x\n", __func__, largeid1,
largeid2);
if (largeid1 != flash->manufacture_id || largeid2 != flash->model_id)
diff --git a/w29ee011.c b/w29ee011.c
index a26cd80..de9a547 100644
--- a/w29ee011.c
+++ b/w29ee011.c
@@ -61,7 +61,7 @@
chip_writeb(0xF0, bios + 0x5555);
programmer_delay(10);
- printf_debug("%s: id1 0x%02x, id2 0x%02x\n", __FUNCTION__, id1, id2);
+ printf_debug("%s: id1 0x%02x, id2 0x%02x\n", __func__, id1, id2);
if (id1 == flash->manufacture_id && id2 == flash->model_id)
return 1;
diff --git a/w39v080fa.c b/w39v080fa.c
index 31ef15f..96e83a8 100644
--- a/w39v080fa.c
+++ b/w39v080fa.c
@@ -41,7 +41,7 @@
chip_writeb(0xF0, bios + 0x5555);
programmer_delay(10);
- printf_debug("%s: id1 0x%x, id2 0x%x\n", __FUNCTION__, id1, id2);
+ printf_debug("%s: id1 0x%x, id2 0x%x\n", __func__, id1, id2);
if (id1 != flash->manufacture_id || id2 != flash->model_id)
return 0;