coding style: avoid unnecessary line continuations

Line continuation, adding a backslash as last char of the line, is
requested in multi-line macro definition, but is not necessary in
the rest of C code.

Remove it where present.

Identified by checkpatch script from Linux kernel v5.1 using the
command

	find src/ -type f -exec ./tools/scripts/checkpatch.pl \
	-q --types LINE_CONTINUATIONS -f {} \;

Change-Id: Id0c69e93456731717a7b290b16580e9f8ae741bc
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5619
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Tested-by: jenkins
This commit is contained in:
Antonio Borneo
2019-05-06 01:03:52 +02:00
parent e66bb9d312
commit 4f459660a9
23 changed files with 74 additions and 74 deletions

View File

@@ -107,7 +107,7 @@ static int armjtagew_execute_queue(void)
switch (cmd->type) {
case JTAG_RUNTEST:
LOG_DEBUG_IO("runtest %i cycles, end in %i",
cmd->cmd.runtest->num_cycles, \
cmd->cmd.runtest->num_cycles,
cmd->cmd.runtest->end_state);
armjtagew_end_state(cmd->cmd.runtest->end_state);
@@ -122,8 +122,8 @@ static int armjtagew_execute_queue(void)
break;
case JTAG_PATHMOVE:
LOG_DEBUG_IO("pathmove: %i states, end in %i", \
cmd->cmd.pathmove->num_states, \
LOG_DEBUG_IO("pathmove: %i states, end in %i",
cmd->cmd.pathmove->num_states,
cmd->cmd.pathmove->path[cmd->cmd.pathmove->num_states - 1]);
armjtagew_path_move(cmd->cmd.pathmove->num_states,
@@ -459,10 +459,10 @@ static int armjtagew_get_version_info(void)
auxinfo[256] = '\0';
LOG_INFO(
"ARM-JTAG-EW firmware version %d.%d, hardware revision %c, SN=%s, Additional info: %s", \
"ARM-JTAG-EW firmware version %d.%d, hardware revision %c, SN=%s, Additional info: %s",
usb_in_buffer[1],
usb_in_buffer[0], \
isgraph(usb_in_buffer[2]) ? usb_in_buffer[2] : 'X', \
usb_in_buffer[0],
isgraph(usb_in_buffer[2]) ? usb_in_buffer[2] : 'X',
sn,
auxinfo);
@@ -750,7 +750,7 @@ static int armjtagew_usb_write(struct armjtagew *armjtagew, int out_length)
return -1;
}
result = usb_bulk_write(armjtagew->usb_handle, ARMJTAGEW_EPT_BULK_OUT, \
result = usb_bulk_write(armjtagew->usb_handle, ARMJTAGEW_EPT_BULK_OUT,
(char *)usb_out_buffer, out_length, ARMJTAGEW_USB_TIMEOUT);
LOG_DEBUG_IO("armjtagew_usb_write, out_length = %d, result = %d", out_length, result);
@@ -764,7 +764,7 @@ static int armjtagew_usb_write(struct armjtagew *armjtagew, int out_length)
/* Read data from USB into in_buffer. */
static int armjtagew_usb_read(struct armjtagew *armjtagew, int exp_in_length)
{
int result = usb_bulk_read(armjtagew->usb_handle, ARMJTAGEW_EPT_BULK_IN, \
int result = usb_bulk_read(armjtagew->usb_handle, ARMJTAGEW_EPT_BULK_IN,
(char *)usb_in_buffer, exp_in_length, ARMJTAGEW_USB_TIMEOUT);
LOG_DEBUG_IO("armjtagew_usb_read, result = %d", result);

View File

@@ -1525,7 +1525,7 @@ COMMAND_HANDLER(jlink_handle_config_mac_address_command)
} else if (CMD_ARGC == 1) {
str = CMD_ARGV[0];
if ((strlen(str) != 17) || (str[2] != ':' || str[5] != ':' || \
if ((strlen(str) != 17) || (str[2] != ':' || str[5] != ':' ||
str[8] != ':' || str[11] != ':' || str[14] != ':')) {
command_print(CMD, "Invalid MAC address format.");
return ERROR_COMMAND_SYNTAX_ERROR;

View File

@@ -259,7 +259,7 @@ static int opendous_execute_queue(void)
while (cmd != NULL) {
switch (cmd->type) {
case JTAG_RUNTEST:
LOG_DEBUG_IO("runtest %i cycles, end in %i", cmd->cmd.runtest->num_cycles, \
LOG_DEBUG_IO("runtest %i cycles, end in %i", cmd->cmd.runtest->num_cycles,
cmd->cmd.runtest->end_state);
if (cmd->cmd.runtest->end_state != -1)
@@ -276,8 +276,8 @@ static int opendous_execute_queue(void)
break;
case JTAG_PATHMOVE:
LOG_DEBUG_IO("pathmove: %i states, end in %i", \
cmd->cmd.pathmove->num_states, \
LOG_DEBUG_IO("pathmove: %i states, end in %i",
cmd->cmd.pathmove->num_states,
cmd->cmd.pathmove->path[cmd->cmd.pathmove->num_states - 1]);
opendous_path_move(cmd->cmd.pathmove->num_states, cmd->cmd.pathmove->path);
@@ -770,7 +770,7 @@ int opendous_usb_write(struct opendous_jtag *opendous_jtag, int out_length)
LIBUSB_REQUEST_TYPE_VENDOR | LIBUSB_RECIPIENT_DEVICE | LIBUSB_ENDPOINT_OUT,
FUNC_WRITE_DATA, 0, 0, (char *) usb_out_buffer, out_length, OPENDOUS_USB_TIMEOUT);
} else {
jtag_libusb_bulk_write(opendous_jtag->usb_handle, OPENDOUS_WRITE_ENDPOINT, \
jtag_libusb_bulk_write(opendous_jtag->usb_handle, OPENDOUS_WRITE_ENDPOINT,
(char *)usb_out_buffer, out_length, OPENDOUS_USB_TIMEOUT, &result);
}
#ifdef _DEBUG_USB_COMMS_

View File

@@ -2319,7 +2319,7 @@ static int stlink_usb_read_mem(void *handle, uint32_t addr, uint32_t size,
while (count) {
bytes_remaining = (size != 1) ? \
bytes_remaining = (size != 1) ?
stlink_max_block_size(h->max_mem_packet, addr) : stlink_usb_block(h);
if (count < bytes_remaining)
@@ -2404,7 +2404,7 @@ static int stlink_usb_write_mem(void *handle, uint32_t addr, uint32_t size,
while (count) {
bytes_remaining = (size != 1) ? \
bytes_remaining = (size != 1) ?
stlink_max_block_size(h->max_mem_packet, addr) : stlink_usb_block(h);
if (count < bytes_remaining)
@@ -2528,7 +2528,7 @@ static int stlink_match_speed_map(const struct speed_map *map, unsigned int map_
match = false;
if (!match && query) {
LOG_INFO("Unable to match requested speed %d kHz, using %d kHz", \
LOG_INFO("Unable to match requested speed %d kHz, using %d kHz",
khz, map[speed_index].speed);
}

View File

@@ -45,7 +45,7 @@ static int ublast2_libusb_read(struct ublast_lowlevel *low, uint8_t *buf,
int ret, tmp = 0;
ret = jtag_libusb_bulk_read(low->libusb_dev,
USBBLASTER_EPIN | \
USBBLASTER_EPIN |
LIBUSB_ENDPOINT_IN,
(char *)buf,
size,
@@ -61,7 +61,7 @@ static int ublast2_libusb_write(struct ublast_lowlevel *low, uint8_t *buf,
int ret, tmp = 0;
ret = jtag_libusb_bulk_write(low->libusb_dev,
USBBLASTER_EPOUT | \
USBBLASTER_EPOUT |
LIBUSB_ENDPOINT_OUT,
(char *)buf,
size,
@@ -106,7 +106,7 @@ static int ublast2_write_firmware_section(struct libusb_device_handle *libusb_de
chunk_size = bytes_remaining;
jtag_libusb_control_transfer(libusb_dev,
LIBUSB_REQUEST_TYPE_VENDOR | \
LIBUSB_REQUEST_TYPE_VENDOR |
LIBUSB_ENDPOINT_OUT,
USBBLASTER_CTRL_LOAD_FIRM,
addr,
@@ -152,7 +152,7 @@ static int load_usb_blaster_firmware(struct libusb_device_handle *libusb_dev,
char value = CPU_RESET;
jtag_libusb_control_transfer(libusb_dev,
LIBUSB_REQUEST_TYPE_VENDOR | \
LIBUSB_REQUEST_TYPE_VENDOR |
LIBUSB_ENDPOINT_OUT,
USBBLASTER_CTRL_LOAD_FIRM,
EZUSB_CPUCS,
@@ -173,7 +173,7 @@ static int load_usb_blaster_firmware(struct libusb_device_handle *libusb_dev,
value = !CPU_RESET;
jtag_libusb_control_transfer(libusb_dev,
LIBUSB_REQUEST_TYPE_VENDOR | \
LIBUSB_REQUEST_TYPE_VENDOR |
LIBUSB_ENDPOINT_OUT,
USBBLASTER_CTRL_LOAD_FIRM,
EZUSB_CPUCS,
@@ -230,7 +230,7 @@ static int ublast2_libusb_init(struct ublast_lowlevel *low)
char buffer[5];
jtag_libusb_control_transfer(low->libusb_dev,
LIBUSB_REQUEST_TYPE_VENDOR | \
LIBUSB_REQUEST_TYPE_VENDOR |
LIBUSB_ENDPOINT_IN,
USBBLASTER_CTRL_READ_REV,
0,

View File

@@ -1042,8 +1042,8 @@ static const struct command_registration ublast_command_handlers[] = {
.name = "usb_blaster_vid_pid",
.handler = ublast_handle_vid_pid_command,
.mode = COMMAND_CONFIG,
.help = "the vendor ID and product ID of the USB-Blaster and " \
"vendor ID and product ID of the uninitialized device " \
.help = "the vendor ID and product ID of the USB-Blaster and "
"vendor ID and product ID of the uninitialized device "
"for USB-Blaster II",
.usage = "vid pid vid_uninit pid_uninit",
},

View File

@@ -381,7 +381,7 @@ static void usbprog_jtag_close(struct usbprog_jtag *usbprog_jtag)
static unsigned char usbprog_jtag_message(struct usbprog_jtag *usbprog_jtag, char *msg, int msglen)
{
int res = usb_bulk_write(usbprog_jtag->usb_handle, 3, msg, msglen, 100);
if ((msg[0] == 2) || (msg[0] == 1) || (msg[0] == 4) || (msg[0] == 0) || \
if ((msg[0] == 2) || (msg[0] == 1) || (msg[0] == 4) || (msg[0] == 0) ||
(msg[0] == 6) || (msg[0] == 0x0A) || (msg[0] == 9))
return 1;
if (res == msglen) {

View File

@@ -91,7 +91,7 @@ struct versaloon_pending_t {
void *extra_data;
versaloon_callback_t callback;
};
extern struct versaloon_pending_t \
extern struct versaloon_pending_t
versaloon_pending[VERSALOON_MAX_PENDING_NUMBER];
extern uint16_t versaloon_pending_idx;
void versaloon_set_pending_id(uint32_t id);

View File

@@ -292,7 +292,7 @@ static int vsllink_interface_init(void)
libusb_init(&vsllink_handle->libusb_ctx);
if (ERROR_OK != vsllink_usb_open(vsllink_handle)) {
LOG_ERROR("Can't find USB JTAG Interface!" \
LOG_ERROR("Can't find USB JTAG Interface!"
"Please check connection and permissions.");
return ERROR_JTAG_INIT_FAILED;
}

View File

@@ -170,7 +170,7 @@ void embeddedice_write_dcc(struct jtag_tap *tap, int reg_addr, const uint8_t *bu
int arm11_run_instr_data_to_core_noack_inner(struct jtag_tap *tap, uint32_t opcode,
uint32_t *data, size_t count)
{
int arm11_run_instr_data_to_core_noack_inner_default(struct jtag_tap *tap, \
int arm11_run_instr_data_to_core_noack_inner_default(struct jtag_tap *tap,
uint32_t opcode, uint32_t *data, size_t count);
return arm11_run_instr_data_to_core_noack_inner_default(tap, opcode, data, count);
}