diff options
author | ed <ed@FreeBSD.org> | 2012-10-20 10:20:06 +0000 |
---|---|---|
committer | ed <ed@FreeBSD.org> | 2012-10-20 10:20:06 +0000 |
commit | e65c2d3d073186914cbb3ad3494d5da8b3bde8d5 (patch) | |
tree | e44d026c3e12cba359d8412f3c1e41e63e731f60 /usr.sbin/mfiutil/mfi_flash.c | |
parent | ff852f67bd163fdd634ba77c0927e433933e3592 (diff) | |
download | FreeBSD-src-e65c2d3d073186914cbb3ad3494d5da8b3bde8d5.zip FreeBSD-src-e65c2d3d073186914cbb3ad3494d5da8b3bde8d5.tar.gz |
Remove redundant code.
Both mfi_flash.c and mfi_show.c contain very similar functions to print
a list of firmwares. Move these routines into mfiutil.c.
Reported by: jhb
Diffstat (limited to 'usr.sbin/mfiutil/mfi_flash.c')
-rw-r--r-- | usr.sbin/mfiutil/mfi_flash.c | 32 |
1 files changed, 2 insertions, 30 deletions
diff --git a/usr.sbin/mfiutil/mfi_flash.c b/usr.sbin/mfiutil/mfi_flash.c index 2b82529..d640cf7 100644 --- a/usr.sbin/mfiutil/mfi_flash.c +++ b/usr.sbin/mfiutil/mfi_flash.c @@ -42,34 +42,6 @@ #define FLASH_BUF_SIZE (64 * 1024) -static void -scan_firmware(struct mfi_info_component *comp) -{ - int len; - - len = strlen(comp->name); - if (fw_name_width < len) - fw_name_width = len; - len = strlen(comp->version); - if (fw_version_width < len) - fw_version_width = len; - len = strlen(comp->build_date); - if (fw_date_width < len) - fw_date_width = len; - len = strlen(comp->build_time); - if (fw_time_width < len) - fw_time_width = len; -} - -static void -display_firmware(struct mfi_info_component *comp) -{ - - printf("%-*s %-*s %-*s %-*s\n", fw_name_width, comp->name, - fw_version_width, comp->version, fw_date_width, comp->build_date, - fw_time_width, comp->build_time); -} - static int display_pending_firmware(int fd) { @@ -94,9 +66,9 @@ display_pending_firmware(int fd) info.pending_image_component_count = 8; for (i = 0; i < info.pending_image_component_count; i++) scan_firmware(&info.pending_image_component[i]); - display_firmware(&header); + display_firmware(&header, ""); for (i = 0; i < info.pending_image_component_count; i++) - display_firmware(&info.pending_image_component[i]); + display_firmware(&info.pending_image_component[i], ""); return (0); } |