As reported by Li Zefan, normally upper-case macros means constants, but the
above macros are not constants:

> #define ALIGN(x,a)            __ALIGN_MASK(x,(typeof(x))(a)-1)
> #define __ALIGN_MASK(x,mask)  (((x)+(mask))&~(mask))
> #define KB(x)                 ((x) >> 10)

Use lower-case names instead.

Signed-off-by: Andrea Righi <[EMAIL PROTECTED]>
Signed-off-by: Li Zefan <[EMAIL PROTECTED]>
---
 testcases/kernel/controllers/io-throttle/iobw.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/testcases/kernel/controllers/io-throttle/iobw.c 
b/testcases/kernel/controllers/io-throttle/iobw.c
index d0e36cb..210c1fd 100644
--- a/testcases/kernel/controllers/io-throttle/iobw.c
+++ b/testcases/kernel/controllers/io-throttle/iobw.c
@@ -40,9 +40,9 @@
 #define PAGE_SIZE getpagesize()
 #endif
 
-#define ALIGN(x,a)             __ALIGN_MASK(x,(typeof(x))(a)-1)
-#define __ALIGN_MASK(x,mask)   (((x)+(mask))&~(mask))
-#define KB(x)                  ((x) >> 10)
+#define align(x,a)             __align_mask(x,(typeof(x))(a)-1)
+#define __align_mask(x,mask)   (((x)+(mask))&~(mask))
+#define kb(x)                  ((x) >> 10)
 
 const char usage[] = "Usage: iobw [-direct] threads chunk_size data_size\n";
 const char child_fmt[] =
@@ -229,12 +229,12 @@ int main(int argc, char *argv[])
                fprintf(stderr, usage);
                exit(1);
        }
-       chunk_size = ALIGN(memparse(argv[2], &end), PAGE_SIZE);
+       chunk_size = align(memparse(argv[2], &end), PAGE_SIZE);
        if (*end) {
                fprintf(stderr, usage);
                exit(1);
        }
-       data_size = ALIGN(memparse(argv[3], &end), PAGE_SIZE);
+       data_size = align(memparse(argv[3], &end), PAGE_SIZE);
        if (*end) {
                fprintf(stderr, usage);
                exit(1);
@@ -260,7 +260,7 @@ int main(int argc, char *argv[])
        signal(SIGTERM, signal_handler);
 
        fprintf(stdout, "chunk_size %luKiB, data_size %luKiB\n",
-               KB(chunk_size), KB(data_size));
+               kb(chunk_size), kb(data_size));
        fflush(stdout);
 
         gettimeofday(&start, NULL);
-- 
1.5.4.3


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to