Skip to content

Commit

Permalink
flash/nor: remove useless bank->next = NULL
Browse files Browse the repository at this point in the history
struct flash_bank must be zeroed anyway, calloc() is always used.

Signed-off-by: Tomas Vanek <[email protected]>
Change-Id: I7ab3b9c66f99688c6095a0a547a05448c9e37d68
Reviewed-on: https://review.openocd.org/c/openocd/+/7885
Tested-by: jenkins
Reviewed-by: Antonio Borneo <[email protected]>
  • Loading branch information
tom-van authored and borneoa committed Sep 23, 2023
1 parent 040757b commit c20cb28
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 5 deletions.
2 changes: 0 additions & 2 deletions src/flash/nor/at91sam7.c
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,6 @@ static int at91sam7_read_part_info(struct flash_bank *bank)
return ERROR_FAIL;
}
fb->name = strdup("sam7_probed");
fb->next = NULL;

/* link created bank in 'flash_banks' list */
t_bank->next = fb;
Expand Down Expand Up @@ -765,7 +764,6 @@ FLASH_BANK_COMMAND_HANDLER(at91sam7_flash_bank_command)
return ERROR_FAIL;
}
fb->name = strdup("sam7_probed");
fb->next = NULL;

/* link created bank in 'flash_banks' list */
t_bank->next = fb;
Expand Down
1 change: 0 additions & 1 deletion src/flash/nor/cc26xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,6 @@ FLASH_BANK_COMMAND_HANDLER(cc26xx_flash_bank_command)

/* Finish initialization of bank */
bank->driver_priv = cc26xx_bank;
bank->next = NULL;

return ERROR_OK;
}
Expand Down
1 change: 0 additions & 1 deletion src/flash/nor/cc3220sf.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ FLASH_BANK_COMMAND_HANDLER(cc3220sf_flash_bank_command)

/* Finish initialization of flash bank */
bank->driver_priv = cc3220sf_bank;
bank->next = NULL;

return ERROR_OK;
}
Expand Down
1 change: 0 additions & 1 deletion src/flash/nor/npcx.c
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,6 @@ FLASH_BANK_COMMAND_HANDLER(npcx_flash_bank_command)

/* Finish initialization of bank */
bank->driver_priv = npcx_bank;
bank->next = NULL;

return ERROR_OK;
}
Expand Down

0 comments on commit c20cb28

Please sign in to comment.