mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-07-11 14:02:52 +02:00
util/nvmutil: make err_if a function, not a macro
Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user