From 6885200c8b34b15cfe85c7bb7a0334a1a9c63139 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Thu, 1 Jun 2023 07:31:16 +0100 Subject: util/nvmutil: simplify setWord() with word() macro There is nothing cooler than a macro. Signed-off-by: Leah Rowe --- util/nvmutil/nvmutil.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'util/nvmutil/nvmutil.c') 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 -- cgit v1.2.1