Trivial fixes for a bunch of compiler warnings
cover Trivial fixes for a bunch of compiler warnings
Hi again,
I was able to remove some trivial compiler warnings again. Local build-testing succeeded.
Michael Moese (10):
fix old-style-definition in written.c
fix old-style-definition in readline.c
fix old-style-definition and unused parameter in pthcli.c fix old-style-definition and unused parameter in pthserv.c fix old-style-definition in hackbench.c
fix old-style-definition in ht_utils.c
fix old-style-definition in ht_utils.c
fix old-style-definition in ht_utils.c
fix old-style-definition and unused parameter in ht_affinity.c fix unused-parameter and old-style-definition in ht_interrupt.c
testcases/kernel/sched/cfs-scheduler/hackbench.c | 2 +- testcases/kernel/sched/clisrv/pthcli.c | 5 ++--- testcases/kernel/sched/clisrv/pthserv.c | 4 ++-- testcases/kernel/sched/clisrv/readline.c | 5 +---- testcases/kernel/sched/clisrv/writen.c | 5 +---- .../kernel/sched/hyperthreading/ht_affinity/ht_affinity.c | 8 ++++---- testcases/kernel/sched/hyperthreading/ht_affinity/ht_utils.c | 6 +++--- testcases/kernel/sched/hyperthreading/ht_enabled/ht_utils.c | 6 +++--- .../kernel/sched/hyperthreading/ht_interrupt/ht_interrupt.c | 4 ++-- testcases/kernel/sched/hyperthreading/ht_interrupt/ht_utils.c | 10 +++++----- 10 files changed, 24 insertions(+), 31 deletions(-)
Signature · 1 line
2.13.6
PATCH 1/10 fix old-style-definition in written.c
--- testcases/kernel/sched/clisrv/writen.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
testcases/kernel/sched/clisrv/writen.c +1 -4
@@ -25,10 +25,7 @@/* Write "n" bytes to a descriptor Use instead of write() when fd is a stream socket. */ -int writen (fd, ptr, nbytes) -registerint fd; -registerchar *ptr; -registerint nbytes; +int writen (int fd,char *ptr,int nbytes) {int nleft, nwritten;
Signature · 1 line
2.13.6
PATCH 2/10 fix old-style-definition in readline.c
In reply to Michael Moese--- testcases/kernel/sched/clisrv/readline.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
testcases/kernel/sched/clisrv/readline.c +1 -4
@@ -25,10 +25,7 @@/* Read line from a descriptor, byte at a time, return number of characters up to the null */ -int readline (fd, ptr, maxlen) -registerint fd; -registerchar *ptr; -registerint maxlen; +int readline (int fd,char *ptr,int maxlen) {int n, rc;char c;
Signature · 1 line
2.13.6
PATCH 3/10 fix old-style-definition and unused parameter in pthcli.c
In reply to Michael Moese--- testcases/kernel/sched/clisrv/pthcli.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
testcases/kernel/sched/clisrv/pthcli.c +2 -3
@@ -53,15 +53,14 @@void noprintf (char *string, ...) { + (void ) string; }/* Read contents of FILE *fp. Write each line to socket, then read line back from socket and write to standard output. Return to caller when done */ -void str_cli (fp, sockfd) -registerFILE *fp; -registerint sockfd; +void str_cli (FILE *fp,int sockfd) {int n;char sendline[MAXLINE ], recvline[MAXLINE +1 ];
Signature · 1 line
2.13.6
PATCH 4/10 fix old-style-definition and unused parameter in pthserv.c
In reply to Michael Moese--- testcases/kernel/sched/clisrv/pthserv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
testcases/kernel/sched/clisrv/pthserv.c +2 -2
@@ -53,8 +53,7 @@ int sockfd;/* Read a stream socket one line at a time and write each line back to sender. Return when connection is terminated */ -int str_echo (sockfd) -int sockfd; +int str_echo (int sockfd) {int n, testint;char line[MAXLINE ];
@@ -95,6 +94,7 @@ int main(int argc, char *argv[])struct sockaddr_in cli_addr, serv_addr; pname = argv[0 ]; + (void ) argc;prtln ();/* Open inet stream socket */ if ((sockfd =socket (AF_INET ,SOCK_STREAM ,0 )) <0 ) {
Signature · 1 line
2.13.6
PATCH 5/10 fix old-style-definition in hackbench.c
In reply to Michael Moese--- testcases/kernel/sched/cfs-scheduler/hackbench.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
testcases/kernel/sched/cfs-scheduler/hackbench.c +1 -1
@@ -92,7 +92,7 @@ static void barf(const char *msg)exit (1 ); } -static void print_usage_exit () +static void print_usage_exit (void ) {printf ("Usage: hackbench [-pipe] <num groups> [process|thread] [loops]\n" );
Signature · 1 line
2.13.6
PATCH 6/10 fix old-style-definition in ht_utils.c
In reply to Michael Moese--- testcases/kernel/sched/hyperthreading/ht_affinity/ht_utils.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
testcases/kernel/sched/hyperthreading/ht_affinity/ht_utils.c +3 -3
@@ -16,7 +16,7 @@char buffer[BUFF_SIZE ]; -int is_ht_cpu () +int is_ht_cpu (void ) {/*Number of logic processor in a physical processor */ int smp_num_siblings =-1 ;
@@ -39,7 +39,7 @@ int is_ht_cpu()/* return 0 means Pass, return 1 means ht is not enabled,*/ -int check_ht_capability () +int check_ht_capability (void ) {int result;if (is_ht_cpu ())
@@ -57,7 +57,7 @@ int check_ht_capability()char buf[256 ]; -int get_cpu_count () +int get_cpu_count (void ) {FILE *pfile;int count;
Signature · 1 line
2.13.6
PATCH 7/10 fix old-style-definition in ht_utils.c
In reply to Michael Moese--- testcases/kernel/sched/hyperthreading/ht_enabled/ht_utils.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
testcases/kernel/sched/hyperthreading/ht_enabled/ht_utils.c +3 -3
@@ -19,7 +19,7 @@char buffer[BUFF_SIZE ]; -int is_ht_cpu () +int is_ht_cpu (void ) {/*Number of logic processor in a physical processor */ int smp_num_siblings =-1 ;
@@ -41,7 +41,7 @@ int is_ht_cpu()/*return 0 means Pass, return 1 means ht is not enabled*/ -int check_ht_capability () +int check_ht_capability (void ) {int result;if (is_ht_cpu ()) {
@@ -61,7 +61,7 @@ int check_ht_capability()char buf[256 ]; -int get_cpu_count () +int get_cpu_count (void ) {FILE *pfile;int count;
Signature · 1 line
2.13.6
PATCH 8/10 fix old-style-definition in ht_utils.c
In reply to Michael Moese--- testcases/kernel/sched/hyperthreading/ht_interrupt/ht_utils.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
testcases/kernel/sched/hyperthreading/ht_interrupt/ht_utils.c +5 -5
@@ -41,7 +41,7 @@ int is_cmdline_para(const char *para)return 0 ; } -int is_ht_kernel () +int is_ht_kernel (void ) {FILE *fp;
@@ -59,7 +59,7 @@ int is_ht_kernel()return 0 ; } -int is_ht_cpu () +int is_ht_cpu (void ) {/*Number of logic processor in a physical processor */ int smp_num_siblings =-1 ;
@@ -79,7 +79,7 @@ int is_ht_cpu() } } -int is_ht_enabled () +int is_ht_enabled (void ) {int cpu_map[MAX_CPU_NUM ];/*A bit-map shows whether a 'logic' processor has ht flag */
@@ -176,7 +176,7 @@ int is_ht_enabled()// return 1 means ht is not enabled, // return 2 means CPU is not support ht, // return 3 mean kernel is not support ht. -int check_ht_capability () +int check_ht_capability (void ) {int result;
@@ -201,7 +201,7 @@ int check_ht_capability()char buf[256 ]; -int get_cpu_count () +int get_cpu_count (void ) {FILE *pfile;int count;
Signature · 1 line
2.13.6
PATCH 9/10 fix old-style-definition and unused parameter in ht_affinity.c
In reply to Michael Moese--- testcases/kernel/sched/hyperthreading/ht_affinity/ht_affinity.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
testcases/kernel/sched/hyperthreading/ht_affinity/ht_affinity.c +4 -4
@@ -46,7 +46,7 @@ len - length in bytes of the bitmask pointed to by user_mask_ptr.#define AFFINITY_NAME "affinity"#define PROCFS_PATH "/proc/" -int HT_SetAffinity () +int HT_SetAffinity (void ) {unsigned int mask;pid_t pid;
@@ -145,7 +145,7 @@ unsigned long get_porc_affinity(pid_t pid)return atol (buf); } -int HT_GetAffinity () +int HT_GetAffinity (void ) {unsigned int mask[2 ], mask1[2 ];pid_t pid;
@@ -177,7 +177,7 @@ int HT_GetAffinity()return 0 ; } -int HT_InheritAffinity () +int HT_InheritAffinity (void ) {unsigned int mask[2 ];pid_t pid;
@@ -211,7 +211,7 @@ int HT_InheritAffinity() }// return 0 means Pass, return 1 means Fail -int main (int argc,char *argv[]) +int main (void ) {#if (!defined __i386__ && !defined __x86_64__)
Signature · 1 line
2.13.6
PATCH 10/10 fix unused-parameter and old-style-definition in ht_interrupt.c
In reply to Michael Moese--- testcases/kernel/sched/hyperthreading/ht_interrupt/ht_interrupt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
testcases/kernel/sched/hyperthreading/ht_interrupt/ht_interrupt.c +2 -2
@@ -24,7 +24,7 @@ int TST_TOTAL = 1;#define INTERRUPT_NAME "/proc/interrupts" -int HT_InterruptDistribution () +int HT_InterruptDistribution (void ) {FILE *pFile;int ci[32 ], cj[32 ];
@@ -91,7 +91,7 @@ int HT_InterruptDistribution() }// return 0 means Pass, return 1 means Fail. -int main (int argc,char *argv[]) +int main (void ) {tst_resm (TINFO ,"Begin: HyperThreading Interrupt" );
Signature · 1 line
2.13.6
cover Trivial fixes for a bunch of compiler warnings
In reply to Michael MoeseHi!
Pushed, thanks.
Signature · 2 lines
Cyril Hrubis [email protected]