* [PATCH 1/1] staging: lustre: libcfs: nidstrings.c - use ARRAY_SIZE macro
@ 2014-07-01 4:55 Anil Belur
0 siblings, 0 replies; only message in thread
From: Anil Belur @ 2014-07-01 4:55 UTC (permalink / raw)
To: teobaluta, oleg.drokin, dmitry.eremin, bergwolf, gregkh
Cc: devel, linux-kernel, Anil Belur
From: Anil Belur <askb23@gmail.com>
- this patch replaces sizeof(a)/sizeof(a[0]) with the ARRAY_SIZE macro
to get the number of nidstrings
Signed-off-by: Anil Belur <askb23@gmail.com>
---
drivers/staging/lustre/lustre/libcfs/nidstrings.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/staging/lustre/lustre/libcfs/nidstrings.c b/drivers/staging/lustre/lustre/libcfs/nidstrings.c
index 87705ae..13a2791 100644
--- a/drivers/staging/lustre/lustre/libcfs/nidstrings.c
+++ b/drivers/staging/lustre/lustre/libcfs/nidstrings.c
@@ -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);
--
1.9.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2014-07-01 4:55 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-01 4:55 [PATCH 1/1] staging: lustre: libcfs: nidstrings.c - use ARRAY_SIZE macro Anil Belur
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox