Re: [Qemu-devel] [PATCH 03/26] cris: use exit(EXIT_SUCCESS) and exit(EXIT_FAILURE)
On Fri, Sep 16, 2016 at 03:55:54PM +0200, Laurent Vivier wrote: > This patch is the result of coccinelle script > scripts/coccinelle/exit.cocci > > Signed-off-by: Laurent Vivier > CC: Edgar E. Iglesias Reviewed-by: Edgar E. Iglesias > --- > hw/cris/boot.c | 4 ++-- > tests/tcg/cris/check_gcctorture_pr28634-1.c | 2 +- > tests/tcg/cris/check_gcctorture_pr28634.c | 2 +- > tests/tcg/cris/check_glibc_kernelversion.c | 2 +- > tests/tcg/cris/check_hello.c| 2 +- > tests/tcg/cris/check_lz.c | 2 +- > tests/tcg/cris/check_mapbrk.c | 6 +++--- > tests/tcg/cris/check_mmap1.c| 2 +- > tests/tcg/cris/check_mmap2.c| 2 +- > tests/tcg/cris/check_mmap3.c| 2 +- > tests/tcg/cris/check_openpf5.c | 2 +- > tests/tcg/cris/check_stat1.c| 2 +- > tests/tcg/cris/check_stat2.c| 2 +- > tests/tcg/cris/check_stat3.c| 2 +- > tests/tcg/cris/check_stat4.c| 2 +- > tests/tcg/cris/check_time1.c| 2 +- > tests/tcg/cris/check_time2.c| 2 +- > tests/tcg/cris/sys.c| 2 +- > 18 files changed, 21 insertions(+), 21 deletions(-) > > diff --git a/hw/cris/boot.c b/hw/cris/boot.c > index f896ed7..85ab8c4 100644 > --- a/hw/cris/boot.c > +++ b/hw/cris/boot.c > @@ -88,13 +88,13 @@ void cris_load_image(CRISCPU *cpu, struct cris_load_info > *li) > if (image_size < 0) { > fprintf(stderr, "qemu: could not load kernel '%s'\n", > li->image_filename); > -exit(1); > +exit(EXIT_FAILURE); > } > > if (li->cmdline && (kcmdline_len = strlen(li->cmdline))) { > if (kcmdline_len > 256) { > fprintf(stderr, "Too long CRIS kernel cmdline (max 256)\n"); > -exit(1); > +exit(EXIT_FAILURE); > } > pstrcpy_targphys("cmdline", 0x4000, 256, li->cmdline); > } > diff --git a/tests/tcg/cris/check_gcctorture_pr28634-1.c > b/tests/tcg/cris/check_gcctorture_pr28634-1.c > index 45ecd15..ebe3f6f 100644 > --- a/tests/tcg/cris/check_gcctorture_pr28634-1.c > +++ b/tests/tcg/cris/check_gcctorture_pr28634-1.c > @@ -11,5 +11,5 @@ main (void) > y += x; >if (y != x + 1) > abort (); > - exit (0); > + exit(EXIT_SUCCESS); > } > diff --git a/tests/tcg/cris/check_gcctorture_pr28634.c > b/tests/tcg/cris/check_gcctorture_pr28634.c > index a0c5254..52e5ef3 100644 > --- a/tests/tcg/cris/check_gcctorture_pr28634.c > +++ b/tests/tcg/cris/check_gcctorture_pr28634.c > @@ -11,5 +11,5 @@ main (void) > y += x; >if (y != x + 1) > abort (); > - exit (0); > + exit(EXIT_SUCCESS); > } > diff --git a/tests/tcg/cris/check_glibc_kernelversion.c > b/tests/tcg/cris/check_glibc_kernelversion.c > index 0744872..ebc4959 100644 > --- a/tests/tcg/cris/check_glibc_kernelversion.c > +++ b/tests/tcg/cris/check_glibc_kernelversion.c > @@ -112,5 +112,5 @@ int main(void) > if (version < __LINUX_KERNEL_VERSION) > err(); > pass(); > - exit(0); > + exit(EXIT_SUCCESS); > } > diff --git a/tests/tcg/cris/check_hello.c b/tests/tcg/cris/check_hello.c > index fb403ba..14b6fff 100644 > --- a/tests/tcg/cris/check_hello.c > +++ b/tests/tcg/cris/check_hello.c > @@ -3,5 +3,5 @@ > int main () > { >printf ("pass\n"); > - exit (0); > + exit(EXIT_SUCCESS); > } > diff --git a/tests/tcg/cris/check_lz.c b/tests/tcg/cris/check_lz.c > index 69c2e6d..603aeac 100644 > --- a/tests/tcg/cris/check_lz.c > +++ b/tests/tcg/cris/check_lz.c > @@ -45,5 +45,5 @@ int main(void) > { > check_lz(); > pass(); > - exit(0); > + exit(EXIT_SUCCESS); > } > diff --git a/tests/tcg/cris/check_mapbrk.c b/tests/tcg/cris/check_mapbrk.c > index 1aff762..8d5ec3f 100644 > --- a/tests/tcg/cris/check_mapbrk.c > +++ b/tests/tcg/cris/check_mapbrk.c > @@ -16,7 +16,7 @@ int main () >|| (p6 = malloc (8191*1024)) == NULL) >{ > printf ("fail\n"); > -exit (1); > +exit(EXIT_FAILURE); >} > >free (p1); > @@ -30,10 +30,10 @@ int main () >if (p1 == NULL) >{ > printf ("fail\n"); > -exit (1); > +exit(EXIT_FAILURE); >} >free (p1); > >printf ("pass\n"); > - exit (0); > + exit(EXIT_SUCCESS); > } > diff --git a/tests/tcg/cris/check_mmap1.c b/tests/tcg/cris/check_mmap1.c > index b803f0c..12a7fb5 100644 > --- a/tests/tcg/cris/check_mmap1.c > +++ b/tests/tcg/cris/check_mmap1.c > @@ -44,5 +44,5 @@ int main (int argc, char *argv[]) > abort (); > >printf ("pass\n"); > - exit (0); > + exit(EXIT_SUCCESS); > } > diff --git a/tests/tcg/cris/check_mmap2.c b/tests/tcg/cris/check_mmap2.c > index 35139a0..6c04db3 100644 > --- a/tests/tcg/cris/check_mmap2.c > +++ b/tests/tcg/cris/check_mmap2.c > @@ -44,5 +44,5 @@ int main (int argc, char *argv[]) > abort (); > >printf ("pass\n"); > - exit (0); > + exit(EXIT_SUCCESS); >
[Qemu-devel] [PATCH 03/26] cris: use exit(EXIT_SUCCESS) and exit(EXIT_FAILURE)
This patch is the result of coccinelle script scripts/coccinelle/exit.cocci Signed-off-by: Laurent Vivier CC: Edgar E. Iglesias --- hw/cris/boot.c | 4 ++-- tests/tcg/cris/check_gcctorture_pr28634-1.c | 2 +- tests/tcg/cris/check_gcctorture_pr28634.c | 2 +- tests/tcg/cris/check_glibc_kernelversion.c | 2 +- tests/tcg/cris/check_hello.c| 2 +- tests/tcg/cris/check_lz.c | 2 +- tests/tcg/cris/check_mapbrk.c | 6 +++--- tests/tcg/cris/check_mmap1.c| 2 +- tests/tcg/cris/check_mmap2.c| 2 +- tests/tcg/cris/check_mmap3.c| 2 +- tests/tcg/cris/check_openpf5.c | 2 +- tests/tcg/cris/check_stat1.c| 2 +- tests/tcg/cris/check_stat2.c| 2 +- tests/tcg/cris/check_stat3.c| 2 +- tests/tcg/cris/check_stat4.c| 2 +- tests/tcg/cris/check_time1.c| 2 +- tests/tcg/cris/check_time2.c| 2 +- tests/tcg/cris/sys.c| 2 +- 18 files changed, 21 insertions(+), 21 deletions(-) diff --git a/hw/cris/boot.c b/hw/cris/boot.c index f896ed7..85ab8c4 100644 --- a/hw/cris/boot.c +++ b/hw/cris/boot.c @@ -88,13 +88,13 @@ void cris_load_image(CRISCPU *cpu, struct cris_load_info *li) if (image_size < 0) { fprintf(stderr, "qemu: could not load kernel '%s'\n", li->image_filename); -exit(1); +exit(EXIT_FAILURE); } if (li->cmdline && (kcmdline_len = strlen(li->cmdline))) { if (kcmdline_len > 256) { fprintf(stderr, "Too long CRIS kernel cmdline (max 256)\n"); -exit(1); +exit(EXIT_FAILURE); } pstrcpy_targphys("cmdline", 0x4000, 256, li->cmdline); } diff --git a/tests/tcg/cris/check_gcctorture_pr28634-1.c b/tests/tcg/cris/check_gcctorture_pr28634-1.c index 45ecd15..ebe3f6f 100644 --- a/tests/tcg/cris/check_gcctorture_pr28634-1.c +++ b/tests/tcg/cris/check_gcctorture_pr28634-1.c @@ -11,5 +11,5 @@ main (void) y += x; if (y != x + 1) abort (); - exit (0); + exit(EXIT_SUCCESS); } diff --git a/tests/tcg/cris/check_gcctorture_pr28634.c b/tests/tcg/cris/check_gcctorture_pr28634.c index a0c5254..52e5ef3 100644 --- a/tests/tcg/cris/check_gcctorture_pr28634.c +++ b/tests/tcg/cris/check_gcctorture_pr28634.c @@ -11,5 +11,5 @@ main (void) y += x; if (y != x + 1) abort (); - exit (0); + exit(EXIT_SUCCESS); } diff --git a/tests/tcg/cris/check_glibc_kernelversion.c b/tests/tcg/cris/check_glibc_kernelversion.c index 0744872..ebc4959 100644 --- a/tests/tcg/cris/check_glibc_kernelversion.c +++ b/tests/tcg/cris/check_glibc_kernelversion.c @@ -112,5 +112,5 @@ int main(void) if (version < __LINUX_KERNEL_VERSION) err(); pass(); - exit(0); + exit(EXIT_SUCCESS); } diff --git a/tests/tcg/cris/check_hello.c b/tests/tcg/cris/check_hello.c index fb403ba..14b6fff 100644 --- a/tests/tcg/cris/check_hello.c +++ b/tests/tcg/cris/check_hello.c @@ -3,5 +3,5 @@ int main () { printf ("pass\n"); - exit (0); + exit(EXIT_SUCCESS); } diff --git a/tests/tcg/cris/check_lz.c b/tests/tcg/cris/check_lz.c index 69c2e6d..603aeac 100644 --- a/tests/tcg/cris/check_lz.c +++ b/tests/tcg/cris/check_lz.c @@ -45,5 +45,5 @@ int main(void) { check_lz(); pass(); - exit(0); + exit(EXIT_SUCCESS); } diff --git a/tests/tcg/cris/check_mapbrk.c b/tests/tcg/cris/check_mapbrk.c index 1aff762..8d5ec3f 100644 --- a/tests/tcg/cris/check_mapbrk.c +++ b/tests/tcg/cris/check_mapbrk.c @@ -16,7 +16,7 @@ int main () || (p6 = malloc (8191*1024)) == NULL) { printf ("fail\n"); -exit (1); +exit(EXIT_FAILURE); } free (p1); @@ -30,10 +30,10 @@ int main () if (p1 == NULL) { printf ("fail\n"); -exit (1); +exit(EXIT_FAILURE); } free (p1); printf ("pass\n"); - exit (0); + exit(EXIT_SUCCESS); } diff --git a/tests/tcg/cris/check_mmap1.c b/tests/tcg/cris/check_mmap1.c index b803f0c..12a7fb5 100644 --- a/tests/tcg/cris/check_mmap1.c +++ b/tests/tcg/cris/check_mmap1.c @@ -44,5 +44,5 @@ int main (int argc, char *argv[]) abort (); printf ("pass\n"); - exit (0); + exit(EXIT_SUCCESS); } diff --git a/tests/tcg/cris/check_mmap2.c b/tests/tcg/cris/check_mmap2.c index 35139a0..6c04db3 100644 --- a/tests/tcg/cris/check_mmap2.c +++ b/tests/tcg/cris/check_mmap2.c @@ -44,5 +44,5 @@ int main (int argc, char *argv[]) abort (); printf ("pass\n"); - exit (0); + exit(EXIT_SUCCESS); } diff --git a/tests/tcg/cris/check_mmap3.c b/tests/tcg/cris/check_mmap3.c index 34401fa..9430177 100644 --- a/tests/tcg/cris/check_mmap3.c +++ b/tests/tcg/cris/check_mmap3.c @@ -29,5 +29,5 @@ int main (int argc, char *argv[]) abort (); printf ("pass\n"); - exit (0); + exit(EXIT_SUCCESS); } diff --git a/tests/tcg/cris/check_openpf5.c b/tests/tcg/cris/check_openpf5.c ind