Remove whitespace that occurs after '('.
[fw/openocd] / src / jtag / rlink / rlink.c
index aa6eb6c0735958171fa466e4aac88b2e0be5de68..add945807ac493ac9372eccb98039906fb732202 100644 (file)
@@ -518,7 +518,7 @@ dtc_run_download(
 
 
        /* Wait for DTC to finish running command buffer */
-       for(i = 10;;) {
+       for (i = 10;;) {
                usb_err = ep1_generic_commandl(
                        pHDev, 4,
 
@@ -711,7 +711,7 @@ dtc_queue_run(void) {
 
                        /* The rigamarole with the masks and doing it bit-by-bit is due to the fact that the scan buffer is LSb-first and the DTC code is MSb-first for hardware reasons.   It was that or craft a function to do the reversal, and that wouldn't work with bit-stuffing (supplying extra bits to use mostly byte operations), or any other scheme which would throw the byte alignment off. */
 
-                       for(
+                       for (
                                rq_p = dtc_queue.rq_head;
                                rq_p != NULL;
                                rq_p = rq_next
@@ -726,7 +726,7 @@ dtc_queue_run(void) {
 
                                        dtc_mask = 1 << (8 - 1);
 
-                                       for(
+                                       for (
                                                ;
                                                bit_cnt;
                                                bit_cnt--
@@ -764,7 +764,7 @@ dtc_queue_run(void) {
                                                dtc_mask = 1 << (bit_cnt - 1);
                                        }
 
-                                       for(
+                                       for (
                                                ;
                                                bit_cnt;
                                                bit_cnt--
@@ -834,7 +834,7 @@ tap_state_queue_run(void) {
        if (!tap_state_queue.length) return(retval);
        bits = 1;
        byte = 0;
-       for(i = tap_state_queue.length; i--;) {
+       for (i = tap_state_queue.length; i--;) {
 
                byte <<= 1;
                if (tap_state_queue.buffer & 1) {
@@ -915,7 +915,7 @@ void rlink_end_state(tap_state_t state)
 static
 void rlink_state_move(void) {
 
-       int i=0, tms=0;
+       int i = 0, tms = 0;
        uint8_t tms_scan = tap_get_tms_path(tap_get_state(), tap_get_end_state());
        int tms_count = tap_get_tms_path_len(tap_get_state(), tap_get_end_state());
 
@@ -1131,7 +1131,7 @@ rlink_scan(
 
 
 #if 0
-       printf("scan_size = %d, type=0x%x\n", scan_size, type);
+       printf("scan_size = %d, type = 0x%x\n", scan_size, type);
        {
                int   i;
 
@@ -1140,7 +1140,7 @@ rlink_scan(
                buffer[scan_size / 8] &= ((1 << ((scan_size - 1) % 8) + 1) - 1);
 
                printf("before scan:");
-               for(i = 0; i < (scan_size + 7) / 8; i++) {
+               for (i = 0; i < (scan_size + 7) / 8; i++) {
                        printf(" %02x", buffer[i]);
                }
                printf("\n");
@@ -1503,7 +1503,7 @@ int rlink_speed(int speed)
                speed = rlink_speed_table[rlink_speed_table_size - 1].prescaler;
        }
 
-       for(i = rlink_speed_table_size; i--; ) {
+       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);
@@ -1534,7 +1534,7 @@ int rlink_speed_div(
 ) {
        int     i;
 
-       for(i = rlink_speed_table_size; i--; ) {
+       for (i = rlink_speed_table_size; i--; ) {
                if (rlink_speed_table[i].prescaler == speed) {
                        *khz = rlink_speed_table[i].khz;
                        return(ERROR_OK);
@@ -1558,7 +1558,7 @@ int rlink_khz(
                return ERROR_FAIL;
        }
 
-       for(i = rlink_speed_table_size; i--; ) {
+       for (i = rlink_speed_table_size; i--; ) {
                if (rlink_speed_table[i].khz <= khz) {
                        *speed = rlink_speed_table[i].prescaler;
                        return(ERROR_OK);
@@ -1620,8 +1620,8 @@ int rlink_init(void)
        struct usb_bus *busses;
        struct usb_bus *bus;
        int i, j, retries;
-       int found=0;
-       int success=0;
+       int found = 0;
+       int success = 0;
        uint8_t reply_buffer[USB_EP1IN_SIZE];
 
        usb_init();
@@ -1630,32 +1630,32 @@ int rlink_init(void)
 
        busses = usb_get_busses();
 
-       for(bus = busses; bus; bus = bus->next)
+       for (bus = busses; bus; bus = bus->next)
        {
                struct usb_device *dev;
 
-               for(dev = bus->devices; dev; dev = dev->next)
+               for (dev = bus->devices; dev; dev = dev->next)
                {
-                       if ( (dev->descriptor.idVendor == USB_IDVENDOR) && (dev->descriptor.idProduct == USB_IDPRODUCT) )
+                       if ((dev->descriptor.idVendor == USB_IDVENDOR) && (dev->descriptor.idProduct == USB_IDPRODUCT) )
                        {
                                found = 1;
                                LOG_DEBUG("Found device on bus.\n");
 
                                do
                                {
-                                       if ( dev->descriptor.bNumConfigurations > 1 )
+                                       if (dev->descriptor.bNumConfigurations > 1 )
                                        {
                                                LOG_ERROR("Whoops! NumConfigurations is not 1, don't know what to do...\n");
                                                break;
                                        }
-                                       if ( dev->config->bNumInterfaces > 1 )
+                                       if (dev->config->bNumInterfaces > 1 )
                                        {
                                                LOG_ERROR("Whoops! NumInterfaces is not 1, don't know what to do...\n");
                                                break;
                                        }
 
-                                       pHDev=usb_open(dev);
-                                       if ( !pHDev )
+                                       pHDev = usb_open(dev);
+                                       if (!pHDev )
                                                LOG_ERROR ("Failed to open device.\n");
                                        else
                                        {
@@ -1686,13 +1686,13 @@ int rlink_init(void)
 
                                                if (!i)
                                                {
-                                                       if ( usb_set_altinterface(pHDev,0) )
+                                                       if (usb_set_altinterface(pHDev,0) )
                                                        {
                                                                LOG_ERROR("Failed to set interface.\n");
                                                                break;
                                                        }
                                                        else
-                                                               success=1;
+                                                               success = 1;
                                                }
                                        }
                                } while (0);
@@ -1700,13 +1700,13 @@ int rlink_init(void)
                }
        }
 
-       if ( !found )
+       if (!found )
        {
                LOG_ERROR("No device found on bus.\n");
                exit(1);
        }
 
-       if ( !success )
+       if (!success )
        {
                LOG_ERROR("Initialisation failed.");
                exit(1);
@@ -1715,7 +1715,7 @@ int rlink_init(void)
 
        /* The device starts out in an unknown state on open.  As such, result reads time out, and it's not even known whether the command was accepted.  So, for this first command, we issue it repeatedly until its response doesn't time out.  Also, if sending a command is going to time out, we'll find that out here. */
        /* It must be possible to open the device in such a way that this special magic isn't needed, but, so far, it escapes us. */
-       for(i = 0; i < 5; i++) {
+       for (i = 0; i < 5; i++) {
                j = ep1_generic_commandl(
                        pHDev, 1,
                        EP1_CMD_GET_FWREV