qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Huth <thuth@redhat.com>
To: "Philippe Mathieu-Daudé" <f4bug@amsat.org>,
	"Peter Maydell" <peter.maydell@linaro.org>
Cc: qemu-trivial@nongnu.org, qemu-arm@nongnu.org, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 07/11] hw/i2c/omap_i2c: Use qemu_log_mask(UNIMP) instead of fprintf
Date: Fri, 22 Jun 2018 10:29:10 +0200	[thread overview]
Message-ID: <d57b6ebf-f28e-083f-9cf5-6a4c702b9d96@redhat.com> (raw)
In-Reply-To: <20180621180224.8312-8-f4bug@amsat.org>

On 21.06.2018 20:02, Philippe Mathieu-Daudé wrote:
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>  hw/i2c/omap_i2c.c | 23 +++++++++++++++--------
>  1 file changed, 15 insertions(+), 8 deletions(-)
> 
> diff --git a/hw/i2c/omap_i2c.c b/hw/i2c/omap_i2c.c
> index 26e3e5ebf6..e6f34fe31f 100644
> --- a/hw/i2c/omap_i2c.c
> +++ b/hw/i2c/omap_i2c.c
> @@ -17,6 +17,7 @@
>   * with this program; if not, see <http://www.gnu.org/licenses/>.
>   */
>  #include "qemu/osdep.h"
> +#include "qemu/log.h"
>  #include "hw/hw.h"
>  #include "hw/i2c/i2c.h"
>  #include "hw/arm/omap.h"
> @@ -339,14 +340,17 @@ static void omap_i2c_write(void *opaque, hwaddr addr,
>              }
>              break;
>          }
> -        if ((value & (1 << 15)) && !(value & (1 << 10))) {	/* MST */
> -            fprintf(stderr, "%s: I^2C slave mode not supported\n",
> -                            __func__);
> +        if ((value & (1 << 15)) && !(value & (1 << 10))) {
> +            /* MST */
> +            qemu_log_mask(LOG_UNIMP, "%s: I^2C slave mode not supported\n",
> +                          __func__);
>              break;
>          }
> -        if ((value & (1 << 15)) && value & (1 << 8)) {		/* XA */
> -            fprintf(stderr, "%s: 10-bit addressing mode not supported\n",
> -                            __func__);
> +        if ((value & (1 << 15)) && value & (1 << 8)) {
> +            /* XA */
> +            qemu_log_mask(LOG_UNIMP,
> +                          "%s: 10-bit addressing mode not supported\n",
> +                          __func__);
>              break;
>          }
>          if ((value & (1 << 15)) && value & (1 << 0)) {		/* STT */
> @@ -392,8 +396,11 @@ static void omap_i2c_write(void *opaque, hwaddr addr,
>                  s->stat |= 0x3f;
>                  omap_i2c_interrupts_update(s);
>              }
> -        if (value & (1 << 15))					/* ST_EN */
> -            fprintf(stderr, "%s: System Test not supported\n", __func__);
> +        if (value & (1 << 15)) {
> +            /* ST_EN */
> +            qemu_log_mask(LOG_UNIMP,
> +                          "%s: System Test not supported\n", __func__);
> +        }
>          break;
>  
>      default:

Could you please leave the comments at the end of the if-statement lines?

 Thomas

  reply	other threads:[~2018-06-22  8:29 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-21 18:02 [Qemu-devel] [PATCH 00/11] hw/arm: use qemu_log_mask instead of fprintf Philippe Mathieu-Daudé
2018-06-21 18:02 ` [Qemu-devel] [PATCH 01/11] hw/input/pckbd: Use qemu_log_mask(GUEST_ERROR) " Philippe Mathieu-Daudé
2018-06-22  8:04   ` Thomas Huth
2018-06-22 13:19     ` Philippe Mathieu-Daudé
2018-06-21 18:02 ` [Qemu-devel] [PATCH 03/11] hw/dma/omap_dma: Use qemu_log_mask(UNIMP) instead of printf Philippe Mathieu-Daudé
2018-06-22  8:11   ` Thomas Huth
2018-06-21 18:02 ` [Qemu-devel] [PATCH 04/11] hw/dma/omap_dma: Use qemu_log_mask(GUEST_ERROR) instead of fprintf Philippe Mathieu-Daudé
2018-06-22  8:24   ` Thomas Huth
2018-06-22 13:23     ` Philippe Mathieu-Daudé
2018-06-21 18:02 ` [Qemu-devel] [PATCH 05/11] hw/ssi/omap_spi: " Philippe Mathieu-Daudé
2018-06-21 18:04   ` Alistair Francis
2018-06-21 18:02 ` [Qemu-devel] [PATCH 06/11] hw/sd/omap_mmc: Use qemu_log_mask(UNIMP) instead of printf Philippe Mathieu-Daudé
2018-06-22  8:26   ` Thomas Huth
2018-06-21 18:02 ` [Qemu-devel] [PATCH 07/11] hw/i2c/omap_i2c: Use qemu_log_mask(UNIMP) instead of fprintf Philippe Mathieu-Daudé
2018-06-22  8:29   ` Thomas Huth [this message]
2018-06-21 18:02 ` [Qemu-devel] [PATCH 08/11] hw/arm/omap: Use qemu_log_mask(GUEST_ERROR) " Philippe Mathieu-Daudé
2018-06-22  8:34   ` Thomas Huth
2018-06-22 13:23     ` Philippe Mathieu-Daudé
2018-06-21 18:02 ` [Qemu-devel] [PATCH 09/11] hw/arm/stellaris: Use qemu_log_mask(UNIMP) " Philippe Mathieu-Daudé
2018-06-22  8:36   ` Thomas Huth
2018-06-21 18:02 ` [Qemu-devel] [PATCH 10/11] hw/net/stellaris_enet: Use qemu_log_mask(GUEST_ERROR) instead of hw_error Philippe Mathieu-Daudé
2018-06-22  8:43   ` Thomas Huth
2018-06-22 13:24     ` Philippe Mathieu-Daudé
2018-06-21 18:02 ` [Qemu-devel] [PATCH 11/11] hw/net/smc91c111: " Philippe Mathieu-Daudé
2018-06-22  8:43   ` Thomas Huth

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=d57b6ebf-f28e-083f-9cf5-6a4c702b9d96@redhat.com \
    --to=thuth@redhat.com \
    --cc=f4bug@amsat.org \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).