OpenOCD: drop comparison with true/false
Fix checkpatch errors: ERROR:BOOL_COMPARISON: Using comparison to true/false is error prone While there, - drop useless parenthesis, - drop unnecessary else after a return. Change-Id: I1234737b3e65bd10df5e938d1c36f9abaf02d348 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/8496 Reviewed-by: zapb <dev@zapb.de> Tested-by: jenkins
This commit is contained in:
@@ -606,7 +606,7 @@ static void ulink_clear_queue(struct ulink *device)
|
||||
|
||||
/* IN payload MUST be freed ONLY if no other commands use the
|
||||
* payload_in_start buffer */
|
||||
if (current->free_payload_in_start == true) {
|
||||
if (current->free_payload_in_start) {
|
||||
free(current->payload_in_start);
|
||||
current->payload_in_start = NULL;
|
||||
current->payload_in = NULL;
|
||||
@@ -1861,7 +1861,7 @@ static int ulink_post_process_queue(struct ulink *device)
|
||||
|
||||
/* Check if a corresponding OpenOCD command is stored for this
|
||||
* OpenULINK command */
|
||||
if ((current->needs_postprocessing == true) && (openocd_cmd)) {
|
||||
if (current->needs_postprocessing && openocd_cmd) {
|
||||
switch (openocd_cmd->type) {
|
||||
case JTAG_SCAN:
|
||||
ret = ulink_post_process_scan(current);
|
||||
@@ -2131,7 +2131,7 @@ static int ulink_init(void)
|
||||
download_firmware = true;
|
||||
}
|
||||
|
||||
if (download_firmware == true) {
|
||||
if (download_firmware) {
|
||||
LOG_INFO("Loading OpenULINK firmware. This is reversible by power-cycling"
|
||||
" ULINK device.");
|
||||
ret = ulink_load_firmware_and_renumerate(&ulink_handle,
|
||||
|
||||
@@ -215,7 +215,7 @@ static int ublast2_libusb_init(struct ublast_lowlevel *low)
|
||||
const uint16_t vids_renum[] = { low->ublast_vid, 0 };
|
||||
const uint16_t pids_renum[] = { low->ublast_pid, 0 };
|
||||
|
||||
if (renumeration == false) {
|
||||
if (!renumeration) {
|
||||
if (jtag_libusb_open(vids_renum, pids_renum, NULL, &low->libusb_dev, NULL) != ERROR_OK) {
|
||||
LOG_ERROR("Altera USB-Blaster II not found");
|
||||
return ERROR_FAIL;
|
||||
|
||||
Reference in New Issue
Block a user