]> git.gag.com Git - fw/openocd/commitdiff
target: do not cast NULL in assignment
authorAntonio Borneo <borneo.antonio@gmail.com>
Sat, 4 Sep 2021 21:22:27 +0000 (23:22 +0200)
committerAntonio Borneo <borneo.antonio@gmail.com>
Sat, 18 Sep 2021 15:26:14 +0000 (15:26 +0000)
NULL is defined as 'void *'.
There is no need to cast NULL while assigning it to a pointer.

Change-Id: Ibaf18e5d47329707ec9c1c184cd4bba2e8e702ff
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/6540
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com>
Tested-by: jenkins
src/target/target.c

index 49f205a975cf27b1d46e1ff39066511b7def1554..6571e9c6fd05244f9f8e8184015865e3263735ec 100644 (file)
@@ -5978,10 +5978,10 @@ static int jim_target_smp(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
        int i;
        const char *targetname;
        int retval, len;
-       struct target *target = (struct target *) NULL;
+       struct target *target = NULL;
        struct target_list *head, *curr, *new;
-       curr = (struct target_list *) NULL;
-       head = (struct target_list *) NULL;
+       curr = NULL;
+       head = NULL;
 
        retval = 0;
        LOG_DEBUG("%d", argc);
@@ -5998,7 +5998,7 @@ static int jim_target_smp(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
                if (target) {
                        new = malloc(sizeof(struct target_list));
                        new->target = target;
-                       new->next = (struct target_list *)NULL;
+                       new->next = NULL;
                        if (!head) {
                                head = new;
                                curr = head;