staging/lustre/libcfs: use ARRAY_SIZE instead of sizeof/sizeof[0]
authorFabian Frederick <fabf@skynet.be>
Tue, 1 Jul 2014 19:38:02 +0000 (21:38 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 8 Jul 2014 23:48:03 +0000 (16:48 -0700)
use macro definition

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Josh Triplett <josh@joshtriplett.org>
Cc: devel@driverdev.osuosl.org
Signed-off-by: Fabian Frederick <fabf@skynet.be>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/lustre/libcfs/nidstrings.c

index 87705ae4480f256cf984e47577e628ffba738fba..4fc7b452f3ba330916d6657ead63581e23066411 100644 (file)
@@ -74,8 +74,7 @@ libcfs_next_nidstring(void)
        spin_lock_irqsave(&libcfs_nidstring_lock, flags);
 
        str = libcfs_nidstrings[libcfs_nidstring_idx++];
-       if (libcfs_nidstring_idx ==
-           sizeof(libcfs_nidstrings)/sizeof(libcfs_nidstrings[0]))
+       if (libcfs_nidstring_idx == ARRAY_SIZE(libcfs_nidstrings))
                libcfs_nidstring_idx = 0;
 
        spin_unlock_irqrestore(&libcfs_nidstring_lock, flags);
@@ -198,7 +197,7 @@ static struct netstrfns  libcfs_netstrfns[] = {
        {/* .nf_type      */  -1},
 };
 
-const int libcfs_nnetstrfns = sizeof(libcfs_netstrfns)/sizeof(libcfs_netstrfns[0]);
+const int libcfs_nnetstrfns = ARRAY_SIZE(libcfs_netstrfns);
 
 int
 libcfs_lo_str2addr(const char *str, int nob, __u32 *addr)