From: Dmitry Eremin Date: Mon, 13 Oct 2014 17:28:08 +0000 (+0400) Subject: LU-5577 obdclass: change uuid_unpack arg to size_t X-Git-Tag: 2.6.90~10 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=a7c8c5e3f981da15b1c490627c4034de2099e4f4 LU-5577 obdclass: change uuid_unpack arg to size_t Cleanup warnings about comparison between signed and unsigned. Signed-off-by: Dmitry Eremin Change-Id: Ib577a36879a1a57f20f13a5c4c697ba404e113fa Reviewed-on: http://review.whamcloud.com/12389 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: James Simmons Reviewed-by: John L. Hammond Reviewed-by: Bob Glossman Reviewed-by: Oleg Drokin --- diff --git a/lustre/obdclass/uuid.c b/lustre/obdclass/uuid.c index d3faea7..e84f5ef 100644 --- a/lustre/obdclass/uuid.c +++ b/lustre/obdclass/uuid.c @@ -42,11 +42,11 @@ #include #include -static inline __u32 consume(int nob, __u8 **ptr) +static inline size_t consume(size_t nob, __u8 **ptr) { - __u32 value; + size_t value; - LASSERT(nob <= sizeof value); + LASSERT(nob <= sizeof(value)); for (value = 0; nob > 0; --nob) value = (value << 8) | *((*ptr)++); @@ -55,11 +55,11 @@ static inline __u32 consume(int nob, __u8 **ptr) #define CONSUME(val, ptr) (val) = consume(sizeof(val), (ptr)) -static void uuid_unpack(class_uuid_t in, __u16 *uu, int nr) +static void uuid_unpack(class_uuid_t in, __u16 *uu, size_t nr) { - __u8 *ptr = in; + __u8 *ptr = in; - LASSERT(nr * sizeof *uu == sizeof(class_uuid_t)); + LASSERT(nr * sizeof(*uu) == sizeof(class_uuid_t)); while (nr-- > 0) CONSUME(uu[nr], &ptr);