diff options
author | Leah Rowe <leah@libreboot.org> | 2023-06-01 07:31:16 +0100 |
---|---|---|
committer | Leah Rowe <leah@libreboot.org> | 2023-06-01 07:31:52 +0100 |
commit | 6885200c8b34b15cfe85c7bb7a0334a1a9c63139 (patch) | |
tree | ba85ebf1dd76c08405cc9312b084fecf2dd01b80 /util/nvmutil/nvmutil.c | |
parent | 7ab209d545c1dbe66c7305ffdab25bb03e57afa7 (diff) |
util/nvmutil: simplify setWord() with word() macro
There is nothing cooler than a macro.
Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'util/nvmutil/nvmutil.c')
-rw-r--r-- | util/nvmutil/nvmutil.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c index 9e821b10..a1bf9b72 100644 --- a/util/nvmutil/nvmutil.c +++ b/util/nvmutil/nvmutil.c @@ -327,10 +327,8 @@ void setWord(int pos16, int partnum, uint16_t val16) { gbeFileModified = 1; - if (word(pos16, partnum) == val16) - return; - buf16[pos16 + (partnum << 11)] = val16; - nvmPartModified[partnum] = 1; + if (word(pos16, partnum) != val16) + nvmPartModified[partnum] = 1 | (word(pos16, partnum) = val16); } void |