Attention is currently required from: Nico Huber, Edward O'Callaghan, Anastasia Klimchuk, Sergii Dmytruk. Nikolai Artemiev has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/58479 )
Change subject: libflashrom,writeprotect: add functions for reading/writing WP configs ......................................................................
Patch Set 33:
(1 comment)
File writeprotect.c:
https://review.coreboot.org/c/flashrom/+/58479/comment/aea4653b_df007fbb PS32, Line 158: enum flashrom_wp_result wp_read_cfg(struct flashrom_wp_cfg *cfg, struct flashctx *flash) : { : struct wp_bits bits; : enum flashrom_wp_result ret = FLASHROM_WP_OK; : : if (!chip_supported(flash)) : ret = FLASHROM_WP_ERR_CHIP_UNSUPPORTED; : : if (ret != FLASHROM_WP_OK) : ret = read_wp_bits(&bits, flash); : : /* TODO: implement get_wp_range() and get_wp_mode() and call them */ : /* : if (ret != FLASHROM_WP_OK) : ret = get_wp_range(&cfg->range, flash, &bits); : : if (ret != FLASHROM_WP_OK) : ret = get_wp_mode(&cfg->mode, &bits); : */ : : return ret; : } : : enum flashrom_wp_result wp_write_cfg(struct flashctx *flash, const struct flashrom_wp_cfg *cfg) : { : struct wp_bits bits; : enum flashrom_wp_result ret = FLASHROM_WP_OK; : : if (!chip_supported(flash)) : ret = FLASHROM_WP_ERR_CHIP_UNSUPPORTED; : if (ret != FLASHROM_WP_OK) : ret = read_wp_bits(&bits, flash); : : : /* Set protection range */ : /* TODO: implement set_wp_range() and use it */ : /* : if (ret != FLASHROM_WP_OK) : ret = set_wp_range(&bits, flash, cfg->range); : if (ret != FLASHROM_WP_OK) : ret = write_wp_bits(flash, bits); : */ : : /* Set protection mode */ : /* TODO: implement set_wp_mode() and use it */ : /* : if (ret != FLASHROM_WP_OK) : ret = set_wp_mode(&bits, cfg->mode); : */ : if (ret != FLASHROM_WP_OK) : ret = write_wp_bits(flash, bits); : : return ret; : }
Typos: all `ret == FLASHROM_WP_OK` conditions are inverted.
Done