diff options
author | Leah Rowe <leah@libreboot.org> | 2023-10-12 15:10:50 +0100 |
---|---|---|
committer | Leah Rowe <leah@libreboot.org> | 2023-10-12 15:10:50 +0100 |
commit | 3ad171fd3dcb509c0b2e79b41ebd01494f67f46c (patch) | |
tree | b70be755593f03e44f58649201550d476a362caf /util/nvmutil/nvmutil.c | |
parent | 96fd88c5b364d4ccafb56f0453e5f0253db1367f (diff) |
nvmutil: simplify prototype declarations
Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'util/nvmutil/nvmutil.c')
-rw-r--r-- | util/nvmutil/nvmutil.c | 24 |
1 files changed, 7 insertions, 17 deletions
diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c index a84e3c65..d2e84be8 100644 --- a/util/nvmutil/nvmutil.c +++ b/util/nvmutil/nvmutil.c @@ -13,21 +13,11 @@ #include <string.h> #include <unistd.h> -void openFiles(const char *path); -void readGbeFile(void); -void cmd_setmac(void); -int invalidMacAddress(const char *strMac, uint16_t *mac); -uint8_t hextonum(char chs); -uint8_t rhex(void); -void cmd_dump(void); -void showmac(int partnum); -void hexdump(int partnum); -void cmd_setchecksum(void); -void cmd_brick(void); -void cmd_copy(void); -int validChecksum(int partnum); -void xorswap_buf(int partnum); -void writeGbeFile(void); +void cmd_setchecksum(void), cmd_brick(void), cmd_copy(void), writeGbeFile(void), + cmd_dump(void), cmd_setmac(void), readGbeFile(void), showmac(int partnum), + hexdump(int partnum), xorswap_buf(int partnum), openFiles(const char *path); +int macAddress(const char *strMac, uint16_t *mac), validChecksum(int partnum); +uint8_t hextonum(char chs), rhex(void); #define COMMAND argv[2] #define MAC_ADDRESS argv[3] @@ -136,7 +126,7 @@ readGbeFile(void) void cmd_setmac(void) { - if (invalidMacAddress(strMac, mac)) + if (macAddress(strMac, mac)) err(errno = ECANCELED, "Bad MAC address"); for (int partnum = 0; partnum < 2; partnum++) { if (!validChecksum(part = partnum)) @@ -148,7 +138,7 @@ cmd_setmac(void) } int -invalidMacAddress(const char *strMac, uint16_t *mac) +macAddress(const char *strMac, uint16_t *mac) { uint64_t total = 0; if (strnlen(strMac, 20) == 17) { |