From: Garrett C. <su...@li...> - 2011-01-10 02:43:20
|
The branch, master, has been updated via b6ff02cd9592e40c4b435ff7755cb69572a23f47 (commit) from e683a86812fc9e4e224a25c3ff9b4688ee1bb672 (commit) - Log ----------------------------------------------------------------- commit b6ff02cd9592e40c4b435ff7755cb69572a23f47 Author: Garrett Cooper <yan...@gm...> Date: Mon Dec 20 14:41:55 2010 -0800 Fix all remaining warnings. These warnings were mostly caused by the fact that tst_brk* is now reentrant and thus, the noreturn attribute is removed. Signed-off-by: Garrett Cooper <yan...@gm...> ----------------------------------------------------------------------- Summary of changes: .../kernel/controllers/cpuctl/cpuctl_def_task01.c | 22 ++++++++++------- .../kernel/controllers/cpuctl/cpuctl_def_task02.c | 25 +++++++++++++------ .../kernel/controllers/cpuctl/cpuctl_def_task03.c | 14 ++++++++--- .../kernel/controllers/cpuctl/cpuctl_def_task04.c | 25 +++++++++++++------ .../kernel/controllers/cpuctl/cpuctl_test01.c | 18 +++++++++---- .../kernel/controllers/cpuctl/cpuctl_test02.c | 19 +++++++++++---- .../kernel/controllers/cpuctl/cpuctl_test03.c | 14 ++++++++-- .../kernel/controllers/cpuctl/cpuctl_test04.c | 19 +++++++++++---- testcases/kernel/mem/hugetlb/hugemmap/hugemmap05.c | 2 +- testcases/kernel/mem/vmtests/data_space.c | 13 ++++------ 10 files changed, 114 insertions(+), 57 deletions(-) diff --git a/testcases/kernel/controllers/cpuctl/cpuctl_def_task01.c b/testcases/kernel/controllers/cpuctl/cpuctl_def_task01.c index 2c90eb9..f872ae3 100644 --- a/testcases/kernel/controllers/cpuctl/cpuctl_def_task01.c +++ b/testcases/kernel/controllers/cpuctl/cpuctl_def_task01.c @@ -90,13 +90,13 @@ int main(int argc, char *argv[]) char mygroup[FILENAME_MAX], mytaskfile[FILENAME_MAX]; char mysharesfile[FILENAME_MAX], ch; pid_t pid; - int my_group_num, /* A number attached with a group*/ - fd, /* To open a fifo for synchronization*/ - first_counter = 0, /* To take n number of readings*/ - second_counter = 0; /* no of times shares have changed*/ - double total_cpu_time, /* Accumulated cpu time*/ - delta_cpu_time, /* Time the task could run on cpu(s)*/ - prev_cpu_time = 0; + int my_group_num; /* A number attached with a group*/ + int fd; /* To open a fifo for synchronization*/ + int first_counter = 0; /* To take n number of readings*/ + int second_counter = 0; /* no of times shares have changed*/ + double total_cpu_time; /* Accumulated cpu time*/ + double delta_cpu_time; /* Time the task could run on cpu(s)*/ + double prev_cpu_time = 0; double exp_cpu_time; /* Exp time in % by shares calculation*/ struct rusage cpu_usage; time_t current_time, prev_time, delta_time; @@ -104,6 +104,10 @@ int main(int argc, char *argv[]) unsigned int fmyshares, num_tasks; struct sigaction newaction, oldaction; + num_cpus = 0; + test_num = 0; + my_group_num = -1; + /* Signal handling for alarm*/ sigemptyset(&newaction.sa_mask); newaction.sa_handler = signal_handler_alarm; @@ -231,8 +235,8 @@ int main(int argc, char *argv[]) myshares = MULTIPLIER * myshares; write_to_file(mysharesfile, "w", myshares); } - /* No need to change shares for def task for test 3 */ + /* No need to change shares for def task for test 3 */ }/* end if*/ }/* end while*/ -}/* end main*/ \ No newline at end of file +}/* end main*/ diff --git a/testcases/kernel/controllers/cpuctl/cpuctl_def_task02.c b/testcases/kernel/controllers/cpuctl/cpuctl_def_task02.c index c160cdb..26d0e55 100644 --- a/testcases/kernel/controllers/cpuctl/cpuctl_def_task02.c +++ b/testcases/kernel/controllers/cpuctl/cpuctl_def_task02.c @@ -83,7 +83,10 @@ volatile int timer_expired = 0; int main(int argc, char *argv[]) { - int test_num, task_num, len, num_cpus; + int test_num; + int task_num; + int len; + int num_cpus; int migrate = 0; /* For task migration*/ char mygroup[FILENAME_MAX], mytaskfile[FILENAME_MAX]; char mysharesfile[FILENAME_MAX], ch; @@ -91,18 +94,24 @@ int main(int argc, char *argv[]) char *group_num_p, *mygroup_p, *script_pid_p, *num_cpus_p; char *test_num_p, *task_num_p; pid_t pid; - int mygroup_num, /* A number attached with a group*/ - fd, /* to open a fifo to synchronize*/ - counter = 0; /* To take n number of readings*/ - double total_cpu_time, /* Accumulated cpu time*/ - delta_cpu_time, /* Time the task could run on cpu(s)*/ - prev_cpu_time = 0; + gid_t mygroup_num; /* A number attached with a group*/ + int fd; /* to open a fifo to synchronize*/ + int counter = 0; /* To take n number of readings*/ + double total_cpu_time; /* Accumulated cpu time*/ + double delta_cpu_time; /* Time the task could run on cpu(s)*/ + double prev_cpu_time = 0; double exp_cpu_time; /* Exp time in % by shares calculation*/ struct rusage cpu_usage; time_t current_time, prev_time, delta_time; unsigned int fmyshares, num_tasks; struct sigaction newaction, oldaction; + + mygroup_num = -1; + num_cpus = 0; + task_num = 0; + test_num = 0; + /* Signal handling for alarm*/ sigemptyset(&newaction.sa_mask); newaction.sa_handler = signal_handler_alarm; @@ -246,4 +255,4 @@ int main(int argc, char *argv[]) } /* end switch*/ } } /* end while*/ -} /* end main*/ \ No newline at end of file +} /* end main*/ diff --git a/testcases/kernel/controllers/cpuctl/cpuctl_def_task03.c b/testcases/kernel/controllers/cpuctl/cpuctl_def_task03.c index 673fbc1..eb96a94 100644 --- a/testcases/kernel/controllers/cpuctl/cpuctl_def_task03.c +++ b/testcases/kernel/controllers/cpuctl/cpuctl_def_task03.c @@ -90,9 +90,9 @@ int main(int argc, char *argv[]) char *group_num_p, *mygroup_p, *script_pid_p, *num_cpus_p; char *test_num_p, *task_num_p; pid_t pid; - int mygroup_num, /* A number attached with a group*/ - fd, /* to open a fifo to synchronize*/ - counter = 0; /* To take n number of readings*/ + gid_t mygroup_num; /* A number attached with a group*/ + int fd; /* to open a fifo to synchronize*/ + int counter = 0; /* To take n number of readings*/ double total_cpu_time, /* Accumulated cpu time*/ delta_cpu_time, /* Time the task could run on cpu(s)*/ prev_cpu_time = 0; @@ -102,6 +102,12 @@ int main(int argc, char *argv[]) time_t current_time, prev_time, delta_time; unsigned int fmyshares, num_tasks; struct sigaction newaction, oldaction; + + mygroup_num = -1; + num_cpus = 0; + task_num = 0; + test_num = 0; + /* Signal handling for alarm*/ sigemptyset(&newaction.sa_mask); newaction.sa_handler = signal_handler_alarm; @@ -239,4 +245,4 @@ int main(int argc, char *argv[]) } /* end switch*/ } /* end if*/ } /* end while*/ -} /* end main*/ \ No newline at end of file +} /* end main*/ diff --git a/testcases/kernel/controllers/cpuctl/cpuctl_def_task04.c b/testcases/kernel/controllers/cpuctl/cpuctl_def_task04.c index 28046c4..2cac5a8 100644 --- a/testcases/kernel/controllers/cpuctl/cpuctl_def_task04.c +++ b/testcases/kernel/controllers/cpuctl/cpuctl_def_task04.c @@ -82,18 +82,21 @@ volatile int timer_expired = 0; int main(int argc, char *argv[]) { - int test_num, task_num, len, num_cpus; + int test_num; + int task_num; + int len; + int num_cpus; char mygroup[FILENAME_MAX], mytaskfile[FILENAME_MAX]; char mysharesfile[FILENAME_MAX], ch; /* Following variables are to capture parameters from script*/ char *group_num_p, *mygroup_p, *script_pid_p, *num_cpus_p; char *test_num_p, *task_num_p; - int mygroup_num, /* A number attached with a group*/ - fd, /* to open a fifo to synchronize*/ - counter = 0; /* To take n number of readings*/ - double total_cpu_time, /* Accumulated cpu time*/ - delta_cpu_time, /* Time the task could run on cpu(s)*/ - prev_cpu_time = 0; + gid_t mygroup_num; /* A number attached with a group*/ + int fd; /* to open a fifo to synchronize*/ + int counter = 0; /* To take n number of readings*/ + double total_cpu_time; /* Accumulated cpu time*/ + double delta_cpu_time; /* Time the task could run on cpu(s)*/ + double prev_cpu_time = 0; double exp_cpu_time; /* Exp time in % by shares calculation*/ struct rusage cpu_usage; @@ -101,6 +104,12 @@ int main(int argc, char *argv[]) unsigned int fmyshares, num_tasks; unsigned int mygroup_shares; struct sigaction newaction, oldaction; + + mygroup_num = -1; + num_cpus = 0; + task_num = 0; + test_num = 0; + /* Signal handling for alarm*/ sigemptyset(&newaction.sa_mask); newaction.sa_handler = signal_handler_alarm; @@ -245,4 +254,4 @@ int main(int argc, char *argv[]) } /* end switch*/ } /* end if*/ } /* end while*/ -} /* end main*/ \ No newline at end of file +} /* end main*/ diff --git a/testcases/kernel/controllers/cpuctl/cpuctl_test01.c b/testcases/kernel/controllers/cpuctl/cpuctl_test01.c index 6aa6a79..c04936d 100644 --- a/testcases/kernel/controllers/cpuctl/cpuctl_test01.c +++ b/testcases/kernel/controllers/cpuctl/cpuctl_test01.c @@ -84,14 +84,16 @@ volatile int timer_expired = 0; int main(int argc, char* argv[]) { - int num_cpus, test_num, len; /* Total time = TIME_INTERVAL *num_cpus in the machine */ + int num_cpus; + int test_num; + int len; /* Total time = TIME_INTERVAL *num_cpus in the machine */ char mygroup[FILENAME_MAX], mytaskfile[FILENAME_MAX]; char mysharesfile[FILENAME_MAX], ch; pid_t pid; - int my_group_num, /* A number attached with a group*/ - fd, /* A descriptor to open a fifo for synchronized start*/ - first_counter =0, /* To take n number of readings*/ - second_counter=0; /* To track number of times the base value of shares has been changed*/ + gid_t my_group_num; /* A number attached with a group*/ + int fd; /* A descriptor to open a fifo for synchronized start*/ + int first_counter =0; /* To take n number of readings*/ + int second_counter=0; /* To track number of times the base value of shares has been changed*/ double total_cpu_time, /* Accumulated cpu time*/ delta_cpu_time, /* Time the task could run on cpu(s) (in an interval)*/ prev_cpu_time=0; @@ -102,6 +104,10 @@ int main(int argc, char* argv[]) unsigned int fmyshares, num_tasks;/* f-> from file. num_tasks is tasks in this group*/ struct sigaction newaction, oldaction; + my_group_num = -1; + num_cpus = 0; + test_num = 0; + /* Signal handling for alarm*/ sigemptyset (&newaction.sa_mask); newaction.sa_handler = signal_handler_alarm; @@ -236,4 +242,4 @@ exp_cpu_time, myshares, delta_time); fprintf(stdout,"\ntask-%d SHARES=%lu\n",my_group_num, myshares); }/* end if*/ }/* end while*/ -}/* end main*/ \ No newline at end of file +}/* end main*/ diff --git a/testcases/kernel/controllers/cpuctl/cpuctl_test02.c b/testcases/kernel/controllers/cpuctl/cpuctl_test02.c index cee6010..a78d41f 100644 --- a/testcases/kernel/controllers/cpuctl/cpuctl_test02.c +++ b/testcases/kernel/controllers/cpuctl/cpuctl_test02.c @@ -84,16 +84,19 @@ volatile int timer_expired = 0; int main(int argc, char* argv[]) { - int test_num, task_num, len, num_cpus; /* Total time = TIME_INTERVAL *num_cpus in the machine */ + int test_num; + int task_num; + int len; + int num_cpus; /* Total time = TIME_INTERVAL *num_cpus in the machine */ int migrate=0; /* For task migration*/ char mygroup[FILENAME_MAX], mytaskfile[FILENAME_MAX]; char mysharesfile[FILENAME_MAX], ch; /* Following variables are to capture parameters from script*/ char *group_num_p, *mygroup_p, *script_pid_p, *num_cpus_p, *test_num_p, *task_num_p; pid_t pid; - int mygroup_num, /* A number attached with a group*/ - fd, /* A descriptor to open a fifo for synchronized start*/ - counter =0; /* To take n number of readings*/ + gid_t mygroup_num; /* A number attached with a group*/ + int fd; /* A descriptor to open a fifo for synchronized start*/ + int counter =0; /* To take n number of readings*/ double total_cpu_time, /* Accumulated cpu time*/ delta_cpu_time, /* Time the task could run on cpu(s) (in an interval)*/ prev_cpu_time=0; @@ -103,6 +106,12 @@ int main(int argc, char* argv[]) time_t current_time, prev_time, delta_time; unsigned int fmyshares, num_tasks;/* f-> from file. num_tasks is tasks in this group*/ struct sigaction newaction, oldaction; + + mygroup_num = -1; + num_cpus = 0; + task_num = 0; + test_num = 0; + /* Signal handling for alarm*/ sigemptyset (&newaction.sa_mask); newaction.sa_handler = signal_handler_alarm; @@ -265,4 +274,4 @@ int migrate_task () char target[32] = "/dev/cpuctl/group_2/tasks";/* Hard coding..Will try dynamic*/ pid_t pid = getpid(); return (write_to_file (target, "a", pid)); -} \ No newline at end of file +} diff --git a/testcases/kernel/controllers/cpuctl/cpuctl_test03.c b/testcases/kernel/controllers/cpuctl/cpuctl_test03.c index 49a535b..b435e08 100644 --- a/testcases/kernel/controllers/cpuctl/cpuctl_test03.c +++ b/testcases/kernel/controllers/cpuctl/cpuctl_test03.c @@ -83,7 +83,10 @@ volatile int timer_expired = 0; int main(int argc, char* argv[]) { - int test_num, task_num, len, num_cpus; /* Total time = TIME_INTERVAL *num_cpus in the machine */ + int test_num; + int task_num; + int len; + int num_cpus; /* Total time = TIME_INTERVAL *num_cpus in the machine */ char mygroup[FILENAME_MAX], mytaskfile[FILENAME_MAX]; char mysharesfile[FILENAME_MAX], ch; /* Following variables are to capture parameters from script*/ @@ -99,8 +102,13 @@ int main(int argc, char* argv[]) struct rusage cpu_usage; time_t current_time, prev_time, delta_time; unsigned int fmyshares, num_tasks;/* f-> from file. num_tasks is tasks in this group*/ - struct sigaction newaction, oldaction; + + mygroup_num = -1; + num_cpus = 0; + task_num = 0; + test_num = 0; + /* Signal handling for alarm*/ sigemptyset (&newaction.sa_mask); newaction.sa_handler = signal_handler_alarm; @@ -226,4 +234,4 @@ exp_cpu_time, delta_time); } /* end switch*/ } /* end if*/ } /* end while*/ -} /* end main*/ \ No newline at end of file +} /* end main*/ diff --git a/testcases/kernel/controllers/cpuctl/cpuctl_test04.c b/testcases/kernel/controllers/cpuctl/cpuctl_test04.c index 92d7312..93aef68 100644 --- a/testcases/kernel/controllers/cpuctl/cpuctl_test04.c +++ b/testcases/kernel/controllers/cpuctl/cpuctl_test04.c @@ -83,14 +83,17 @@ volatile int timer_expired = 0; int main(int argc, char* argv[]) { - int test_num, task_num, len, num_cpus; /* Total time = TIME_INTERVAL *num_cpus in the machine */ + int test_num; + int task_num; + int len; + int num_cpus; /* Total time = TIME_INTERVAL *num_cpus in the machine */ char mygroup[FILENAME_MAX], mytaskfile[FILENAME_MAX]; char mysharesfile[FILENAME_MAX], ch; /* Following variables are to capture parameters from script*/ char *group_num_p, *mygroup_p, *script_pid_p, *num_cpus_p, *test_num_p, *task_num_p; - int mygroup_num, /* A number attached with a group*/ - fd, /* A descriptor to open a fifo for synchronized start*/ - counter =0; /* To take n number of readings*/ + gid_t mygroup_num; /* A number attached with a group*/ + int fd; /* A descriptor to open a fifo for synchronized start*/ + int counter =0; /* To take n number of readings*/ double total_cpu_time, /* Accumulated cpu time*/ delta_cpu_time, /* Time the task could run on cpu(s) (in an interval)*/ prev_cpu_time=0; @@ -100,6 +103,12 @@ int main(int argc, char* argv[]) time_t current_time, prev_time, delta_time; unsigned int fmyshares, num_tasks;/* f-> from file. num_tasks is tasks in this group*/ struct sigaction newaction, oldaction; + + mygroup_num = -1; + num_cpus = 0; + task_num = 0; + test_num = 0; + /* Signal handling for alarm*/ sigemptyset (&newaction.sa_mask); newaction.sa_handler = signal_handler_alarm; @@ -236,4 +245,4 @@ exp_cpu_time, fmyshares, delta_time); } /* end switch*/ } /* end if*/ } /* end while*/ -} /* end main*/ \ No newline at end of file +} /* end main*/ diff --git a/testcases/kernel/mem/hugetlb/hugemmap/hugemmap05.c b/testcases/kernel/mem/hugetlb/hugemmap/hugemmap05.c index d28d6d1..8336116 100644 --- a/testcases/kernel/mem/hugetlb/hugemmap/hugemmap05.c +++ b/testcases/kernel/mem/hugetlb/hugemmap/hugemmap05.c @@ -97,7 +97,7 @@ static option_t options[] = { { NULL, NULL, NULL} }; static void setup(void); -static void cleanup(void) LTP_ATTRIBUTE_NORETURN; +static void cleanup(void); static void overcommit(void); static void write_bytes(void *addr); static void read_bytes(void *addr); diff --git a/testcases/kernel/mem/vmtests/data_space.c b/testcases/kernel/mem/vmtests/data_space.c index dbe074b..b4d4811 100644 --- a/testcases/kernel/mem/vmtests/data_space.c +++ b/testcases/kernel/mem/vmtests/data_space.c @@ -63,6 +63,10 @@ int allchild[MAXCHILD +1]; #define K_2 2048 #define K_4 4096 +#define bd_arg(str) \ + tst_brkm(TCONF, NULL, \ + "bad argument - %s - could not parse as number.", str) + int nchild; /* # kids */ int csize; /* chunk size */ int iterations; /* # total iterations */ @@ -71,7 +75,6 @@ int max_size; /* max file size */ int parent_pid; int usage(char*); -int bd_arg(char *); int runtest(); int dotest(int,int); void bfill(char*,char,int); @@ -147,12 +150,6 @@ int main(argc, argv) tst_exit(); } -int bd_arg(str) - char *str; -{ - tst_brkm(TCONF, NULL, "Bad argument - %s - could not parse as number.\n", str); -} - int runtest() { register int i; @@ -511,4 +508,4 @@ int okexit(me) } return 0; -} \ No newline at end of file +} hooks/post-receive -- ltp |