cifsd: use memcmp instead of for loop check in oid_eq()
authorNamjae Jeon <namjae.jeon@samsung.com>
Wed, 26 May 2021 06:23:55 +0000 (15:23 +0900)
committerNamjae Jeon <namjae.jeon@samsung.com>
Wed, 26 May 2021 09:11:41 +0000 (18:11 +0900)
Use memcmp instead of for loop check in oid_eq().

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/cifsd/asn1.c

index f2628dc3490f1fb302eccde486e3f8469c189386..a7db37eef2a978e7fac6ce51600d73cec7c4e6d2 100644 (file)
@@ -110,16 +110,10 @@ static bool
 oid_eq(unsigned long *oid1, unsigned int oid1len,
                unsigned long *oid2, unsigned int oid2len)
 {
-       unsigned int i;
-
        if (oid1len != oid2len)
                return false;
 
-       for (i = 0; i < oid1len; i++) {
-               if (oid1[i] != oid2[i])
-                       return false;
-       }
-       return true;
+       return memcmp(oid1, oid2, oid1len) == 0;
 }
 
 int