diff options
| author | Leah Rowe <leah@libreboot.org> | 2026-03-03 03:38:45 +0000 |
|---|---|---|
| committer | Leah Rowe <leah@libreboot.org> | 2026-03-03 03:38:45 +0000 |
| commit | e4b8bb4875b538d482350102c3d1d1ce9062fc23 (patch) | |
| tree | 929963eac662949853a10dd096e7cd3e197331ad /util/nvmutil/nvmutil.c | |
| parent | c98d5c743fc1beb62db7f826bf1b2dbe1db6e2d0 (diff) | |
util/nvmutil: make err_if a function, not a macro
Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'util/nvmutil/nvmutil.c')
| -rw-r--r-- | util/nvmutil/nvmutil.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c index 256c3b88..81654d41 100644 --- a/util/nvmutil/nvmutil.c +++ b/util/nvmutil/nvmutil.c @@ -21,7 +21,8 @@ void cmd_setchecksum(void), cmd_brick(void), swap(int partnum), writeGbe(void), openFiles(void), cmd_copy(void), writeGbe_part(int), readGbe_part(int), set_cmd(int, char **), setWord(int, int, uint16_t), check_bounds(int, int), xopen (int *, const char *, int p, struct stat *), checkMacSeparator(int), - set_mac_byte(int, uint64_t *), usage(char*), set_io_flags(int, char **); + set_mac_byte(int, uint64_t *), usage(char*), set_io_flags(int, char **), + err_if(int); int goodChecksum(int partnum), write_mac_part(int), set_err(int); uint8_t hextonum(char chs), rhex(void); uint16_t word(int, int); @@ -60,8 +61,6 @@ op_t op[] = { }; void (*cmd)(void) = NULL; -#define err_if(x) if (x) err(set_err(ECANCELED), "%s", fname) - int main(int argc, char *argv[]) { @@ -478,6 +477,13 @@ usage(char *util) err(set_err(ECANCELED), "Too few arguments"); } +void +err_if(int x) +{ + if (x) + err(set_err(ECANCELED), "%s", fname); +} + int set_err(int x) { |
