Attention is currently required from: Nico Huber, Angel Pons, Nikolai Artemiev. Anastasia Klimchuk has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/61897 )
Change subject: libflashrom,linux_mtd: add linux_mtd writeprotect support ......................................................................
Patch Set 36: Code-Review+1
(2 comments)
Commit Message:
https://review.coreboot.org/c/flashrom/+/61897/comment/f5c43651_83aa0d96 PS36, Line 10: and uses it support Maybe instead "and uses it support" -> "and uses the framework to support".
File linux_mtd.c:
https://review.coreboot.org/c/flashrom/+/61897/comment/b0973450_a51127f7 PS36, Line 380: if ((cfg->range.len == 0) != (cfg->mode != FLASHROM_WP_MODE_DISABLED)) { : return FLASHROM_WP_ERR_OTHER; : } Please help me, I spent some time staring at the code, also reading the comment above and commit message. It seems to me that comment matches the commit message, but the code does not? what I am missing?
Testing info from commit message, first case: flashrom --wp-enable --wp-range <non-empty> succeeds
non-empty range makes `cfg->range.len == 0` -> false --wp-enable makes `cfg->mode != FLASHROM_WP_MODE_DISABLED` -> true
So the condition becomes `false != true` -> true -> so it returns error? But commit messages says it succeeds? What I am missing? :)