Skip to content

Commit 50e0158

Browse files
committed
Orangefs: Don't opencode memcpy.
Signed-off-by: Mike Marshall <hubcap@omnibond.com>
1 parent f957ae2 commit 50e0158

1 file changed

Lines changed: 2 additions & 11 deletions

File tree

‎fs/orangefs/protocol.h‎

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -70,30 +70,21 @@ static inline int PVFS_khandle_cmp(const struct pvfs2_khandle *kh1,
7070
return 0;
7171
}
7272

73-
/* copy a khandle to a field of arbitrary size */
7473
static inline void PVFS_khandle_to(const struct pvfs2_khandle *kh,
7574
void *p, int size)
7675
{
77-
int i;
78-
unsigned char *c = p;
7976

8077
memset(p, 0, size);
78+
memcpy(p, kh->u, 16);
8179

82-
for (i = 0; i < 16 && i < size; i++)
83-
c[i] = kh->u[i];
8480
}
8581

86-
/* copy a khandle from a field of arbitrary size */
8782
static inline void PVFS_khandle_from(struct pvfs2_khandle *kh,
8883
void *p, int size)
8984
{
90-
int i;
91-
unsigned char *c = p;
92-
9385
memset(kh, 0, 16);
86+
memcpy(kh->u, p, 16);
9487

95-
for (i = 0; i < 16 && i < size; i++)
96-
kh->u[i] = c[i];
9788
}
9889

9990
/* pvfs2-types.h ************************************************************/

0 commit comments

Comments
 (0)