summaryrefslogtreecommitdiffstats
path: root/usr.sbin/usbdump
diff options
context:
space:
mode:
authorpfg <pfg@FreeBSD.org>2016-04-18 17:30:33 +0000
committerpfg <pfg@FreeBSD.org>2016-04-18 17:30:33 +0000
commitd115651e266eaca02652573053898075fd64fe5d (patch)
tree2367e8dda7aa467be705fcfe972effd00b851490 /usr.sbin/usbdump
parent3c79e64b06b1f799d35b38b7c9388e19290b9a6f (diff)
downloadFreeBSD-src-d115651e266eaca02652573053898075fd64fe5d.zip
FreeBSD-src-d115651e266eaca02652573053898075fd64fe5d.tar.gz
Reuse our roundup2() macro instead of reinventing the wheel.
Obtained from: DragonflyBSD
Diffstat (limited to 'usr.sbin/usbdump')
-rw-r--r--usr.sbin/usbdump/usbdump.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/usr.sbin/usbdump/usbdump.c b/usr.sbin/usbdump/usbdump.c
index 99307a4..0b8b391 100644
--- a/usr.sbin/usbdump/usbdump.c
+++ b/usr.sbin/usbdump/usbdump.c
@@ -95,8 +95,6 @@ struct usbcap_filehdr {
uint8_t reserved[26];
} __packed;
-#define HEADER_ALIGN(x,a) (((x) + (a) - 1) & ~((a) - 1))
-
struct header_32 {
/* capture timestamp */
uint32_t ts_sec;
@@ -622,7 +620,7 @@ print_packets(uint8_t *data, const int datalen)
temp.hdrlen = hdr32->hdrlen;
temp.align = hdr32->align;
- next = ptr + HEADER_ALIGN(temp.hdrlen + temp.caplen, temp.align);
+ next = ptr + roundup2(temp.hdrlen + temp.caplen, temp.align);
if (next <= ptr)
err(EXIT_FAILURE, "Invalid length");
OpenPOWER on IntegriCloud