Skip to content

Commit

Permalink
jtag: stlink_usb: drop comparison to NULL
Browse files Browse the repository at this point in the history
Fix checkpatch error:

	ERROR:COMPARISON_TO_NULL: Comparison to NULL could be
	written "handle"

Change-Id: I0ac12ccfc5fce4dd41266f83eb4b973a4e6a314d
Signed-off-by: Antonio Borneo <[email protected]>
Reviewed-on: https://review.openocd.org/c/openocd/+/8494
Reviewed-by: zapb <[email protected]>
Tested-by: jenkins
  • Loading branch information
borneoa committed Oct 5, 2024
1 parent 4214fca commit 39197cd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/jtag/drivers/stlink_usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -2754,7 +2754,7 @@ static int stlink_usb_read_mem32_noaddrinc(void *handle, uint8_t ap_num, uint32_
{
struct stlink_usb_handle *h = handle;

assert(handle != NULL);
assert(handle);

if (!(h->version.flags & STLINK_F_HAS_MEM_RD_NO_INC))
return ERROR_COMMAND_NOTFOUND;
Expand Down Expand Up @@ -2796,7 +2796,7 @@ static int stlink_usb_write_mem32_noaddrinc(void *handle, uint8_t ap_num, uint32
{
struct stlink_usb_handle *h = handle;

assert(handle != NULL);
assert(handle);

if (!(h->version.flags & STLINK_F_HAS_MEM_WR_NO_INC))
return ERROR_COMMAND_NOTFOUND;
Expand Down Expand Up @@ -3947,7 +3947,7 @@ static int stlink_usb_rw_misc_out(void *handle, uint32_t items, const uint8_t *b

LOG_DEBUG_IO("%s(%" PRIu32 ")", __func__, items);

assert(handle != NULL);
assert(handle);

if (!(h->version.flags & STLINK_F_HAS_RW_MISC))
return ERROR_COMMAND_NOTFOUND;
Expand All @@ -3968,7 +3968,7 @@ static int stlink_usb_rw_misc_in(void *handle, uint32_t items, uint8_t *buffer)

LOG_DEBUG_IO("%s(%" PRIu32 ")", __func__, items);

assert(handle != NULL);
assert(handle);

if (!(h->version.flags & STLINK_F_HAS_RW_MISC))
return ERROR_COMMAND_NOTFOUND;
Expand Down

0 comments on commit 39197cd

Please sign in to comment.