From 1da95520fa85c6589fdb32ce1ee9035d92b34f4f Mon Sep 17 00:00:00 2001 From: Simon Wilkinson Date: Wed, 16 Mar 2011 21:23:17 +0000 Subject: [PATCH] util: Remove unnecessary uuid_mem* macros Once upon a time, in a galaxy far far away, uuid used bcmp and bcpy operations in kernel space. However, we changed that back in 2001, and since then the uuid_memcpy and uuid_memcmp macros have been redundant. Tidy up the code a little by removing them. Change-Id: I3abcff79b36a330f1619c3d7e0a791eac1cf69a1 Reviewed-on: http://gerrit.openafs.org/4253 Tested-by: BuildBot Reviewed-by: Derrick Brashear --- src/util/uuid.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/src/util/uuid.c b/src/util/uuid.c index ddfb6a2c8..603961086 100644 --- a/src/util/uuid.c +++ b/src/util/uuid.c @@ -54,8 +54,6 @@ #ifdef KERNEL #include "afs/sysincludes.h" #include "afsincludes.h" -#define uuid_memcmp(A,B,C) memcmp(A, B, C) -#define uuid_memcpy(A,B,C) memcpy(A, B, C) #else /* KERNEL */ #include #include @@ -85,9 +83,6 @@ #include #endif #include "afsutil.h" - -#define uuid_memcmp(A,B,C) memcmp(A,B,C) -#define uuid_memcpy(A,B,C) memcpy(A,B,C) #endif /* KERNEL */ @@ -132,7 +127,7 @@ static afs_uint32 rand_m, rand_ia, rand_ib, rand_irand, uuid_init_done = 0; afs_int32 afs_uuid_equal(afsUUID * u1, afsUUID * u2) { - return (uuid_memcmp((void *)u1, (void *)u2, sizeof(afsUUID)) == 0); + return (memcmp(u1, u2, sizeof(afsUUID)) == 0); } afs_int32 @@ -140,8 +135,7 @@ afs_uuid_is_nil(afsUUID * u1) { if (!u1) return 1; - return (uuid_memcmp - ((void *)u1, (void *)&afs_uuid_g_nil_uuid, sizeof(afsUUID)) == 0); + return afs_uuid_equal(u1, &afs_uuid_g_nil_uuid); } void @@ -337,7 +331,7 @@ afs_uuid_create(afsUUID * uuid) uuid->clock_seq_low = clock_seq & 0xff; uuid->clock_seq_hi_and_reserved = (clock_seq & 0x3f00) >> 8; uuid->clock_seq_hi_and_reserved |= 0x80; - uuid_memcpy((void *)uuid->node, (void *)&eaddr, sizeof(uuid_address_t)); + memcpy(uuid->node, &eaddr, sizeof(uuid_address_t)); #endif /* AFS_NT40_ENV */ return 0; } @@ -409,7 +403,7 @@ extern struct interfaceAddr afs_cb_interface; static int uuid_get_address(uuid_address_p_t addr) { - uuid_memcpy((void *)addr->eaddr, (void *)&afs_cb_interface.addr_in[0], 4); + memcpy(addr->eaddr, &afs_cb_interface.addr_in[0], 4); addr->eaddr[4] = 0xaa; addr->eaddr[5] = 0x77; return 0; @@ -453,9 +447,9 @@ uuid_get_address(uuid_address_p_t addr) return errno; #endif } else { - uuid_memcpy(&addr1, he->h_addr_list[0], 4); + memcpy(&addr1, he->h_addr_list[0], 4); addr1 = ntohl(addr1); - uuid_memcpy(addr->eaddr, &addr1, 4); + memcpy(addr->eaddr, &addr1, 4); addr->eaddr[4] = 0xaa; addr->eaddr[5] = 0x77; #ifdef UUID_DEBUG -- 2.39.5