nit: do not add \n at end of LOG_ERROR
authorEric Wetzel <thewetzel@gmail.com>
Wed, 5 Jan 2011 19:24:54 +0000 (14:24 -0500)
committerØyvind Harboe <oyvind.harboe@zylin.com>
Wed, 5 Jan 2011 20:46:12 +0000 (21:46 +0100)
Fixed in many other places, and submitted in response to Øyvind's invitation.

15 files changed:
src/flash/nand/davinci.c
src/flash/nand/nuc910.c
src/flash/nand/orion.c
src/flash/nand/s3c24xx.c
src/flash/nor/aduc702x.c
src/flash/nor/at91sam3.c
src/flash/nor/ecos.c
src/helper/ioutil.c
src/jtag/drivers/arm-jtag-ew.c
src/jtag/drivers/ft2232.c
src/jtag/drivers/jlink.c
src/jtag/drivers/rlink.c
src/jtag/drivers/usb_blaster.c
src/target/mips32_dmaacc.c
src/xsvf/xsvf.c

index af39dbf..b7fe66e 100644 (file)
@@ -263,7 +263,7 @@ static int davinci_write_page(struct nand_device *nand, uint32_t page,
 
        /* Always write both data and OOB ... we are not "raw" I/O! */
        if (!data) {
-               LOG_ERROR("Missing NAND data; try 'nand raw_access enable'\n");
+               LOG_ERROR("Missing NAND data; try 'nand raw_access enable'");
                return ERROR_NAND_OPERATION_FAILED;
        }
 
index e7e7855..7b598d2 100644 (file)
@@ -169,7 +169,7 @@ NAND_DEVICE_COMMAND_HANDLER(nuc910_nand_device_command)
 
        nuc910_nand = calloc(1, sizeof(struct nuc910_nand_controller));
        if (!nuc910_nand) {
-               LOG_ERROR("no memory for nand controller\n");
+               LOG_ERROR("no memory for nand controller");
                return ERROR_NAND_DEVICE_INVALID;
        }
 
index 00c9519..5b0c964 100644 (file)
@@ -121,13 +121,13 @@ NAND_DEVICE_COMMAND_HANDLER(orion_nand_device_command)
        uint8_t ale, cle;
 
        if (CMD_ARGC != 3) {
-               LOG_ERROR("arguments must be: <target_id> <NAND_address>\n");
+               LOG_ERROR("arguments must be: <target_id> <NAND_address>");
                return ERROR_NAND_DEVICE_INVALID;
        }
 
        hw = calloc(1, sizeof(*hw));
        if (!hw) {
-               LOG_ERROR("no memory for nand controller\n");
+               LOG_ERROR("no memory for nand controller");
                return ERROR_NAND_DEVICE_INVALID;
        }
 
index eb20f35..2fa18de 100644 (file)
@@ -38,7 +38,7 @@ S3C24XX_DEVICE_COMMAND()
        struct s3c24xx_nand_controller *s3c24xx_info;
        s3c24xx_info = malloc(sizeof(struct s3c24xx_nand_controller));
        if (s3c24xx_info == NULL) {
-               LOG_ERROR("no memory for nand controller\n");
+               LOG_ERROR("no memory for nand controller");
                return -ENOMEM;
        }
 
index 40ee321..2005b78 100644 (file)
@@ -112,7 +112,7 @@ static int aduc702x_erase(struct flash_bank *bank, int first, int last)
 
                 if (aduc702x_check_flash_completion(target, 3500) != ERROR_OK)
                {
-                       LOG_ERROR("mass erase failed\n");
+                       LOG_ERROR("mass erase failed");
                         aduc702x_set_write_enable(target, 0);
                        return ERROR_FLASH_OPERATION_FAILED;
                }
@@ -132,7 +132,7 @@ static int aduc702x_erase(struct flash_bank *bank, int first, int last)
 
                         if (aduc702x_check_flash_completion(target, 50) != ERROR_OK)
                         {
-                                LOG_ERROR("failed to erase sector at address 0x%08lX\n", adr);
+                                LOG_ERROR("failed to erase sector at address 0x%08lX", adr);
                                 aduc702x_set_write_enable(target, 0);
                                 return ERROR_FLASH_SECTOR_NOT_ERASED;
                         }
@@ -330,7 +330,7 @@ static int aduc702x_write_single(struct flash_bank *bank, uint8_t *buffer, uint3
 
                 if (aduc702x_check_flash_completion(target, 1) != ERROR_OK)
                 {
-                       LOG_ERROR("single write failed for address 0x%08lX\n", (unsigned long)(offset + x));
+                       LOG_ERROR("single write failed for address 0x%08lX", (unsigned long)(offset + x));
                         aduc702x_set_write_enable(target, 0);
                        return ERROR_FLASH_OPERATION_FAILED;
                }
index b8789a3..94b3724 100644 (file)
@@ -1787,7 +1787,7 @@ sam3_ReadThisReg(struct sam3_chip *pChip, uint32_t *goes_here)
 
        r = target_read_u32(pChip->target, pReg->address, goes_here);
        if (r != ERROR_OK) {
-               LOG_ERROR("Cannot read SAM3 register: %s @ 0x%08x, Err: %d\n",
+               LOG_ERROR("Cannot read SAM3 register: %s @ 0x%08x, Err: %d",
                                  pReg->name, (unsigned)(pReg->address), r);
        }
        return r;
@@ -1806,7 +1806,7 @@ sam3_ReadAllRegs(struct sam3_chip *pChip)
                r = sam3_ReadThisReg(pChip,
                                                                  sam3_get_reg_ptr(&(pChip->cfg), pReg));
                if (r != ERROR_OK) {
-                       LOG_ERROR("Cannot read SAM3 registere: %s @ 0x%08x, Error: %d\n",
+                       LOG_ERROR("Cannot read SAM3 registere: %s @ 0x%08x, Error: %d",
                                          pReg->name, ((unsigned)(pReg->address)), r);
                        return r;
                }
@@ -1869,7 +1869,7 @@ sam3_erase_check(struct flash_bank *bank)
                return ERROR_TARGET_NOT_HALTED;
        }
        if (0 == bank->num_sectors) {
-               LOG_ERROR("Target: not supported/not probed\n");
+               LOG_ERROR("Target: not supported/not probed");
                return ERROR_FAIL;
        }
 
@@ -2066,7 +2066,7 @@ _sam3_probe(struct flash_bank *bank, int noise)
 
        pPrivate = get_sam3_bank_private(bank);
        if (!pPrivate) {
-               LOG_ERROR("Invalid/unknown bank number\n");
+               LOG_ERROR("Invalid/unknown bank number");
                return ERROR_FAIL;
        }
 
index 945852d..c850f4f 100644 (file)
@@ -264,7 +264,7 @@ static int eCosBoard_erase(struct ecosflash_flash_bank *info, uint32_t address,
 
        if (flashErr != 0x0)
        {
-               LOG_ERROR("Flash erase failed with %d (%s)\n", (int)flashErr, flash_errmsg(flashErr));
+               LOG_ERROR("Flash erase failed with %d (%s)", (int)flashErr, flash_errmsg(flashErr));
                return ERROR_FAIL;
        }
 
@@ -322,7 +322,7 @@ static int eCosBoard_flash(struct ecosflash_flash_bank *info, void *data, uint32
 
                if (flashErr != 0x0)
                {
-                       LOG_ERROR("Flash prog failed with %d (%s)\n", (int)flashErr, flash_errmsg(flashErr));
+                       LOG_ERROR("Flash prog failed with %d (%s)", (int)flashErr, flash_errmsg(flashErr));
                        return ERROR_FAIL;
                }
        }
index 60064ab..211c4ba 100644 (file)
@@ -65,19 +65,19 @@ int loadFile(const char *fileName, void **data, size_t *len)
        pFile = fopen(fileName,"rb");
        if (pFile == NULL)
        {
-               LOG_ERROR("Can't open %s\n", fileName);
+               LOG_ERROR("Can't open %s", fileName);
                return ERROR_FAIL;
        }
        if (fseek(pFile, 0, SEEK_END) != 0)
        {
-               LOG_ERROR("Can't open %s\n", fileName);
+               LOG_ERROR("Can't open %s", fileName);
                fclose(pFile);
                return ERROR_FAIL;
        }
        long fsize = ftell(pFile);
        if (fsize == -1)
        {
-               LOG_ERROR("Can't open %s\n", fileName);
+               LOG_ERROR("Can't open %s", fileName);
                fclose(pFile);
                return ERROR_FAIL;
        }
@@ -85,14 +85,14 @@ int loadFile(const char *fileName, void **data, size_t *len)
 
        if (fseek(pFile, 0, SEEK_SET) != 0)
        {
-               LOG_ERROR("Can't open %s\n", fileName);
+               LOG_ERROR("Can't open %s", fileName);
                fclose(pFile);
                return ERROR_FAIL;
        }
        *data = malloc(*len + 1);
        if (*data == NULL)
        {
-               LOG_ERROR("Can't open %s\n", fileName);
+               LOG_ERROR("Can't open %s", fileName);
                fclose(pFile);
                return ERROR_FAIL;
        }
@@ -101,7 +101,7 @@ int loadFile(const char *fileName, void **data, size_t *len)
        {
                fclose(pFile);
                free(*data);
-               LOG_ERROR("Can't open %s\n", fileName);
+               LOG_ERROR("Can't open %s", fileName);
                return ERROR_FAIL;
        }
        fclose(pFile);
index 72c756e..61b42ce 100644 (file)
@@ -451,12 +451,12 @@ static int armjtagew_get_status(void)
 
                if (u_tg < 1500)
                {
-                       LOG_ERROR("Vref too low. Check Target Power\n");
+                       LOG_ERROR("Vref too low. Check Target Power");
                }
        }
        else
        {
-               LOG_ERROR("ARM-JTAG-EW command CMD_GET_TAPHW_STATE failed (%d)\n", result);
+               LOG_ERROR("ARM-JTAG-EW command CMD_GET_TAPHW_STATE failed (%d)", result);
        }
 
        return ERROR_OK;
@@ -474,7 +474,7 @@ static int armjtagew_get_version_info(void)
 
        if (result != 0)
        {
-               LOG_ERROR("ARM-JTAG-EW command CMD_GET_VERSION failed (%d)\n", result);
+               LOG_ERROR("ARM-JTAG-EW command CMD_GET_VERSION failed (%d)", result);
                return ERROR_JTAG_DEVICE_ERROR;
        }
 
index c8a98d2..6449550 100644 (file)
@@ -2161,7 +2161,7 @@ static int ft2232_init_ftd2xx(uint16_t vid, uint16_t pid, int more, int* try_mor
 
                        if (status == FT_OK)
                        {
-                               LOG_ERROR("ListDevices: %lu\n", num_devices);
+                               LOG_ERROR("ListDevices: %lu", num_devices);
                                for (i = 0; i < num_devices; i++)
                                        LOG_ERROR("%" PRIu32 ": \"%s\"", i, desc_array[i]);
                        }
@@ -2173,7 +2173,7 @@ static int ft2232_init_ftd2xx(uint16_t vid, uint16_t pid, int more, int* try_mor
                }
                else
                {
-                       LOG_ERROR("ListDevices: NONE\n");
+                       LOG_ERROR("ListDevices: NONE");
                }
                return ERROR_JTAG_INIT_FAILED;
        }
index e7e3ced..4a8896b 100644 (file)
@@ -514,7 +514,7 @@ static int jlink_get_status(void)
        result = jlink_usb_read(jlink_handle, 8);
        if (result != 8)
        {
-               LOG_ERROR("J-Link command EMU_CMD_GET_STATE failed (%d)\n", result);
+               LOG_ERROR("J-Link command EMU_CMD_GET_STATE failed (%d)", result);
                return ERROR_JTAG_DEVICE_ERROR;
        }
 
index a3fad35..27861b3 100644 (file)
@@ -348,7 +348,7 @@ dtc_load_from_buffer(
 
        while (length) {
                if (length < sizeof(*header)) {
-                       LOG_ERROR("Malformed DTC image\n");
+                       LOG_ERROR("Malformed DTC image");
                        exit(1);
                }
 
@@ -357,7 +357,7 @@ dtc_load_from_buffer(
                length -= sizeof(*header);
 
                if (length < (size_t)header->length + 1) {
-                       LOG_ERROR("Malformed DTC image\n");
+                       LOG_ERROR("Malformed DTC image");
                        exit(1);
                }
 
@@ -417,7 +417,7 @@ dtc_load_from_buffer(
                                break;
 
                        default:
-                               LOG_ERROR("Invalid DTC image record type: 0x%02x\n", header->type);
+                               LOG_ERROR("Invalid DTC image record type: 0x%02x", header->type);
                                exit(1);
                                break;
                }
@@ -538,7 +538,7 @@ dtc_run_download(
                if (ep2_buffer[0] & 0x01) break;
 
                if (!--i) {
-                       LOG_ERROR("%s, %d: too many retries waiting for DTC status\n",
+                       LOG_ERROR("%s, %d: too many retries waiting for DTC status",
                                __FILE__, __LINE__
 );
                        return(-ETIMEDOUT);
@@ -556,7 +556,7 @@ dtc_run_download(
 );
 
                if (usb_err < (int)sizeof(ep2_buffer)) {
-                       LOG_ERROR("%s, %d: Read of endpoint 2 returned %d\n",
+                       LOG_ERROR("%s, %d: Read of endpoint 2 returned %d",
                                __FILE__, __LINE__, usb_err
 );
                        return(usb_err);
@@ -691,7 +691,7 @@ dtc_queue_run(void) {
                        NULL, 0
 );
                if (usb_err < 0) {
-                       LOG_ERROR("dtc_run_download: %s\n", usb_strerror());
+                       LOG_ERROR("dtc_run_download: %s", usb_strerror());
                        exit(1);
                }
        } else {
@@ -700,7 +700,7 @@ dtc_queue_run(void) {
                        reply_buffer, dtc_queue.reply_index
 );
                if (usb_err < 0) {
-                       LOG_ERROR("dtc_run_download: %s\n", usb_strerror());
+                       LOG_ERROR("dtc_run_download: %s", usb_strerror());
                        exit(1);
                } else {
                        /* process the reply, which empties the reply queue and frees its entries */
@@ -1106,7 +1106,7 @@ rlink_scan(
        uint8_t                 dtc_mask;
 
        if (scan_size < 1) {
-               LOG_ERROR("scan_size cannot be less than 1 bit\n");
+               LOG_ERROR("scan_size cannot be less than 1 bit");
                exit(1);
        }
 
@@ -1230,7 +1230,7 @@ rlink_scan(
                                chunk_bits,
                                cmd
 ) == NULL) {
-                               LOG_ERROR("enqueuing DTC reply entry: %s\n", strerror(errno));
+                               LOG_ERROR("enqueuing DTC reply entry: %s", strerror(errno));
                                exit(1);
                        }
 
@@ -1295,7 +1295,7 @@ rlink_scan(
                        extra_bits,
                        cmd
 ) == NULL) {
-                       LOG_ERROR("enqueuing DTC reply entry: %s\n", strerror(errno));
+                       LOG_ERROR("enqueuing DTC reply entry: %s", strerror(errno));
                        exit(1);
                }
 
@@ -1353,7 +1353,7 @@ rlink_scan(
                                1,
                                cmd
 ) == NULL) {
-                               LOG_ERROR("enqueuing DTC reply entry: %s\n", strerror(errno));
+                               LOG_ERROR("enqueuing DTC reply entry: %s", strerror(errno));
                                exit(1);
                        }
 
@@ -1503,7 +1503,7 @@ int rlink_speed(int speed)
        for (i = rlink_speed_table_size; i--;) {
                if (rlink_speed_table[i].prescaler == speed) {
                        if (dtc_load_from_buffer(pHDev, rlink_speed_table[i].dtc, rlink_speed_table[i].dtc_size) != 0) {
-                               LOG_ERROR("An error occurred while trying to load DTC code for speed \"%d\".\n", speed);
+                               LOG_ERROR("An error occurred while trying to load DTC code for speed \"%d\".", speed);
                                exit(1);
                        }
 
@@ -1583,12 +1583,12 @@ int rlink_init(void)
        struct usb_device *dev = usb_device(pHDev);
        if (dev->descriptor.bNumConfigurations > 1)
        {
-               LOG_ERROR("Whoops! NumConfigurations is not 1, don't know what to do...\n");
+               LOG_ERROR("Whoops! NumConfigurations is not 1, don't know what to do...");
                return ERROR_FAIL;
        }
        if (dev->config->bNumInterfaces > 1)
        {
-               LOG_ERROR("Whoops! NumInterfaces is not 1, don't know what to do...\n");
+               LOG_ERROR("Whoops! NumInterfaces is not 1, don't know what to do...");
                return ERROR_FAIL;
        }
 
@@ -1624,7 +1624,7 @@ int rlink_init(void)
        }
        if (usb_set_altinterface(pHDev,0) != 0)
        {
-               LOG_ERROR("Failed to set interface.\n");
+               LOG_ERROR("Failed to set interface.");
                return ERROR_FAIL;
        }
 
index c9b88f8..54ad40f 100644 (file)
@@ -370,7 +370,7 @@ static int usb_blaster_init(void)
 
                        if (status == FT_OK)
                        {
-                               LOG_ERROR("ListDevices: %lu\n", num_devices);
+                               LOG_ERROR("ListDevices: %lu", num_devices);
                                for (i = 0; i < num_devices; i++)
                                        LOG_ERROR("%i: %s", i, desc_array[i]);
                        }
index d756928..19a2f64 100644 (file)
@@ -87,11 +87,11 @@ begin_ejtag_dma_read:
        if (ejtag_ctrl  & EJTAG_CTRL_DERR)
        {
                if (retries--) {
-                       LOG_ERROR("DMA Read Addr = %08" PRIx32 "  Data = ERROR ON READ (retrying)\n", addr);
+                       LOG_ERROR("DMA Read Addr = %08" PRIx32 "  Data = ERROR ON READ (retrying)", addr);
                        goto begin_ejtag_dma_read;
                }
                else
-                       LOG_ERROR("DMA Read Addr = %08" PRIx32 "  Data = ERROR ON READ\n", addr);
+                       LOG_ERROR("DMA Read Addr = %08" PRIx32 "  Data = ERROR ON READ", addr);
                return ERROR_JTAG_DEVICE_ERROR;
        }
 
@@ -133,11 +133,11 @@ begin_ejtag_dma_read_h:
        if (ejtag_ctrl  & EJTAG_CTRL_DERR)
        {
                if (retries--) {
-                       LOG_ERROR("DMA Read Addr = %08" PRIx32 "  Data = ERROR ON READ (retrying)\n", addr);
+                       LOG_ERROR("DMA Read Addr = %08" PRIx32 "  Data = ERROR ON READ (retrying)", addr);
                        goto begin_ejtag_dma_read_h;
                }
                else
-                       LOG_ERROR("DMA Read Addr = %08" PRIx32 "  Data = ERROR ON READ\n", addr);
+                       LOG_ERROR("DMA Read Addr = %08" PRIx32 "  Data = ERROR ON READ", addr);
                return ERROR_JTAG_DEVICE_ERROR;
        }
 
@@ -185,11 +185,11 @@ begin_ejtag_dma_read_b:
        if (ejtag_ctrl  & EJTAG_CTRL_DERR)
        {
                if (retries--) {
-                       LOG_ERROR("DMA Read Addr = %08" PRIx32 "  Data = ERROR ON READ (retrying)\n", addr);
+                       LOG_ERROR("DMA Read Addr = %08" PRIx32 "  Data = ERROR ON READ (retrying)", addr);
                        goto begin_ejtag_dma_read_b;
                }
                else
-                       LOG_ERROR("DMA Read Addr = %08" PRIx32 "  Data = ERROR ON READ\n", addr);
+                       LOG_ERROR("DMA Read Addr = %08" PRIx32 "  Data = ERROR ON READ", addr);
                return ERROR_JTAG_DEVICE_ERROR;
        }
 
@@ -248,11 +248,11 @@ begin_ejtag_dma_write:
        if (ejtag_ctrl  & EJTAG_CTRL_DERR)
        {
                if (retries--) {
-                       LOG_ERROR("DMA Write Addr = %08" PRIx32 "  Data = ERROR ON WRITE (retrying)\n", addr);
+                       LOG_ERROR("DMA Write Addr = %08" PRIx32 "  Data = ERROR ON WRITE (retrying)", addr);
                        goto begin_ejtag_dma_write;
                }
                else
-                       LOG_ERROR("DMA Write Addr = %08" PRIx32 "  Data = ERROR ON WRITE\n", addr);
+                       LOG_ERROR("DMA Write Addr = %08" PRIx32 "  Data = ERROR ON WRITE", addr);
                return ERROR_JTAG_DEVICE_ERROR;
        }
 
@@ -299,11 +299,11 @@ begin_ejtag_dma_write_h:
        if (ejtag_ctrl  & EJTAG_CTRL_DERR)
        {
                if (retries--) {
-                       LOG_ERROR("DMA Write Addr = %08" PRIx32 "  Data = ERROR ON WRITE (retrying)\n", addr);
+                       LOG_ERROR("DMA Write Addr = %08" PRIx32 "  Data = ERROR ON WRITE (retrying)", addr);
                        goto begin_ejtag_dma_write_h;
                }
                else
-                       LOG_ERROR("DMA Write Addr = %08" PRIx32 "  Data = ERROR ON WRITE\n", addr);
+                       LOG_ERROR("DMA Write Addr = %08" PRIx32 "  Data = ERROR ON WRITE", addr);
                return ERROR_JTAG_DEVICE_ERROR;
        }
 
@@ -351,11 +351,11 @@ begin_ejtag_dma_write_b:
        if (ejtag_ctrl & EJTAG_CTRL_DERR)
        {
                if (retries--) {
-                       LOG_ERROR("DMA Write Addr = %08" PRIx32 "  Data = ERROR ON WRITE (retrying)\n", addr);
+                       LOG_ERROR("DMA Write Addr = %08" PRIx32 "  Data = ERROR ON WRITE (retrying)", addr);
                        goto begin_ejtag_dma_write_b;
                }
                else
-                       LOG_ERROR("DMA Write Addr = %08" PRIx32 "  Data = ERROR ON WRITE\n", addr);
+                       LOG_ERROR("DMA Write Addr = %08" PRIx32 "  Data = ERROR ON WRITE", addr);
                return ERROR_JTAG_DEVICE_ERROR;
        }
 
index 157d728..31c3949 100644 (file)
@@ -522,42 +522,42 @@ COMMAND_HANDLER(handle_xsvf_command)
                        break;
 
                case XSETSDRMASKS:
-                       LOG_ERROR("unsupported XSETSDRMASKS\n");
+                       LOG_ERROR("unsupported XSETSDRMASKS");
                        unsupported = 1;
                        break;
 
                case XSDRINC:
-                       LOG_ERROR("unsupported XSDRINC\n");
+                       LOG_ERROR("unsupported XSDRINC");
                        unsupported = 1;
                        break;
 
                case XSDRB:
-                       LOG_ERROR("unsupported XSDRB\n");
+                       LOG_ERROR("unsupported XSDRB");
                        unsupported = 1;
                        break;
 
                case XSDRC:
-                       LOG_ERROR("unsupported XSDRC\n");
+                       LOG_ERROR("unsupported XSDRC");
                        unsupported = 1;
                        break;
 
                case XSDRE:
-                       LOG_ERROR("unsupported XSDRE\n");
+                       LOG_ERROR("unsupported XSDRE");
                        unsupported = 1;
                        break;
 
                case XSDRTDOB:
-                       LOG_ERROR("unsupported XSDRTDOB\n");
+                       LOG_ERROR("unsupported XSDRTDOB");
                        unsupported = 1;
                        break;
 
                case XSDRTDOC:
-                       LOG_ERROR("unsupported XSDRTDOC\n");
+                       LOG_ERROR("unsupported XSDRTDOC");
                        unsupported = 1;
                        break;
 
                case XSDRTDOE:
-                       LOG_ERROR("unsupported XSDRTDOE\n");
+                       LOG_ERROR("unsupported XSDRTDOE");
                        unsupported = 1;
                        break;
 
@@ -993,7 +993,7 @@ COMMAND_HANDLER(handle_xsvf_command)
                        break;
 
                default:
-                       LOG_ERROR("unknown xsvf command (0x%02X)\n", uc);
+                       LOG_ERROR("unknown xsvf command (0x%02X)", uc);
                        unsupported = 1;
                }