From: OpenOCD-Gerrit <ope...@us...> - 2020-07-08 21:06:24
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 46238fabb9d5c9b81de1151312babedb88423fd9 (commit) via 8375deea2cd37965fff2570e1132607e0a399335 (commit) via 7e8efccb596d8aee1a4ec5b94970a94af2e296e4 (commit) via 6a1de20a7c8c8fa0057a914a1cdf3f0b514cf7c3 (commit) via 8fc00a38bc54ce6f42d0ed1d9dc3588e58bbb73e (commit) from 70f69f872857fd94ed252088d00e071e57d07b39 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 46238fabb9d5c9b81de1151312babedb88423fd9 Author: Marc Schink <de...@za...> Date: Wed Jul 1 10:23:23 2020 +0200 flash/nor/atsamv: Use 'bool' data type Change-Id: Id4ceaf38dc5eba5b0eb62416fc357fdfc7ea21c0 Signed-off-by: Marc Schink <de...@za...> Reviewed-on: http://openocd.zylin.com/5737 Tested-by: jenkins Reviewed-by: Antonio Borneo <bor...@gm...> diff --git a/src/flash/nor/atsamv.c b/src/flash/nor/atsamv.c index 13d1d263f..1ad37c1ab 100644 --- a/src/flash/nor/atsamv.c +++ b/src/flash/nor/atsamv.c @@ -97,7 +97,7 @@ extern const struct flash_driver atsamv_flash; struct samv_flash_bank { - int probed; + bool probed; unsigned size_bytes; unsigned gpnvm[SAMV_NUM_GPNVM_BITS]; }; @@ -379,7 +379,7 @@ static int samv_probe(struct flash_bank *bank) struct samv_flash_bank *samv_info = bank->driver_priv; samv_info->size_bytes = bank->size; - samv_info->probed = 1; + samv_info->probed = true; bank->base = SAMV_FLASH_BASE; bank->num_sectors = bank->size / SAMV_SECTOR_SIZE; commit 8375deea2cd37965fff2570e1132607e0a399335 Author: Marc Schink <de...@za...> Date: Wed Jul 1 10:22:37 2020 +0200 flash/nor/ath79: Use 'bool' data type Change-Id: Iecd29dcfcc1ae983e4e0828025d2d174944c1e9d Signed-off-by: Marc Schink <de...@za...> Reviewed-on: http://openocd.zylin.com/5736 Tested-by: jenkins Reviewed-by: Antonio Borneo <bor...@gm...> diff --git a/src/flash/nor/ath79.c b/src/flash/nor/ath79.c index 88ebbf23c..c30ddf3c0 100644 --- a/src/flash/nor/ath79.c +++ b/src/flash/nor/ath79.c @@ -89,7 +89,7 @@ struct ath79_spi_ctx { }; struct ath79_flash_bank { - int probed; + bool probed; int chipselect; uint32_t io_base; const struct flash_device *dev; @@ -777,7 +777,7 @@ static int ath79_probe(struct flash_bank *bank) free(bank->sectors); free(ath79_info->spi.page_buf); } - ath79_info->probed = 0; + ath79_info->probed = false; for (target_device = target_devices; target_device->name; ++target_device) @@ -850,7 +850,7 @@ static int ath79_probe(struct flash_bank *bank) } bank->sectors = sectors; - ath79_info->probed = 1; + ath79_info->probed = true; return ERROR_OK; } commit 7e8efccb596d8aee1a4ec5b94970a94af2e296e4 Author: Marc Schink <de...@za...> Date: Wed Jul 1 10:22:15 2020 +0200 flash/nor/at91sam4: Use 'bool' data type Change-Id: Iade91ac58a995676c412606a63e62b70337427f1 Signed-off-by: Marc Schink <de...@za...> Reviewed-on: http://openocd.zylin.com/5735 Tested-by: jenkins Reviewed-by: Antonio Borneo <bor...@gm...> diff --git a/src/flash/nor/at91sam4.c b/src/flash/nor/at91sam4.c index 26cde19bc..f2827496d 100644 --- a/src/flash/nor/at91sam4.c +++ b/src/flash/nor/at91sam4.c @@ -166,7 +166,7 @@ struct sam4_cfg { }; struct sam4_bank_private { - int probed; + bool probed; /* DANGER: THERE ARE DRAGONS HERE.. */ /* NOTE: If you add more 'ghost' pointers */ /* be aware that you must *manually* update */ @@ -212,7 +212,7 @@ struct sam4_chip_details { struct sam4_chip { struct sam4_chip *next; - int probed; + bool probed; /* this is "initialized" from the global const structure */ struct sam4_chip_details details; @@ -275,14 +275,14 @@ static const struct sam4_chip_details all_sam4_details[] = { /* .bank[0] = { */ { { - .probed = 0, + .probed = false, .pChip = NULL, .pBank = NULL, .bank_number = 0, .base_address = FLASH_BANK0_BASE_C32, .controller_address = 0x400e0a00, .flash_wait_states = 5, - .present = 1, + .present = true, .size_bytes = 1024 * 1024, .nsectors = 128, .sector_size = 8192, @@ -290,14 +290,14 @@ static const struct sam4_chip_details all_sam4_details[] = { }, /* .bank[1] = { */ { - .probed = 0, + .probed = false, .pChip = NULL, .pBank = NULL, .bank_number = 1, .base_address = FLASH_BANK1_BASE_C32, .controller_address = 0x400e0c00, .flash_wait_states = 5, - .present = 1, + .present = true, .size_bytes = 1024 * 1024, .nsectors = 128, .sector_size = 8192, @@ -316,14 +316,14 @@ static const struct sam4_chip_details all_sam4_details[] = { /* .bank[0] = { */ { { - .probed = 0, + .probed = false, .pChip = NULL, .pBank = NULL, .bank_number = 0, .base_address = FLASH_BANK0_BASE_C32, .controller_address = 0x400e0a00, .flash_wait_states = 5, - .present = 1, + .present = true, .size_bytes = 1024 * 1024, .nsectors = 128, .sector_size = 8192, @@ -331,14 +331,14 @@ static const struct sam4_chip_details all_sam4_details[] = { }, /* .bank[1] = { */ { - .probed = 0, + .probed = false, .pChip = NULL, .pBank = NULL, .bank_number = 1, .base_address = FLASH_BANK1_BASE_C32, .controller_address = 0x400e0c00, .flash_wait_states = 5, - .present = 1, + .present = true, .size_bytes = 1024 * 1024, .nsectors = 128, .sector_size = 8192, @@ -357,14 +357,14 @@ static const struct sam4_chip_details all_sam4_details[] = { { /* .bank[0] = {*/ { - .probed = 0, + .probed = false, .pChip = NULL, .pBank = NULL, .bank_number = 0, .base_address = FLASH_BANK_BASE_C, .controller_address = 0x400e0a00, .flash_wait_states = 5, - .present = 1, + .present = true, .size_bytes = 1024 * 1024, .nsectors = 128, .sector_size = 8192, @@ -372,8 +372,8 @@ static const struct sam4_chip_details all_sam4_details[] = { }, /* .bank[1] = {*/ { - .present = 0, - .probed = 0, + .present = false, + .probed = false, .bank_number = 1, }, @@ -390,14 +390,14 @@ static const struct sam4_chip_details all_sam4_details[] = { { /* .bank[0] = {*/ { - .probed = 0, + .probed = false, .pChip = NULL, .pBank = NULL, .bank_number = 0, .base_address = FLASH_BANK_BASE_C, .controller_address = 0x400e0a00, .flash_wait_states = 5, - .present = 1, + .present = true, .size_bytes = 512 * 1024, .nsectors = 64, .sector_size = 8192, @@ -405,8 +405,8 @@ static const struct sam4_chip_details all_sam4_details[] = { }, /* .bank[1] = {*/ { - .present = 0, - .probed = 0, + .present = false, + .probed = false, .bank_number = 1, }, @@ -423,14 +423,14 @@ static const struct sam4_chip_details all_sam4_details[] = { { /* .bank[0] = {*/ { - .probed = 0, + .probed = false, .pChip = NULL, .pBank = NULL, .bank_number = 0, .base_address = FLASH_BANK_BASE_C, .controller_address = 0x400e0a00, .flash_wait_states = 5, - .present = 1, + .present = true, .size_bytes = 256 * 1024, .nsectors = 32, .sector_size = 8192, @@ -438,8 +438,8 @@ static const struct sam4_chip_details all_sam4_details[] = { }, /* .bank[1] = {*/ { - .present = 0, - .probed = 0, + .present = false, + .probed = false, .bank_number = 1, }, @@ -458,14 +458,14 @@ static const struct sam4_chip_details all_sam4_details[] = { { /* .bank[0] = {*/ { - .probed = 0, + .probed = false, .pChip = NULL, .pBank = NULL, .bank_number = 0, .base_address = FLASH_BANK_BASE_S, .controller_address = 0x400e0a00, .flash_wait_states = 5, - .present = 1, + .present = true, .size_bytes = 1024 * 1024, .nsectors = 128, .sector_size = 8192, @@ -473,8 +473,8 @@ static const struct sam4_chip_details all_sam4_details[] = { }, /* .bank[1] = {*/ { - .present = 0, - .probed = 0, + .present = false, + .probed = false, .bank_number = 1, }, @@ -493,14 +493,14 @@ static const struct sam4_chip_details all_sam4_details[] = { { /* .bank[0] = {*/ { - .probed = 0, + .probed = false, .pChip = NULL, .pBank = NULL, .bank_number = 0, .base_address = FLASH_BANK_BASE_S, .controller_address = 0x400e0a00, .flash_wait_states = 5, - .present = 1, + .present = true, .size_bytes = 512 * 1024, .nsectors = 64, .sector_size = 8192, @@ -508,8 +508,8 @@ static const struct sam4_chip_details all_sam4_details[] = { }, /* .bank[1] = {*/ { - .present = 0, - .probed = 0, + .present = false, + .probed = false, .bank_number = 1, }, @@ -526,14 +526,14 @@ static const struct sam4_chip_details all_sam4_details[] = { { /* .bank[0] = {*/ { - .probed = 0, + .probed = false, .pChip = NULL, .pBank = NULL, .bank_number = 0, .base_address = FLASH_BANK_BASE_S, .controller_address = 0x400e0a00, .flash_wait_states = 5, - .present = 1, + .present = true, .size_bytes = 512 * 1024, .nsectors = 64, .sector_size = 8192, @@ -541,8 +541,8 @@ static const struct sam4_chip_details all_sam4_details[] = { }, /* .bank[1] = {*/ { - .present = 0, - .probed = 0, + .present = false, + .probed = false, .bank_number = 1, }, @@ -559,14 +559,14 @@ static const struct sam4_chip_details all_sam4_details[] = { { /* .bank[0] = {*/ { - .probed = 0, + .probed = false, .pChip = NULL, .pBank = NULL, .bank_number = 0, .base_address = FLASH_BANK_BASE_S, .controller_address = 0x400e0a00, .flash_wait_states = 5, - .present = 1, + .present = true, .size_bytes = 512 * 1024, .nsectors = 64, .sector_size = 8192, @@ -574,8 +574,8 @@ static const struct sam4_chip_details all_sam4_details[] = { }, /* .bank[1] = {*/ { - .present = 0, - .probed = 0, + .present = false, + .probed = false, .bank_number = 1, }, @@ -592,14 +592,14 @@ static const struct sam4_chip_details all_sam4_details[] = { { /* .bank[0] = {*/ { - .probed = 0, + .probed = false, .pChip = NULL, .pBank = NULL, .bank_number = 0, .base_address = FLASH_BANK_BASE_S, .controller_address = 0x400e0a00, .flash_wait_states = 5, - .present = 1, + .present = true, .size_bytes = 1024 * 1024, .nsectors = 128, .sector_size = 8192, @@ -607,8 +607,8 @@ static const struct sam4_chip_details all_sam4_details[] = { }, /* .bank[1] = {*/ { - .present = 0, - .probed = 0, + .present = false, + .probed = false, .bank_number = 1, }, @@ -625,14 +625,14 @@ static const struct sam4_chip_details all_sam4_details[] = { { /* .bank[0] = {*/ { - .probed = 0, + .probed = false, .pChip = NULL, .pBank = NULL, .bank_number = 0, .base_address = FLASH_BANK_BASE_S, .controller_address = 0x400e0a00, .flash_wait_states = 5, - .present = 1, + .present = true, .size_bytes = 1024 * 1024, .nsectors = 128, .sector_size = 8192, @@ -640,8 +640,8 @@ static const struct sam4_chip_details all_sam4_details[] = { }, /* .bank[1] = {*/ { - .present = 0, - .probed = 0, + .present = false, + .probed = false, .bank_number = 1, }, @@ -660,14 +660,14 @@ static const struct sam4_chip_details all_sam4_details[] = { { /* .bank[0] = {*/ { - .probed = 0, + .probed = false, .pChip = NULL, .pBank = NULL, .bank_number = 0, .base_address = FLASH_BANK_BASE_S, .controller_address = 0x400e0a00, .flash_wait_states = 5, - .present = 1, + .present = true, .size_bytes = 1024 * 1024, .nsectors = 128, .sector_size = 8192, @@ -675,8 +675,8 @@ static const struct sam4_chip_details all_sam4_details[] = { }, /* .bank[1] = {*/ { - .present = 0, - .probed = 0, + .present = false, + .probed = false, .bank_number = 1, }, @@ -694,14 +694,14 @@ static const struct sam4_chip_details all_sam4_details[] = { /* .bank[0] = { */ { { - .probed = 0, + .probed = false, .pChip = NULL, .pBank = NULL, .bank_number = 0, .base_address = FLASH_BANK_BASE_S, .controller_address = 0x400e0a00, .flash_wait_states = 5, - .present = 1, + .present = true, .size_bytes = 1024 * 1024, .nsectors = 128, .sector_size = 8192, @@ -709,8 +709,8 @@ static const struct sam4_chip_details all_sam4_details[] = { }, /* .bank[1] = {*/ { - .present = 0, - .probed = 0, + .present = false, + .probed = false, .bank_number = 1, }, @@ -727,14 +727,14 @@ static const struct sam4_chip_details all_sam4_details[] = { { /* .bank[0] = {*/ { - .probed = 0, + .probed = false, .pChip = NULL, .pBank = NULL, .bank_number = 0, .base_address = FLASH_BANK_BASE_S, .controller_address = 0x400e0a00, .flash_wait_states = 5, - .present = 1, + .present = true, .size_bytes = 1024 * 1024, .nsectors = 128, .sector_size = 8192, @@ -742,8 +742,8 @@ static const struct sam4_chip_details all_sam4_details[] = { }, /* .bank[1] = {*/ { - .present = 0, - .probed = 0, + .present = false, + .probed = false, .bank_number = 1, }, @@ -760,14 +760,14 @@ static const struct sam4_chip_details all_sam4_details[] = { { /* .bank[0] = {*/ { - .probed = 0, + .probed = false, .pChip = NULL, .pBank = NULL, .bank_number = 0, .base_address = FLASH_BANK_BASE_S, .controller_address = 0x400e0a00, .flash_wait_states = 5, - .present = 1, + .present = true, .size_bytes = 1024 * 1024, .nsectors = 128, .sector_size = 8192, @@ -775,8 +775,8 @@ static const struct sam4_chip_details all_sam4_details[] = { }, /* .bank[1] = {*/ { - .present = 0, - .probed = 0, + .present = false, + .probed = false, .bank_number = 1, }, @@ -793,14 +793,14 @@ static const struct sam4_chip_details all_sam4_details[] = { { /* .bank[0] = {*/ { - .probed = 0, + .probed = false, .pChip = NULL, .pBank = NULL, .bank_number = 0, .base_address = FLASH_BANK_BASE_S, .controller_address = 0x400e0a00, .flash_wait_states = 5, - .present = 1, + .present = true, .size_bytes = 1024 * 1024, .nsectors = 128, .sector_size = 8192, @@ -808,8 +808,8 @@ static const struct sam4_chip_details all_sam4_details[] = { }, /* .bank[1] = {*/ { - .present = 0, - .probed = 0, + .present = false, + .probed = false, .bank_number = 1, }, @@ -826,14 +826,14 @@ static const struct sam4_chip_details all_sam4_details[] = { { /* .bank[0] = {*/ { - .probed = 0, + .probed = false, .pChip = NULL, .pBank = NULL, .bank_number = 0, .base_address = FLASH_BANK_BASE_S, .controller_address = 0x400e0a00, .flash_wait_states = 5, - .present = 1, + .present = true, .size_bytes = 512 * 1024, .nsectors = 64, .sector_size = 8192, @@ -841,8 +841,8 @@ static const struct sam4_chip_details all_sam4_details[] = { }, /* .bank[1] = {*/ { - .present = 0, - .probed = 0, + .present = false, + .probed = false, .bank_number = 1, }, @@ -859,14 +859,14 @@ static const struct sam4_chip_details all_sam4_details[] = { { /* .bank[0] = {*/ { - .probed = 0, + .probed = false, .pChip = NULL, .pBank = NULL, .bank_number = 0, .base_address = FLASH_BANK_BASE_S, .controller_address = 0x400e0a00, .flash_wait_states = 5, - .present = 1, + .present = true, .size_bytes = 512 * 1024, .nsectors = 64, .sector_size = 8192, @@ -874,8 +874,8 @@ static const struct sam4_chip_details all_sam4_details[] = { }, /* .bank[1] = {*/ { - .present = 0, - .probed = 0, + .present = false, + .probed = false, .bank_number = 1, }, @@ -892,14 +892,14 @@ static const struct sam4_chip_details all_sam4_details[] = { { /* .bank[0] = {*/ { - .probed = 0, + .probed = false, .pChip = NULL, .pBank = NULL, .bank_number = 0, .base_address = FLASH_BANK_BASE_S, .controller_address = 0x400e0a00, .flash_wait_states = 5, - .present = 1, + .present = true, .size_bytes = 512 * 1024, .nsectors = 64, .sector_size = 8192, @@ -907,8 +907,8 @@ static const struct sam4_chip_details all_sam4_details[] = { }, /* .bank[1] = {*/ { - .present = 0, - .probed = 0, + .present = false, + .probed = false, .bank_number = 1, }, @@ -926,14 +926,14 @@ static const struct sam4_chip_details all_sam4_details[] = { { /* .bank[0] = {*/ { - .probed = 0, + .probed = false, .pChip = NULL, .pBank = NULL, .bank_number = 0, .base_address = FLASH_BANK_BASE_S, .controller_address = 0x400e0a00, .flash_wait_states = 5, - .present = 1, + .present = true, .size_bytes = 256 * 1024, .nsectors = 32, .sector_size = 8192, @@ -941,8 +941,8 @@ static const struct sam4_chip_details all_sam4_details[] = { }, /* .bank[1] = {*/ { - .present = 0, - .probed = 0, + .present = false, + .probed = false, .bank_number = 1, }, @@ -960,14 +960,14 @@ static const struct sam4_chip_details all_sam4_details[] = { { /* .bank[0] = {*/ { - .probed = 0, + .probed = false, .pChip = NULL, .pBank = NULL, .bank_number = 0, .base_address = FLASH_BANK_BASE_S, .controller_address = 0x400e0a00, .flash_wait_states = 5, - .present = 1, + .present = true, .size_bytes = 256 * 1024, .nsectors = 32, .sector_size = 8192, @@ -975,8 +975,8 @@ static const struct sam4_chip_details all_sam4_details[] = { }, /* .bank[1] = {*/ { - .present = 0, - .probed = 0, + .present = false, + .probed = false, .bank_number = 1, }, @@ -994,14 +994,14 @@ static const struct sam4_chip_details all_sam4_details[] = { { /* .bank[0] = {*/ { - .probed = 0, + .probed = false, .pChip = NULL, .pBank = NULL, .bank_number = 0, .base_address = FLASH_BANK_BASE_S, .controller_address = 0x400e0a00, .flash_wait_states = 5, - .present = 1, + .present = true, .size_bytes = 256 * 1024, .nsectors = 32, .sector_size = 8192, @@ -1009,8 +1009,8 @@ static const struct sam4_chip_details all_sam4_details[] = { }, /* .bank[1] = {*/ { - .present = 0, - .probed = 0, + .present = false, + .probed = false, .bank_number = 1, }, @@ -1028,14 +1028,14 @@ static const struct sam4_chip_details all_sam4_details[] = { { /* .bank[0] = {*/ { - .probed = 0, + .probed = false, .pChip = NULL, .pBank = NULL, .bank_number = 0, .base_address = FLASH_BANK_BASE_S, .controller_address = 0x400e0a00, .flash_wait_states = 5, - .present = 1, + .present = true, .size_bytes = 128 * 1024, .nsectors = 16, .sector_size = 8192, @@ -1043,8 +1043,8 @@ static const struct sam4_chip_details all_sam4_details[] = { }, /* .bank[1] = {*/ { - .present = 0, - .probed = 0, + .present = false, + .probed = false, .bank_number = 1, }, @@ -1062,14 +1062,14 @@ static const struct sam4_chip_details all_sam4_details[] = { { /* .bank[0] = {*/ { - .probed = 0, + .probed = false, .pChip = NULL, .pBank = NULL, .bank_number = 0, .base_address = FLASH_BANK_BASE_S, .controller_address = 0x400e0a00, .flash_wait_states = 5, - .present = 1, + .present = true, .size_bytes = 128 * 1024, .nsectors = 16, .sector_size = 8192, @@ -1077,8 +1077,8 @@ static const struct sam4_chip_details all_sam4_details[] = { }, /* .bank[1] = {*/ { - .present = 0, - .probed = 0, + .present = false, + .probed = false, .bank_number = 1, }, @@ -1096,14 +1096,14 @@ static const struct sam4_chip_details all_sam4_details[] = { { /* .bank[0] = {*/ { - .probed = 0, + .probed = false, .pChip = NULL, .pBank = NULL, .bank_number = 0, .base_address = FLASH_BANK_BASE_S, .controller_address = 0x400e0a00, .flash_wait_states = 5, - .present = 1, + .present = true, .size_bytes = 128 * 1024, .nsectors = 16, .sector_size = 8192, @@ -1111,8 +1111,8 @@ static const struct sam4_chip_details all_sam4_details[] = { }, /* .bank[1] = {*/ { - .present = 0, - .probed = 0, + .present = false, + .probed = false, .bank_number = 1, }, @@ -1131,14 +1131,14 @@ static const struct sam4_chip_details all_sam4_details[] = { /* .bank[0] = { */ { { - .probed = 0, + .probed = false, .pChip = NULL, .pBank = NULL, .bank_number = 0, .base_address = FLASH_BANK0_BASE_SD, .controller_address = 0x400e0a00, .flash_wait_states = 5, - .present = 1, + .present = true, .size_bytes = 1024 * 1024, .nsectors = 128, .sector_size = 8192, @@ -1147,14 +1147,14 @@ static const struct sam4_chip_details all_sam4_details[] = { /* .bank[1] = { */ { - .probed = 0, + .probed = false, .pChip = NULL, .pBank = NULL, .bank_number = 1, .base_address = FLASH_BANK1_BASE_2048K_SD, .controller_address = 0x400e0c00, .flash_wait_states = 5, - .present = 1, + .present = true, .size_bytes = 1024 * 1024, .nsectors = 128, .sector_size = 8192, @@ -1175,14 +1175,14 @@ static const struct sam4_chip_details all_sam4_details[] = { /* .bank[0] = { */ { { - .probed = 0, + .probed = false, .pChip = NULL, .pBank = NULL, .bank_number = 0, .base_address = FLASH_BANK0_BASE_SD, .controller_address = 0x400e0a00, .flash_wait_states = 5, - .present = 1, + .present = true, .size_bytes = 1024 * 1024, .nsectors = 128, .sector_size = 8192, @@ -1191,14 +1191,14 @@ static const struct sam4_chip_details all_sam4_details[] = { /* .bank[1] = { */ { - .probed = 0, + .probed = false, .pChip = NULL, .pBank = NULL, .bank_number = 1, .base_address = FLASH_BANK1_BASE_2048K_SD, .controller_address = 0x400e0c00, .flash_wait_states = 5, - .present = 1, + .present = true, .size_bytes = 1024 * 1024, .nsectors = 128, .sector_size = 8192, @@ -1219,14 +1219,14 @@ static const struct sam4_chip_details all_sam4_details[] = { /* .bank[0] = { */ { { - .probed = 0, + .probed = false, .pChip = NULL, .pBank = NULL, .bank_number = 0, .base_address = FLASH_BANK0_BASE_SD, .controller_address = 0x400e0a00, .flash_wait_states = 5, - .present = 1, + .present = true, .size_bytes = 512 * 1024, .nsectors = 64, .sector_size = 8192, @@ -1235,14 +1235,14 @@ static const struct sam4_chip_details all_sam4_details[] = { /* .bank[1] = { */ { - .probed = 0, + .probed = false, .pChip = NULL, .pBank = NULL, .bank_number = 1, .base_address = FLASH_BANK1_BASE_1024K_SD, .controller_address = 0x400e0c00, .flash_wait_states = 5, - .present = 1, + .present = true, .size_bytes = 512 * 1024, .nsectors = 64, .sector_size = 8192, @@ -1263,14 +1263,14 @@ static const struct sam4_chip_details all_sam4_details[] = { /* .bank[0] = { */ { { - .probed = 0, + .probed = false, .pChip = NULL, .pBank = NULL, .bank_number = 0, .base_address = FLASH_BANK0_BASE_SD, .controller_address = 0x400e0a00, .flash_wait_states = 5, - .present = 1, + .present = true, .size_bytes = 512 * 1024, .nsectors = 64, .sector_size = 8192, @@ -1279,14 +1279,14 @@ static const struct sam4_chip_details all_sam4_details[] = { /* .bank[1] = { */ { - .probed = 0, + .probed = false, .pChip = NULL, .pBank = NULL, .bank_number = 1, .base_address = FLASH_BANK1_BASE_1024K_SD, .controller_address = 0x400e0c00, .flash_wait_states = 5, - .present = 1, + .present = true, .size_bytes = 512 * 1024, .nsectors = 64, .sector_size = 8192, @@ -1307,14 +1307,14 @@ static const struct sam4_chip_details all_sam4_details[] = { /* .bank[0] = {*/ { { - .probed = 0, + .probed = false, .pChip = NULL, .pBank = NULL, .bank_number = 0, .base_address = FLASH_BANK_BASE_S, .controller_address = 0x400e0a00, .flash_wait_states = 5, - .present = 1, + .present = true, .size_bytes = 512 * 1024, .nsectors = 64, .sector_size = 8192, @@ -1322,8 +1322,8 @@ static const struct sam4_chip_details all_sam4_details[] = { }, /* .bank[1] = {*/ { - .present = 0, - .probed = 0, + .present = false, + .probed = false, .bank_number = 1, }, @@ -1342,14 +1342,14 @@ static const struct sam4_chip_details all_sam4_details[] = { { /* .bank[0] = */ { - .probed = 0, + .probed = false, .pChip = NULL, .pBank = NULL, .bank_number = 0, .base_address = FLASH_BANK_BASE_S, .controller_address = 0x400e0a00, .flash_wait_states = 5, - .present = 1, + .present = true, .size_bytes = 512 * 1024, .nsectors = 64, .sector_size = 8192, @@ -1357,8 +1357,8 @@ static const struct sam4_chip_details all_sam4_details[] = { }, /* .bank[1] = */ { - .present = 0, - .probed = 0, + .present = false, + .probed = false, .bank_number = 1, }, } @@ -1376,14 +1376,14 @@ static const struct sam4_chip_details all_sam4_details[] = { { /* .bank[0] = */ { - .probed = 0, + .probed = false, .pChip = NULL, .pBank = NULL, .bank_number = 0, .base_address = FLASH_BANK_BASE_S, .controller_address = 0x400e0a00, .flash_wait_states = 5, - .present = 1, + .present = true, .size_bytes = 512 * 1024, .nsectors = 64, .sector_size = 8192, @@ -1391,8 +1391,8 @@ static const struct sam4_chip_details all_sam4_details[] = { }, /* .bank[1] = */ { - .present = 0, - .probed = 0, + .present = false, + .probed = false, .bank_number = 1, }, } @@ -2472,7 +2472,7 @@ FLASH_BANK_COMMAND_HANDLER(sam4_flash_bank_command) pChip->target = bank->target; /* assumption is this runs at 32khz */ pChip->cfg.slow_freq = 32768; - pChip->probed = 0; + pChip->probed = false; } switch (bank->base) { @@ -2664,7 +2664,7 @@ static int sam4_probe(struct flash_bank *bank) } } - pPrivate->probed = 1; + pPrivate->probed = true; r = sam4_protect_check(bank); if (r != ERROR_OK) commit 6a1de20a7c8c8fa0057a914a1cdf3f0b514cf7c3 Author: Marc Schink <de...@za...> Date: Wed Jul 1 10:21:52 2020 +0200 flash/nor/at91sam3: Use 'bool' data type Change-Id: Ibaf599a4ab88ea36a84b3389e2f704554d465434 Signed-off-by: Marc Schink <de...@za...> Reviewed-on: http://openocd.zylin.com/5734 Tested-by: jenkins Reviewed-by: Antonio Borneo <bor...@gm...> diff --git a/src/flash/nor/at91sam3.c b/src/flash/nor/at91sam3.c index 415f3932c..434891112 100644 --- a/src/flash/nor/at91sam3.c +++ b/src/flash/nor/at91sam3.c @@ -187,7 +187,7 @@ struct sam3_cfg { */ struct sam3_bank_private { - int probed; + bool probed; /* DANGER: THERE ARE DRAGONS HERE.. */ /* NOTE: If you add more 'ghost' pointers */ /* be aware that you must *manually* update */ @@ -233,7 +233,7 @@ struct sam3_chip_details { struct sam3_chip { struct sam3_chip *next; - int probed; + bool probed; /* this is "initialized" from the global const structure */ struct sam3_chip_details details; @@ -306,7 +306,7 @@ static const struct sam3_chip_details all_sam3_details[] = { /* .bank[0] = { */ { { - .probed = 0, + .probed = false, .pChip = NULL, .pBank = NULL, .bank_number = 0, @@ -322,7 +322,7 @@ static const struct sam3_chip_details all_sam3_details[] = { /* .bank[1] = { */ { - .probed = 0, + .probed = false, .pChip = NULL, .pBank = NULL, .bank_number = 1, @@ -357,7 +357,7 @@ static const struct sam3_chip_details all_sam3_details[] = { /* .bank[0] = { */ { { - .probed = 0, + .probed = false, .pChip = NULL, .pBank = NULL, .bank_number = 0, @@ -373,7 +373,7 @@ static const struct sam3_chip_details all_sam3_details[] = { /* .bank[1] = { */ { .present = 0, - .probed = 0, + .probed = false, .bank_number = 1, }, }, @@ -399,7 +399,7 @@ static const struct sam3_chip_details all_sam3_details[] = { /* .bank[0] = { */ { { - .probed = 0, + .probed = false, .pChip = NULL, .pBank = NULL, .bank_number = 0, @@ -416,7 +416,7 @@ static const struct sam3_chip_details all_sam3_details[] = { /* .bank[1] = { */ { .present = 0, - .probed = 0, + .probed = false, .bank_number = 1, }, }, @@ -448,7 +448,7 @@ static const struct sam3_chip_details all_sam3_details[] = { { { /* .bank[0] = { */ - .probed = 0, + .probed = false, .pChip = NULL, .pBank = NULL, .bank_number = 0, @@ -463,7 +463,7 @@ static const struct sam3_chip_details all_sam3_details[] = { }, /* .bank[1] = { */ { - .probed = 0, + .probed = false, .pChip = NULL, .pBank = NULL, .bank_number = 1, @@ -498,7 +498,7 @@ static const struct sam3_chip_details all_sam3_details[] = { { /* .bank[0] = { */ { - .probed = 0, + .probed = false, .pChip = NULL, .pBank = NULL, .bank_number = 0, @@ -514,7 +514,7 @@ static const struct sam3_chip_details all_sam3_details[] = { /* .bank[1] = { */ { .present = 0, - .probed = 0, + .probed = false, .bank_number = 1, }, }, @@ -540,7 +540,7 @@ static const struct sam3_chip_details all_sam3_details[] = { { /* .bank[0] = { */ { - .probed = 0, + .probed = false, .pChip = NULL, .pBank = NULL, .bank_number = 0, @@ -556,7 +556,7 @@ static const struct sam3_chip_details all_sam3_details[] = { /* .bank[1] = { */ { .present = 0, - .probed = 0, + .probed = false, .bank_number = 1, }, @@ -578,7 +578,7 @@ static const struct sam3_chip_details all_sam3_details[] = { { /* .bank[0] = { */ { - .probed = 0, + .probed = false, .pChip = NULL, .pBank = NULL, .bank_number = 0, @@ -594,7 +594,7 @@ static const struct sam3_chip_details all_sam3_details[] = { /* .bank[1] = { */ { .present = 0, - .probed = 0, + .probed = false, .bank_number = 1, }, @@ -611,7 +611,7 @@ static const struct sam3_chip_details all_sam3_details[] = { { /* .bank[0] = { */ { - .probed = 0, + .probed = false, .pChip = NULL, .pBank = NULL, .bank_number = 0, @@ -627,7 +627,7 @@ static const struct sam3_chip_details all_sam3_details[] = { /* .bank[1] = { */ { .present = 0, - .probed = 0, + .probed = false, .bank_number = 1, }, @@ -643,7 +643,7 @@ static const struct sam3_chip_details all_sam3_details[] = { { /* .bank[0] = { */ { - .probed = 0, + .probed = false, .pChip = NULL, .pBank = NULL, .bank_number = 0, @@ -659,7 +659,7 @@ static const struct sam3_chip_details all_sam3_details[] = { /* .bank[1] = { */ { .present = 0, - .probed = 0, + .probed = false, .bank_number = 1, }, @@ -675,7 +675,7 @@ static const struct sam3_chip_details all_sam3_details[] = { { /* .bank[0] = { */ { - .probed = 0, + .probed = false, .pChip = NULL, .pBank = NULL, .bank_number = 0, @@ -691,7 +691,7 @@ static const struct sam3_chip_details all_sam3_details[] = { /* .bank[1] = { */ { .present = 0, - .probed = 0, + .probed = false, .bank_number = 1, }, @@ -707,7 +707,7 @@ static const struct sam3_chip_details all_sam3_details[] = { { /* .bank[0] = { */ { - .probed = 0, + .probed = false, .pChip = NULL, .pBank = NULL, .bank_number = 0, @@ -723,7 +723,7 @@ static const struct sam3_chip_details all_sam3_details[] = { /* .bank[1] = { */ { .present = 0, - .probed = 0, + .probed = false, .bank_number = 1, }, @@ -739,7 +739,7 @@ static const struct sam3_chip_details all_sam3_details[] = { { /* .bank[0] = { */ { - .probed = 0, + .probed = false, .pChip = NULL, .pBank = NULL, .bank_number = 0, @@ -754,7 +754,7 @@ static const struct sam3_chip_details all_sam3_details[] = { }, /* .bank[1] = { */ { - .probed = 0, + .probed = false, .pChip = NULL, .pBank = NULL, .bank_number = 1, @@ -779,7 +779,7 @@ static const struct sam3_chip_details all_sam3_details[] = { { /* .bank[0] = { */ { - .probed = 0, + .probed = false, .pChip = NULL, .pBank = NULL, .bank_number = 0, @@ -794,7 +794,7 @@ static const struct sam3_chip_details all_sam3_details[] = { }, /* .bank[1] = { */ { - .probed = 0, + .probed = false, .pChip = NULL, .pBank = NULL, .bank_number = 1, @@ -819,7 +819,7 @@ static const struct sam3_chip_details all_sam3_details[] = { { /* .bank[0] = { */ { - .probed = 0, + .probed = false, .pChip = NULL, .pBank = NULL, .bank_number = 0, @@ -834,7 +834,7 @@ static const struct sam3_chip_details all_sam3_details[] = { }, /* .bank[1] = { */ { - .probed = 0, + .probed = false, .pChip = NULL, .pBank = NULL, .bank_number = 1, @@ -859,7 +859,7 @@ static const struct sam3_chip_details all_sam3_details[] = { { /* .bank[0] = { */ { - .probed = 0, + .probed = false, .pChip = NULL, .pBank = NULL, .bank_number = 0, @@ -875,7 +875,7 @@ static const struct sam3_chip_details all_sam3_details[] = { /* .bank[1] = { */ { .present = 0, - .probed = 0, + .probed = false, .bank_number = 1, }, @@ -891,7 +891,7 @@ static const struct sam3_chip_details all_sam3_details[] = { { /* .bank[0] = { */ { - .probed = 0, + .probed = false, .pChip = NULL, .pBank = NULL, .bank_number = 0, @@ -907,7 +907,7 @@ static const struct sam3_chip_details all_sam3_details[] = { /* .bank[1] = { */ { .present = 0, - .probed = 0, + .probed = false, .bank_number = 1, }, @@ -923,7 +923,7 @@ static const struct sam3_chip_details all_sam3_details[] = { { /* .bank[0] = { */ { - .probed = 0, + .probed = false, .pChip = NULL, .pBank = NULL, .bank_number = 0, @@ -939,7 +939,7 @@ static const struct sam3_chip_details all_sam3_details[] = { /* .bank[1] = { */ { .present = 0, - .probed = 0, + .probed = false, .bank_number = 1, }, @@ -955,7 +955,7 @@ static const struct sam3_chip_details all_sam3_details[] = { { /* .bank[0] = { */ { - .probed = 0, + .probed = false, .pChip = NULL, .pBank = NULL, .bank_number = 0, @@ -971,7 +971,7 @@ static const struct sam3_chip_details all_sam3_details[] = { /* .bank[1] = { */ { .present = 0, - .probed = 0, + .probed = false, .bank_number = 1, }, @@ -987,7 +987,7 @@ static const struct sam3_chip_details all_sam3_details[] = { { /* .bank[0] = { */ { - .probed = 0, + .probed = false, .pChip = NULL, .pBank = NULL, .bank_number = 0, @@ -1003,7 +1003,7 @@ static const struct sam3_chip_details all_sam3_details[] = { /* .bank[1] = { */ { .present = 0, - .probed = 0, + .probed = false, .bank_number = 1, }, @@ -1019,7 +1019,7 @@ static const struct sam3_chip_details all_sam3_details[] = { { /* .bank[0] = { */ { - .probed = 0, + .probed = false, .pChip = NULL, .pBank = NULL, .bank_number = 0, @@ -1035,7 +1035,7 @@ static const struct sam3_chip_details all_sam3_details[] = { /* .bank[1] = { */ { .present = 0, - .probed = 0, + .probed = false, .bank_number = 1, }, @@ -1051,7 +1051,7 @@ static const struct sam3_chip_details all_sam3_details[] = { { /* .bank[0] = { */ { - .probed = 0, + .probed = false, .pChip = NULL, .pBank = NULL, .bank_number = 0, @@ -1067,7 +1067,7 @@ static const struct sam3_chip_details all_sam3_details[] = { /* .bank[1] = { */ { .present = 0, - .probed = 0, + .probed = false, .bank_number = 1, }, @@ -1101,7 +1101,7 @@ static const struct sam3_chip_details all_sam3_details[] = { /* .bank[0] = { */ { { - .probed = 0, + .probed = false, .pChip = NULL, .pBank = NULL, .bank_number = 0, @@ -1118,7 +1118,7 @@ static const struct sam3_chip_details all_sam3_details[] = { /* .bank[1] = { */ { .present = 0, - .probed = 0, + .probed = false, .bank_number = 1, }, }, @@ -1150,7 +1150,7 @@ static const struct sam3_chip_details all_sam3_details[] = { /* .bank[0] = { */ { { - .probed = 0, + .probed = false, .pChip = NULL, .pBank = NULL, .bank_number = 0, @@ -1167,7 +1167,7 @@ static const struct sam3_chip_details all_sam3_details[] = { /* .bank[1] = { */ { .present = 0, - .probed = 0, + .probed = false, .bank_number = 1, }, }, @@ -1199,7 +1199,7 @@ static const struct sam3_chip_details all_sam3_details[] = { /* .bank[0] = { */ { { - .probed = 0, + .probed = false, .pChip = NULL, .pBank = NULL, .bank_number = 0, @@ -1216,7 +1216,7 @@ static const struct sam3_chip_details all_sam3_details[] = { /* .bank[1] = { */ { .present = 0, - .probed = 0, + .probed = false, .bank_number = 1, }, }, @@ -1248,7 +1248,7 @@ static const struct sam3_chip_details all_sam3_details[] = { /* .bank[0] = { */ { { - .probed = 0, + .probed = false, .pChip = NULL, .pBank = NULL, .bank_number = 0, @@ -1265,7 +1265,7 @@ static const struct sam3_chip_details all_sam3_details[] = { /* .bank[1] = { */ { .present = 0, - .probed = 0, + .probed = false, .bank_number = 1, }, }, @@ -1297,7 +1297,7 @@ static const struct sam3_chip_details all_sam3_details[] = { /* .bank[0] = { */ { { - .probed = 0, + .probed = false, .pChip = NULL, .pBank = NULL, .bank_number = 0, @@ -1314,7 +1314,7 @@ static const struct sam3_chip_details all_sam3_details[] = { /* .bank[1] = { */ { .present = 0, - .probed = 0, + .probed = false, .bank_number = 1, }, }, @@ -1346,7 +1346,7 @@ static const struct sam3_chip_details all_sam3_details[] = { /* .bank[0] = { */ { { - .probed = 0, + .probed = false, .pChip = NULL, .pBank = NULL, .bank_number = 0, @@ -1363,7 +1363,7 @@ static const struct sam3_chip_details all_sam3_details[] = { /* .bank[1] = { */ { .present = 0, - .probed = 0, + .probed = false, .bank_number = 1, }, }, @@ -1395,7 +1395,7 @@ static const struct sam3_chip_details all_sam3_details[] = { /* .bank[0] = { */ { { - .probed = 0, + .probed = false, .pChip = NULL, .pBank = NULL, .bank_number = 0, @@ -1412,7 +1412,7 @@ static const struct sam3_chip_details all_sam3_details[] = { /* .bank[1] = { */ { .present = 0, - .probed = 0, + .probed = false, .bank_number = 1, }, }, @@ -1444,7 +1444,7 @@ static const struct sam3_chip_details all_sam3_details[] = { /* .bank[0] = { */ { { - .probed = 0, + .probed = false, .pChip = NULL, .pBank = NULL, .bank_number = 0, @@ -1461,7 +1461,7 @@ static const struct sam3_chip_details all_sam3_details[] = { /* .bank[1] = { */ { .present = 0, - .probed = 0, + .probed = false, .bank_number = 1, }, }, @@ -1493,7 +1493,7 @@ static const struct sam3_chip_details all_sam3_details[] = { /* .bank[0] = { */ { { - .probed = 0, + .probed = false, .pChip = NULL, .pBank = NULL, .bank_number = 0, @@ -1510,7 +1510,7 @@ static const struct sam3_chip_details all_sam3_details[] = { /* .bank[1] = { */ { .present = 0, - .probed = 0, + .probed = false, .bank_number = 1, }, }, @@ -1527,7 +1527,7 @@ static const struct sam3_chip_details all_sam3_details[] = { /* .bank[0] = { */ { { - .probed = 0, + .probed = false, .pChip = NULL, .pBank = NULL, .bank_number = 0, @@ -1544,7 +1544,7 @@ static const struct sam3_chip_details all_sam3_details[] = { /* .bank[1] = { */ { .present = 0, - .probed = 0, + .probed = false, .bank_number = 1, }, }, @@ -1561,7 +1561,7 @@ static const struct sam3_chip_details all_sam3_details[] = { /* .bank[0] = { */ { { - .probed = 0, + .probed = false, .pChip = NULL, .pBank = NULL, .bank_number = 0, @@ -1578,7 +1578,7 @@ static const struct sam3_chip_details all_sam3_details[] = { /* .bank[1] = { */ { .present = 0, - .probed = 0, + .probed = false, .bank_number = 1, }, }, @@ -1595,7 +1595,7 @@ static const struct sam3_chip_details all_sam3_details[] = { /* .bank[0] = { */ { { - .probed = 0, + .probed = false, .pChip = NULL, .pBank = NULL, .bank_number = 0, @@ -1612,7 +1612,7 @@ static const struct sam3_chip_details all_sam3_details[] = { /* .bank[1] = { */ { .present = 0, - .probed = 0, + .probed = false, .bank_number = 1, }, }, @@ -1629,7 +1629,7 @@ static const struct sam3_chip_details all_sam3_details[] = { /* .bank[0] = { */ { { - .probed = 0, + .probed = false, .pChip = NULL, .pBank = NULL, .bank_number = 0, @@ -1646,7 +1646,7 @@ static const struct sam3_chip_details all_sam3_details[] = { /* .bank[1] = { */ { .present = 0, - .probed = 0, + .probed = false, .bank_number = 1, }, }, @@ -1680,7 +1680,7 @@ static const struct sam3_chip_details all_sam3_details[] = { { /* .bank[0] = { */ { - .probed = 0, + .probed = false, .pChip = NULL, .pBank = NULL, .bank_number = 0, @@ -1695,7 +1695,7 @@ static const struct sam3_chip_details all_sam3_details[] = { }, /* .bank[1] = { */ { - .probed = 0, + .probed = false, .pChip = NULL, .pBank = NULL, .bank_number = 1, @@ -1721,7 +1721,7 @@ static const struct sam3_chip_details all_sam3_details[] = { { /* .bank[0] = { */ { - .probed = 0, + .probed = false, .pChip = NULL, .pBank = NULL, .bank_number = 0, @@ -1736,7 +1736,7 @@ static const struct sam3_chip_details all_sam3_details[] = { }, /* .bank[1] = { */ { - .probed = 0, + .probed = false, .pChip = NULL, .pBank = NULL, .bank_number = 1, @@ -1780,7 +1780,7 @@ static const struct sam3_chip_details all_sam3_details[] = { { /* .bank[0] = { */ { - .probed = 0, + .probed = false, .pChip = NULL, .pBank = NULL, .bank_number = 0, @@ -1795,7 +1795,7 @@ static const struct sam3_chip_details all_sam3_details[] = { }, /* .bank[1] = { */ { - .probed = 0, + .probed = false, .pChip = NULL, .pBank = NULL, .bank_number = 1, @@ -1822,7 +1822,7 @@ static const struct sam3_chip_details all_sam3_details[] = { { /* .bank[0] = { */ { - .probed = 0, + .probed = false, .pChip = NULL, .pBank = NULL, .bank_number = 0, @@ -1837,7 +1837,7 @@ static const struct sam3_chip_details all_sam3_details[] = { }, /* .bank[1] = { */ { - .probed = 0, + .probed = false, .pChip = NULL, .pBank = NULL, .bank_number = 1, @@ -1863,7 +1863,7 @@ static const struct sam3_chip_details all_sam3_details[] = { { /* .bank[0] = { */ { - .probed = 0, + .probed = false, .pChip = NULL, .pBank = NULL, .bank_number = 0, @@ -1878,7 +1878,7 @@ static const struct sam3_chip_details all_sam3_details[] = { }, /* .bank[1] = { */ { - .probed = 0, + .probed = false, .pChip = NULL, .pBank = NULL, .bank_number = 1, @@ -1904,7 +1904,7 @@ static const struct sam3_chip_details all_sam3_details[] = { { /* .bank[0] = { */ { - .probed = 0, + .probed = false, .pChip = NULL, .pBank = NULL, .bank_number = 0, @@ -1919,7 +1919,7 @@ static const struct sam3_chip_details all_sam3_details[] = { }, /* .bank[1] = { */ { - .probed = 0, + .probed = false, .pChip = NULL, .pBank = NULL, .bank_number = 1, @@ -1945,7 +1945,7 @@ static const struct sam3_chip_details all_sam3_details[] = { { /* .bank[0] = { */ { - .probed = 0, + .probed = false, .pChip = NULL, .pBank = NULL, .bank_number = 0, @@ -1960,7 +1960,7 @@ static const struct sam3_chip_details all_sam3_details[] = { }, /* .bank[1] = { */ { - .probed = 0, + .probed = false, .pChip = NULL, .pBank = NULL, .bank_number = 1, @@ -1986,7 +1986,7 @@ static const struct sam3_chip_details all_sam3_details[] = { { /* .bank[0] = { */ { - .probed = 0, + .probed = false, .pChip = NULL, .pBank = NULL, .bank_number = 0, @@ -2001,7 +2001,7 @@ static const struct sam3_chip_details all_sam3_details[] = { }, /* .bank[1] = { */ { - .probed = 0, + .probed = false, .pChip = NULL, .pBank = NULL, .bank_number = 1, @@ -3051,7 +3051,7 @@ FLASH_BANK_COMMAND_HANDLER(sam3_flash_bank_command) pChip->target = bank->target; /* assumption is this runs at 32khz */ pChip->cfg.slow_freq = 32768; - pChip->probed = 0; + pChip->probed = false; } switch (bank->base) { @@ -3224,7 +3224,7 @@ static int _sam3_probe(struct flash_bank *bank, int noise) } } - pPrivate->probed = 1; + pPrivate->probed = true; r = sam3_protect_check(bank); if (r != ERROR_OK) commit 8fc00a38bc54ce6f42d0ed1d9dc3588e58bbb73e Author: Marc Schink <de...@za...> Date: Wed Jul 1 10:21:06 2020 +0200 flash/nor/ambiqmicro: Use 'bool' data type Change-Id: Ia8492905dc506d518266343d699c3245efbc1ab1 Signed-off-by: Marc Schink <de...@za...> Reviewed-on: http://openocd.zylin.com/5733 Tested-by: jenkins Reviewed-by: Antonio Borneo <bor...@gm...> diff --git a/src/flash/nor/ambiqmicro.c b/src/flash/nor/ambiqmicro.c index 1e2a4b176..622943d28 100644 --- a/src/flash/nor/ambiqmicro.c +++ b/src/flash/nor/ambiqmicro.c @@ -92,7 +92,7 @@ static const uint32_t apollo_sram_size[] = { struct ambiqmicro_flash_bank { /* chip id register */ - uint32_t probed; + bool probed; const char *target_name; uint8_t target_class; @@ -156,7 +156,7 @@ FLASH_BANK_COMMAND_HANDLER(ambiqmicro_flash_bank_command) ambiqmicro_info->target_name = "Unknown target"; /* part wasn't probed yet */ - ambiqmicro_info->probed = 0; + ambiqmicro_info->probed = false; return ERROR_OK; } @@ -167,7 +167,7 @@ static int get_ambiqmicro_info(struct flash_bank *bank, char *buf, int buf_size) int printed; char *classname; - if (ambiqmicro_info->probed == 0) { + if (!ambiqmicro_info->probed) { LOG_ERROR("Target not probed"); return ERROR_FLASH_BANK_NOT_PROBED; } @@ -280,7 +280,7 @@ static int ambiqmicro_protect_check(struct flash_bank *bank) uint32_t i; - if (ambiqmicro->probed == 0) { + if (!ambiqmicro->probed) { LOG_ERROR("Target not probed"); return ERROR_FLASH_BANK_NOT_PROBED; } @@ -371,7 +371,7 @@ static int ambiqmicro_mass_erase(struct flash_bank *bank) return ERROR_TARGET_NOT_HALTED; } - if (ambiqmicro_info->probed == 0) { + if (!ambiqmicro_info->probed) { LOG_ERROR("Target not probed"); return ERROR_FLASH_BANK_NOT_PROBED; } @@ -439,7 +439,7 @@ static int ambiqmicro_erase(struct flash_bank *bank, unsigned int first, return ERROR_TARGET_NOT_HALTED; } - if (ambiqmicro_info->probed == 0) { + if (!ambiqmicro_info->probed) { LOG_ERROR("Target not probed"); return ERROR_FLASH_BANK_NOT_PROBED; } @@ -659,7 +659,7 @@ static int ambiqmicro_probe(struct flash_bank *bank) /* If this is a ambiqmicro chip, it has flash; probe() is just * to figure out how much is present. Only do it once. */ - if (ambiqmicro_info->probed == 1) { + if (ambiqmicro_info->probed) { LOG_INFO("Target already probed"); return ERROR_OK; } @@ -691,7 +691,7 @@ static int ambiqmicro_probe(struct flash_bank *bank) /* * Part has been probed. */ - ambiqmicro_info->probed = 1; + ambiqmicro_info->probed = true; return retval; } @@ -711,7 +711,7 @@ static int ambiqmicro_otp_program(struct flash_bank *bank, return ERROR_TARGET_NOT_HALTED; } - if (ambiqmicro_info->probed == 0) { + if (!ambiqmicro_info->probed) { LOG_ERROR("Target not probed"); return ERROR_FLASH_BANK_NOT_PROBED; } ----------------------------------------------------------------------- Summary of changes: src/flash/nor/ambiqmicro.c | 18 ++-- src/flash/nor/at91sam3.c | 176 +++++++++++++++--------------- src/flash/nor/at91sam4.c | 264 ++++++++++++++++++++++----------------------- src/flash/nor/ath79.c | 6 +- src/flash/nor/atsamv.c | 4 +- 5 files changed, 234 insertions(+), 234 deletions(-) hooks/post-receive -- Main OpenOCD repository |