Adding ARRAY_SIZE macro, adding compiler.h,
As it fails to get defination of ARRAY_SIZE.

Signed-off-by: Maninder Singh <maninder...@samsung.com>
Reviewed-by: Akhilesh Kumar <akhiles...@samsung.com>
---
 testcases/kernel/fs/fsstress/fsstress.c |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/testcases/kernel/fs/fsstress/fsstress.c 
b/testcases/kernel/fs/fsstress/fsstress.c
index 07158ac..2f89903 100644
--- a/testcases/kernel/fs/fsstress/fsstress.c
+++ b/testcases/kernel/fs/fsstress/fsstress.c
@@ -32,6 +32,7 @@
 
 #include "config.h"
 #include "global.h"
+#include <compiler.h>
 #ifdef HAVE_SYS_PRCTL_H
 # include <sys/prctl.h>
 #endif
@@ -311,7 +312,7 @@ int main(int argc, char **argv)
 
        errrange = errtag = 0;
        umask(0);
-       nops = sizeof(ops) / sizeof(ops[0]);
+       nops = ARRAY_SIZE(ops);
        ops_end = &ops[nops];
        myprog = argv[0];
        while ((c = getopt(argc, argv, "cd:e:f:i:l:n:p:rs:vwzHSX")) != -1) {
@@ -1066,7 +1067,7 @@ void namerandpad(int id, char *buf, int i)
 
        if (namerand == 0)
                return;
-       bucket = (id ^ namerand) % (sizeof(buckets) / sizeof(buckets[0]));
+       bucket = (id ^ namerand) % ARRAY_SIZE(buckets);
        padmod = buckets[bucket] + 1 - i;
        if (padmod <= 0)
                return;
@@ -1548,7 +1549,7 @@ void attr_set_f(int opno, long r)
        if (!get_fname(FT_ANYm, r, &f, NULL, NULL, &v))
                append_pathname(&f, ".");
        sprintf(aname, "a%x", nameseq++);
-       li = (int)(random() % (sizeof(lengths) / sizeof(lengths[0])));
+       li = (int)(random() % ARRAY_SIZE(lengths));
        len = (int)(random() % lengths[li]);
        if (len == 0)
                len = 1;
-- 
1.7.9.5


------------------------------------------------------------------------------
Monitor 25 network devices or servers for free with OpManager!
OpManager is web-based network management software that monitors 
network devices and physical & virtual servers, alerts via email & sms 
for fault. Monitor 25 devices for free with no restriction. Download now
http://ad.doubleclick.net/ddm/clk/292181274;119417398;o
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to