From 689c244389798ef7fc041693831ae114b3063d36 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=98yvind=20Harboe?= Date: Tue, 15 Mar 2011 09:39:20 +0100 Subject: [PATCH] zy1000: reduce memory usage for fw upgrade fn MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Øyvind Harboe --- src/jtag/zy1000/zy1000.c | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/src/jtag/zy1000/zy1000.c b/src/jtag/zy1000/zy1000.c index 69fa4dc8..3344e0ee 100644 --- a/src/jtag/zy1000/zy1000.c +++ b/src/jtag/zy1000/zy1000.c @@ -438,24 +438,10 @@ struct cyg_upgrade_info firmware_info = report_info, }; +// File written to /ram/firmware.phi before arriving at this fn static int jim_zy1000_writefirmware(Jim_Interp *interp, int argc, Jim_Obj *const *argv) { - if (argc != 2) - return JIM_ERR; - - int length; - const char *str = Jim_GetString(argv[1], &length); - - /* */ - int tmpFile; - if ((tmpFile = open(firmware_info.file, O_RDWR | O_CREAT | O_TRUNC)) <= 0) - { - return JIM_ERR; - } - bool success; - success = write(tmpFile, str, length) == length; - close(tmpFile); - if (!success) + if (argc != 1) return JIM_ERR; if (!cyg_firmware_upgrade(NULL, firmware_info)) -- 2.39.5