const char *jtag_tap_name(const struct jtag_tap *tap)
{
- return (tap == NULL) ? "(unknown)" : tap->dotted_name;
+ return (!tap) ? "(unknown)" : tap->dotted_name;
}
{
struct jtag_event_callback **callbacks_p = &jtag_event_callbacks;
- if (callback == NULL)
+ if (!callback)
return ERROR_COMMAND_SYNTAX_ERROR;
if (*callbacks_p) {
{
struct jtag_event_callback **p = &jtag_event_callbacks, *temp;
- if (callback == NULL)
+ if (!callback)
return ERROR_COMMAND_SYNTAX_ERROR;
while (*p) {
void jtag_add_plain_ir_scan(int num_bits, const uint8_t *out_bits, uint8_t *in_bits,
tap_state_t state)
{
- assert(out_bits != NULL);
+ assert(out_bits);
assert(state != TAP_RESET);
jtag_prelude(state);
void jtag_add_plain_dr_scan(int num_bits, const uint8_t *out_bits, uint8_t *in_bits,
tap_state_t state)
{
- assert(out_bits != NULL);
+ assert(out_bits);
assert(state != TAP_RESET);
jtag_prelude(state);
void jtag_check_value_mask(struct scan_field *field, uint8_t *value, uint8_t *mask)
{
- assert(field->in_value != NULL);
+ assert(field->in_value);
- if (value == NULL) {
+ if (!value) {
/* no checking to do */
return;
}
int default_interface_jtag_execute_queue(void)
{
- if (NULL == jtag) {
+ if (!jtag) {
LOG_ERROR("No JTAG interface configured yet. "
"Issue 'init' command in startup scripts "
"before communicating with targets.");
max_taps++;
uint8_t *idcode_buffer = calloc(4, max_taps);
- if (idcode_buffer == NULL)
+ if (!idcode_buffer)
return ERROR_JTAG_INIT_FAILED;
/* DR scan to collect BYPASS or IDCODE register contents.
uint32_t idcode = buf_get_u32(idcode_buffer, bit_count, 32);
/* No predefined TAP? Auto-probe. */
- if (tap == NULL) {
+ if (!tap) {
/* Is there another TAP? */
if (jtag_idcode_is_final(idcode))
break;
total_ir_length += 2;
ir_test = malloc(DIV_ROUND_UP(total_ir_length, 8));
- if (ir_test == NULL)
+ if (!ir_test)
return ERROR_FAIL;
/* after this scan, all TAPs will capture BYPASS instructions */
for (;; ) {
tap = jtag_tap_next_enabled(tap);
- if (tap == NULL)
+ if (!tap)
break;
/* If we're autoprobing, guess IR lengths. They must be at
return retval;
jtag = adapter_driver;
- if (jtag->speed == NULL) {
+ if (!jtag->speed) {
LOG_INFO("This adapter doesn't support configurable speed");
return ERROR_OK;
}
LOG_DEBUG("Init JTAG chain");
tap = jtag_tap_next_enabled(NULL);
- if (tap == NULL) {
+ if (!tap) {
/* Once JTAG itself is properly set up, and the scan chain
* isn't absurdly large, IDCODE autoprobe should work fine.
*
int jtag_power_dropout(int *dropout)
{
- if (jtag == NULL) {
+ if (!jtag) {
/* TODO: as the jtag interface is not valid all
* we can do at the moment is exit OpenOCD */
LOG_ERROR("No Valid JTAG Interface Configured.");