Skip to contentSkip to conversation

staging: lustre: libcfs: nidstrings.c - use ARRAY_SIZE macro

PATCH Superseded Anil Belur 1 participant 1 message Jul 1, 2014 Staging

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Anil Belur

author
#0 lore raw

PATCH 1/1 staging: lustre: libcfs: nidstrings.c - use ARRAY_SIZE macro

From: Anil Belur <[email protected]>

- this patch replaces sizeof(a)/sizeof(a[0]) with the ARRAY_SIZE macro to get the number of nidstrings

---
 drivers/staging/lustre/lustre/libcfs/nidstrings.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/staging/lustre/lustre/libcfs/nidstrings.c +1 -2
index 87705ae..13a2791 100644
@@ -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);
Signature · 1 line
1.9.1