diff mbox series

handlers: drop dead code from flash handler

Message ID 20181114153633.16061-1-sbabic@denx.de
State Accepted
Headers show
Series handlers: drop dead code from flash handler | expand

Commit Message

Stefano Babic Nov. 14, 2018, 3:36 p.m. UTC
Image filename was formatted into a buffer without usage.

Signed-off-by: Stefano Babic <sbabic@denx.de>
---
 handlers/flash_hamming1_handler.c | 9 ---------
 handlers/flash_handler.c          | 9 ---------
 2 files changed, 18 deletions(-)
diff mbox series

Patch

diff --git a/handlers/flash_hamming1_handler.c b/handlers/flash_hamming1_handler.c
index 302ed1f..c0ad8b7 100644
--- a/handlers/flash_hamming1_handler.c
+++ b/handlers/flash_hamming1_handler.c
@@ -279,16 +279,7 @@  out:
 static int install_flash_hamming_image(struct img_type *img,
 	void __attribute__ ((__unused__)) *data)
 {
-	char filename[64];
 	int mtdnum;
-	int n;
-	const char* TMPDIR = get_tmpdir();
-
-	n = snprintf(filename, sizeof(filename), "%s%s", TMPDIR, img->fname);
-	if (n < 0 || n >= sizeof(filename)) {
-		ERROR("Filename too long: %s", img->fname);
-		return -1;
-	}
 
 	if (strlen(img->path))
 		mtdnum = get_mtd_from_name(img->path);
diff --git a/handlers/flash_handler.c b/handlers/flash_handler.c
index f3b5bcc..a0dfe2b 100644
--- a/handlers/flash_handler.c
+++ b/handlers/flash_handler.c
@@ -325,16 +325,7 @@  static int flash_write_image(int mtdnum, struct img_type *img)
 static int install_flash_image(struct img_type *img,
 	void __attribute__ ((__unused__)) *data)
 {
-	char filename[64];
 	int mtdnum;
-	int n;
-	const char* TMPDIR = get_tmpdir();
-
-	n = snprintf(filename, sizeof(filename), "%s%s", TMPDIR, img->fname);
-	if (n < 0 || n >= sizeof(filename)) {
-		ERROR("Filename too long: %s", img->fname);
-		return -1;
-	}
 
 	if (strlen(img->path))
 		mtdnum = get_mtd_from_name(img->path);