summaryrefslogtreecommitdiff
path: root/mtd_debug.c
diff options
context:
space:
mode:
authorBrian Norris <computersforpeace@gmail.com>2011-08-19 10:07:49 -0700
committerArtem Bityutskiy <artem.bityutskiy@intel.com>2011-08-23 09:27:48 +0300
commit988ecf93887b54f225f0f29235f3b32f92b1ea31 (patch)
tree7bf654a8744b07f250c0c894f495260e02301ac0 /mtd_debug.c
parentf5518639f329bbb88ace9b301bd77d22d2c179c5 (diff)
mtd-utils: use __func__ instead of __FUNCTION__
__func__ is more portable Signed-off-by: Brian Norris <computersforpeace@gmail.com> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
Diffstat (limited to 'mtd_debug.c')
-rw-r--r--mtd_debug.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/mtd_debug.c b/mtd_debug.c
index b98de50..2d307a9 100644
--- a/mtd_debug.c
+++ b/mtd_debug.c
@@ -123,10 +123,10 @@ int flash_to_file(int fd, u_int32_t offset, size_t len, const char *filename)
retry:
if ((buf = (u_int8_t *) malloc(size)) == NULL) {
#define BUF_SIZE (64 * 1024 * sizeof(u_int8_t))
- fprintf(stderr, "%s: malloc(%#x)\n", __FUNCTION__, size);
+ fprintf(stderr, "%s: malloc(%#x)\n", __func__, size);
if (size != BUF_SIZE) {
size = BUF_SIZE;
- fprintf(stderr, "%s: trying buffer size %#x\n", __FUNCTION__, size);
+ fprintf(stderr, "%s: trying buffer size %#x\n", __func__, size);
goto retry;
}
perror("malloc()");
@@ -137,13 +137,13 @@ retry:
size = n;
err = read(fd, buf, size);
if (err < 0) {
- fprintf(stderr, "%s: read, size %#x, n %#x\n", __FUNCTION__, size, n);
+ fprintf(stderr, "%s: read, size %#x, n %#x\n", __func__, size, n);
perror("read()");
goto err2;
}
err = write(outfd, buf, size);
if (err < 0) {
- fprintf(stderr, "%s: write, size %#x, n %#x\n", __FUNCTION__, size, n);
+ fprintf(stderr, "%s: write, size %#x, n %#x\n", __func__, size, n);
perror("write()");
goto err2;
}
@@ -187,10 +187,10 @@ int file_to_flash(int fd, u_int32_t offset, u_int32_t len, const char *filename)
}
retry:
if ((buf = (u_int8_t *) malloc(size)) == NULL) {
- fprintf(stderr, "%s: malloc(%#x) failed\n", __FUNCTION__, size);
+ fprintf(stderr, "%s: malloc(%#x) failed\n", __func__, size);
if (size != BUF_SIZE) {
size = BUF_SIZE;
- fprintf(stderr, "%s: trying buffer size %#x\n", __FUNCTION__, size);
+ fprintf(stderr, "%s: trying buffer size %#x\n", __func__, size);
goto retry;
}
perror("malloc()");
@@ -201,7 +201,7 @@ retry:
if (n <= size)
size = n;
if (fread(buf, size, 1, fp) != 1 || ferror(fp)) {
- fprintf(stderr, "%s: fread, size %#x, n %#x\n", __FUNCTION__, size, n);
+ fprintf(stderr, "%s: fread, size %#x, n %#x\n", __func__, size, n);
perror("fread()");
free(buf);
fclose(fp);
@@ -209,7 +209,7 @@ retry:
}
err = write(fd, buf, size);
if (err < 0) {
- fprintf(stderr, "%s: write, size %#x, n %#x\n", __FUNCTION__, size, n);
+ fprintf(stderr, "%s: write, size %#x, n %#x\n", __func__, size, n);
perror("write()");
free(buf);
fclose(fp);