mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-07-16 13:16:47 +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),
|
openFiles(void), cmd_copy(void), writeGbe_part(int), readGbe_part(int),
|
||||||
set_cmd(int, char **), setWord(int, int, uint16_t), check_bounds(int, int),
|
set_cmd(int, char **), setWord(int, int, uint16_t), check_bounds(int, int),
|
||||||
xopen (int *, const char *, int p, struct stat *), checkMacSeparator(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);
|
int goodChecksum(int partnum), write_mac_part(int), set_err(int);
|
||||||
uint8_t hextonum(char chs), rhex(void);
|
uint8_t hextonum(char chs), rhex(void);
|
||||||
uint16_t word(int, int);
|
uint16_t word(int, int);
|
||||||
@@ -60,8 +61,6 @@ op_t op[] = {
|
|||||||
};
|
};
|
||||||
void (*cmd)(void) = NULL;
|
void (*cmd)(void) = NULL;
|
||||||
|
|
||||||
#define err_if(x) if (x) err(set_err(ECANCELED), "%s", fname)
|
|
||||||
|
|
||||||
int
|
int
|
||||||
main(int argc, char *argv[])
|
main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
@@ -478,6 +477,13 @@ usage(char *util)
|
|||||||
err(set_err(ECANCELED), "Too few arguments");
|
err(set_err(ECANCELED), "Too few arguments");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
err_if(int x)
|
||||||
|
{
|
||||||
|
if (x)
|
||||||
|
err(set_err(ECANCELED), "%s", fname);
|
||||||
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
set_err(int x)
|
set_err(int x)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user