All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael Tokarev <mjt@tls.msk.ru>
To: Le Tan <tamlokveer@gmail.com>, qemu-devel@nongnu.org
Cc: qemu-trivial@nongnu.org, jan.kiszka@web.de, afaerber@suse.de
Subject: Re: [Qemu-trivial] [PATCH 4/4] bsd-user: replace fprintf(stderr, ...) with error_report()
Date: Sat, 24 May 2014 01:16:29 +0400	[thread overview]
Message-ID: <537FBAAD.4080907@msgid.tls.msk.ru> (raw)
In-Reply-To: <1d899df865235022831f0733c874dae9f0ba21ed.1399641611.git.tamlokveer@gmail.com>

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


WARNING: multiple messages have this Message-ID (diff)
From: Michael Tokarev <mjt@tls.msk.ru>
To: Le Tan <tamlokveer@gmail.com>, qemu-devel@nongnu.org
Cc: qemu-trivial@nongnu.org, jan.kiszka@web.de, afaerber@suse.de
Subject: Re: [Qemu-devel] [Qemu-trivial] [PATCH 4/4] bsd-user: replace fprintf(stderr, ...) with error_report()
Date: Sat, 24 May 2014 01:16:29 +0400	[thread overview]
Message-ID: <537FBAAD.4080907@msgid.tls.msk.ru> (raw)
In-Reply-To: <1d899df865235022831f0733c874dae9f0ba21ed.1399641611.git.tamlokveer@gmail.com>

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	other threads:[~2014-05-23 21:16 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-09 23:55 [Qemu-trivial] [PATCH 0/4] replace some fprintf(stderr, ...) with error_report() Le Tan
2014-05-09 23:55 ` [Qemu-devel] " Le Tan
2014-05-09 23:55 ` [Qemu-trivial] [PATCH 1/4] arch_init: replace fprintf(stderr, ...) with error_report() in arch_init.c Le Tan
2014-05-09 23:55   ` [Qemu-devel] " Le Tan
2014-05-24  5:41   ` [Qemu-trivial] " Le Tan
2014-05-24  5:41     ` [Qemu-devel] " Le Tan
2014-05-24  5:56     ` [Qemu-trivial] " Michael Tokarev
2014-05-24  5:56       ` Michael Tokarev
2014-05-09 23:55 ` [Qemu-trivial] [PATCH 2/4] audio: replace fprintf(stderr, ...) with error_report() in audio Le Tan
2014-05-09 23:55   ` [Qemu-devel] " Le Tan
2014-05-23 21:04   ` [Qemu-trivial] " Michael Tokarev
2014-05-23 21:04     ` [Qemu-devel] " Michael Tokarev
2014-05-09 23:55 ` [Qemu-trivial] [PATCH 3/4] block: replace fprintf(stderr, ...) with error_report() in block/ Le Tan
2014-05-09 23:55   ` [Qemu-devel] " Le Tan
2014-05-10 13:18   ` [Qemu-trivial] " Peter Crosthwaite
2014-05-10 13:18     ` Peter Crosthwaite
2014-05-11 13:27     ` [Qemu-trivial] " Le Tan
2014-05-11 13:27       ` Le Tan
2014-05-12  1:13       ` [Qemu-trivial] " Peter Crosthwaite
2014-05-12  1:13         ` Peter Crosthwaite
2014-05-24  5:44     ` [Qemu-trivial] " Le Tan
2014-05-24  5:44       ` Le Tan
2014-05-09 23:55 ` [Qemu-trivial] [PATCH 4/4] bsd-user: replace fprintf(stderr, ...) with error_report() Le Tan
2014-05-09 23:55   ` [Qemu-devel] " Le Tan
2014-05-23 21:16   ` Michael Tokarev [this message]
2014-05-23 21:16     ` [Qemu-devel] [Qemu-trivial] " Michael Tokarev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=537FBAAD.4080907@msgid.tls.msk.ru \
    --to=mjt@tls.msk.ru \
    --cc=afaerber@suse.de \
    --cc=jan.kiszka@web.de \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    --cc=tamlokveer@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.