qemu-trivial
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-trivial] [PATCH 4/4] bsd-user: replace fprintf(stderr, ...) wi


From: Michael Tokarev
Subject: Re: [Qemu-trivial] [PATCH 4/4] bsd-user: replace fprintf(stderr, ...) with error_report()
Date: Sat, 24 May 2014 01:16:29 +0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Icedove/24.5.0

10.05.2014 03:55, Le Tan wrote:
> Replace fprintf(stderr,...) with error_report() in files bsd-user/*.
> The trailing "\n"s of the @fmt argument have been removed
> because @fmt of error_report() should not contain newline.

I'd fix two issues in there:

...
>          default:
>              pc = env->segs[R_CS].base + env->eip;
> -            fprintf(stderr, "qemu: 0x%08lx: unhandled CPU exception 0x%x - 
> aborting\n",
> -                    (long)pc, trapnr);
> +            error_report("qemu: 0x%08lx: unhandled CPU exception 0x%x - 
> aborting",
> +                         (long)pc, trapnr);
>              abort();

Wrapping this line differently to fit in 80 columns.
Yes, the original line was even longer.

>      if ((envlist = envlist_create()) == NULL) {
> -        (void) fprintf(stderr, "Unable to allocate envlist\n");
> +        (void) error_report("Unable to allocate envlist");

And removed these void casts (here and elsewhere), these aern't
needed, error_report() is a function returning void.

>          exit(1);

I think we may use some other function here and in all other places,
which combines error_report with exit/abort.  What's the proper
function for this?

Anyway, applying this patch for now, with the fixed outlined.
Please always check your patches using checkpatch.pl before
sending.

Thanks,

/mjt



reply via email to

[Prev in Thread] Current Thread [Next in Thread]