]> www.infradead.org Git - users/borneoa/openocd-next.git/commitdiff
jtag: stlink_usb: drop comparison to NULL
authorAntonio Borneo <borneo.antonio@gmail.com>
Mon, 16 Sep 2024 09:36:03 +0000 (11:36 +0200)
committerAntonio Borneo <borneo.antonio@gmail.com>
Sat, 5 Oct 2024 15:48:35 +0000 (15:48 +0000)
Fix checkpatch error:

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

Change-Id: I0ac12ccfc5fce4dd41266f83eb4b973a4e6a314d
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8494
Reviewed-by: zapb <dev@zapb.de>
Tested-by: jenkins
src/jtag/drivers/stlink_usb.c

index 812a192c220da9f31a18f92efea1b318408f304a..0385e4d857654c95cdb6f5979b7e729cc7de8575 100644 (file)
@@ -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;
@@ -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;
@@ -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;
@@ -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;