lib/spd_cache.c: Drop comparison to {true, false}
Change-Id: I0ef8c0159c99606aad537fd5e14d3c74e32651d8 Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr> Reviewed-on: https://review.coreboot.org/c/coreboot/+/61423 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
This commit is contained in:
		| @@ -154,21 +154,21 @@ bool check_if_dimm_changed(u8 *spd_cache, struct spd_block *blk) | |||||||
| 	bool dimm_present_in_cache; | 	bool dimm_present_in_cache; | ||||||
| 	bool dimm_changed = false; | 	bool dimm_changed = false; | ||||||
| 	/* Check if the dimm is the same with last system boot. */ | 	/* Check if the dimm is the same with last system boot. */ | ||||||
| 	for (i = 0; i < SC_SPD_NUMS && dimm_changed == false; i++) { | 	for (i = 0; i < SC_SPD_NUMS && !dimm_changed; i++) { | ||||||
| 		/* Return true if any error happened here. */ | 		/* Return true if any error happened here. */ | ||||||
| 		if (get_spd_sn(blk->addr_map[i], &sn) == CB_ERR) | 		if (get_spd_sn(blk->addr_map[i], &sn) == CB_ERR) | ||||||
| 			return true; | 			return true; | ||||||
| 		dimm_present_in_cache = get_cached_dimm_present(spd_cache, i); | 		dimm_present_in_cache = get_cached_dimm_present(spd_cache, i); | ||||||
| 		/* Dimm is not present now. */ | 		/* Dimm is not present now. */ | ||||||
| 		if (sn == 0xffffffff) { | 		if (sn == 0xffffffff) { | ||||||
| 			if (dimm_present_in_cache == false) | 			if (!dimm_present_in_cache) | ||||||
| 				printk(BIOS_NOTICE, "SPD_CACHE: DIMM%d is not present\n", i); | 				printk(BIOS_NOTICE, "SPD_CACHE: DIMM%d is not present\n", i); | ||||||
| 			else { | 			else { | ||||||
| 				printk(BIOS_NOTICE, "SPD_CACHE: DIMM%d lost\n", i); | 				printk(BIOS_NOTICE, "SPD_CACHE: DIMM%d lost\n", i); | ||||||
| 				dimm_changed = true; | 				dimm_changed = true; | ||||||
| 			} | 			} | ||||||
| 		} else { /* Dimm is present now. */ | 		} else { /* Dimm is present now. */ | ||||||
| 			if (dimm_present_in_cache == true) { | 			if (dimm_present_in_cache) { | ||||||
| 				if (memcmp(&sn, spd_cache + SC_SPD_OFFSET(i) + DDR4_SPD_SN_OFF, | 				if (memcmp(&sn, spd_cache + SC_SPD_OFFSET(i) + DDR4_SPD_SN_OFF, | ||||||
| 						SPD_SN_LEN) == 0) | 						SPD_SN_LEN) == 0) | ||||||
| 					printk(BIOS_NOTICE, "SPD_CACHE: DIMM%d is the same\n", | 					printk(BIOS_NOTICE, "SPD_CACHE: DIMM%d is the same\n", | ||||||
| @@ -195,7 +195,7 @@ enum cb_err spd_fill_from_cache(uint8_t *spd_cache, struct spd_block *blk) | |||||||
|  |  | ||||||
| 	/* Find the first present SPD */ | 	/* Find the first present SPD */ | ||||||
| 	for (i = 0; i < SC_SPD_NUMS; i++) | 	for (i = 0; i < SC_SPD_NUMS; i++) | ||||||
| 		if (get_cached_dimm_present(spd_cache, i) == true) | 		if (get_cached_dimm_present(spd_cache, i)) | ||||||
| 			break; | 			break; | ||||||
|  |  | ||||||
| 	if (i == SC_SPD_NUMS) { | 	if (i == SC_SPD_NUMS) { | ||||||
| @@ -211,7 +211,7 @@ enum cb_err spd_fill_from_cache(uint8_t *spd_cache, struct spd_block *blk) | |||||||
| 		blk->len = SPD_PAGE_LEN; | 		blk->len = SPD_PAGE_LEN; | ||||||
|  |  | ||||||
| 	for (i = 0; i < SC_SPD_NUMS; i++) | 	for (i = 0; i < SC_SPD_NUMS; i++) | ||||||
| 		if (get_cached_dimm_present(spd_cache, i) == true) | 		if (get_cached_dimm_present(spd_cache, i)) | ||||||
| 			blk->spd_array[i] = spd_cache + SC_SPD_OFFSET(i); | 			blk->spd_array[i] = spd_cache + SC_SPD_OFFSET(i); | ||||||
| 		else | 		else | ||||||
| 			blk->spd_array[i] = NULL; | 			blk->spd_array[i] = NULL; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user