projects
/
fw
/
openocd
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
openocd: fix simple cases of NULL comparison
[fw/openocd]
/
src
/
jtag
/
drivers
/
vsllink.c
diff --git
a/src/jtag/drivers/vsllink.c
b/src/jtag/drivers/vsllink.c
index 6a592bcfb35882d98d041bbac63cdbf562d4d378..b4597b788dce87d376b1e23bece146d2d5377093 100644
(file)
--- a/
src/jtag/drivers/vsllink.c
+++ b/
src/jtag/drivers/vsllink.c
@@
-105,7
+105,7
@@
static int vsllink_execute_queue(void)
" vsllink "
"-------------------------------------");
" vsllink "
"-------------------------------------");
- while (cmd
!= NULL
) {
+ while (cmd) {
switch (cmd->type) {
case JTAG_RUNTEST:
LOG_DEBUG_IO("runtest %i cycles, end in %s",
switch (cmd->type) {
case JTAG_RUNTEST:
LOG_DEBUG_IO("runtest %i cycles, end in %s",
@@
-280,7
+280,7
@@
static int vsllink_quit(void)
static int vsllink_interface_init(void)
{
vsllink_handle = malloc(sizeof(struct vsllink));
static int vsllink_interface_init(void)
{
vsllink_handle = malloc(sizeof(struct vsllink));
- if (
NULL ==
vsllink_handle) {
+ if (
!
vsllink_handle) {
LOG_ERROR("unable to allocate memory");
return ERROR_FAIL;
}
LOG_ERROR("unable to allocate memory");
return ERROR_FAIL;
}
@@
-333,7
+333,7
@@
static int vsllink_init(void)
tdi_buffer = malloc(tap_buffer_size);
tdo_buffer = malloc(tap_buffer_size);
tms_buffer = malloc(tap_buffer_size);
tdi_buffer = malloc(tap_buffer_size);
tdo_buffer = malloc(tap_buffer_size);
tms_buffer = malloc(tap_buffer_size);
- if ((
NULL == tdi_buffer) || (NULL == tdo_buffer) || (NULL ==
tms_buffer)) {
+ if ((
!tdi_buffer) || (!tdo_buffer) || (!
tms_buffer)) {
vsllink_quit();
return ERROR_FAIL;
}
vsllink_quit();
return ERROR_FAIL;
}