From 3ad171fd3dcb509c0b2e79b41ebd01494f67f46c Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Thu, 12 Oct 2023 15:10:50 +0100 Subject: nvmutil: simplify prototype declarations Signed-off-by: Leah Rowe --- util/nvmutil/nvmutil.c | 24 +++++++----------------- 1 file 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 #include -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) { -- cgit v1.2.1