summaryrefslogtreecommitdiff
path: root/misc-utils/mtd_debug.c
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2017-06-22 13:37:40 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2017-06-28 10:27:31 +0200
commitca517e8b320c7a31c3a147fb1212ddb33cabd919 (patch)
treea26d535836a82ea241dc0389b061176ddfcd8329 /misc-utils/mtd_debug.c
parent3029b659e89caa79b6860c3bbe8cbc18b53af678 (diff)
Eliminate warnings about missing prototypes
This patch eliminates warnings generated by the -Wmissing-prototypes option. With this flag set, we are now forced to have prototypes for all global, exported functions, that have to be made visible to the definitions and we are forced to mark all local functions as static. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'misc-utils/mtd_debug.c')
-rw-r--r--misc-utils/mtd_debug.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/misc-utils/mtd_debug.c b/misc-utils/mtd_debug.c
index f3826cf..90f5d52 100644
--- a/misc-utils/mtd_debug.c
+++ b/misc-utils/mtd_debug.c
@@ -76,7 +76,7 @@ static int getregions(int fd, struct region_info_user *regions, int *n)
return 0;
}
-int erase_flash(int fd, u_int32_t offset, u_int32_t bytes)
+static int erase_flash(int fd, u_int32_t offset, u_int32_t bytes)
{
int err;
struct erase_info_user erase;
@@ -91,7 +91,7 @@ int erase_flash(int fd, u_int32_t offset, u_int32_t bytes)
return 0;
}
-void printsize(u_int32_t x)
+static void printsize(u_int32_t x)
{
int i;
static const char *flags = "KMGT";
@@ -103,7 +103,7 @@ void printsize(u_int32_t x)
printf("(%u%c)", x, flags[i]);
}
-int flash_to_file(int fd, off_t offset, size_t len, const char *filename)
+static int flash_to_file(int fd, off_t offset, size_t len, const char *filename)
{
u_int8_t *buf = NULL;
int outfd, err;
@@ -172,7 +172,8 @@ err0:
return 1;
}
-int file_to_flash(int fd, off_t offset, u_int32_t len, const char *filename)
+static int file_to_flash(int fd, off_t offset, u_int32_t len,
+ const char *filename)
{
u_int8_t *buf = NULL;
FILE *fp;
@@ -228,7 +229,7 @@ retry:
return 0;
}
-int showinfo(int fd)
+static int showinfo(int fd)
{
int i, err, n;
struct mtd_info_user mtd;
@@ -338,7 +339,7 @@ int showinfo(int fd)
return 0;
}
-void showusage(void)
+static void showusage(void)
{
fprintf(stderr, "usage: %1$s info <device>\n"
" %1$s read <device> <offset> <len> <dest-filename>\n"