From nobody Tue Feb 10 13:01:34 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1529604309249377.4621810349139; Thu, 21 Jun 2018 11:05:09 -0700 (PDT) Received: from localhost ([::1]:57003 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fW3xE-0001mH-I2 for importer@patchew.org; Thu, 21 Jun 2018 14:05:08 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59196) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fW3uz-0000VG-8v for qemu-devel@nongnu.org; Thu, 21 Jun 2018 14:02:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fW3uy-0006V1-6k for qemu-devel@nongnu.org; Thu, 21 Jun 2018 14:02:49 -0400 Received: from mail-qt0-x242.google.com ([2607:f8b0:400d:c0d::242]:44658) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fW3uy-0006Uv-0c; Thu, 21 Jun 2018 14:02:48 -0400 Received: by mail-qt0-x242.google.com with SMTP id x5-v6so2950141qte.11; Thu, 21 Jun 2018 11:02:47 -0700 (PDT) Received: from x1.local ([138.117.48.222]) by smtp.gmail.com with ESMTPSA id w51-v6sm2469469qta.12.2018.06.21.11.02.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Jun 2018 11:02:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=8Yx2i1Od8rnw3oJmsQll+N/JHRoObWEqXtlopD+7TZo=; b=M8k4HBKHMfOFSgau+ruxJZlIjBgch2o4OLFe0WDuuqZj2SBsKz3AVa7eztAoB81Wbi 7likgHeO0zDjUO+ZOmHYMT0LijbkxuWQq4qQqI3H+OOLHkrFVT0z7VZGUXw4gxVTldnL iJB6n+XjYfUTe/9iKWRtfoP5lprwtC+I240BnPGhyJ0hc6L4TJYS6Z/kCwegdL7HE1P+ JE07sgmprrQjFFwaqeoDTUsBsqJ+y8X5hj8V/di/JQShK1w2JQMySYMKTJFKDMlsVm5n DoRRjjVUqGtW5hkPChztd5nyHheyhDo8gdQFMb+pjXjTq5Hd4Ira1J9VLp3FBOab4KpX 6KQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=8Yx2i1Od8rnw3oJmsQll+N/JHRoObWEqXtlopD+7TZo=; b=GJK3/oFPP5Svelya0EXk6j0PjV8Jvgl/UNOmSjXbEIBEy/dJBwaGmm5w9QwFsYqrfO qBogxVJ+ed8r5fl6ehB1rIRMPi8NgtnteeLGlZ1mi+NwZhXB6rHHsQbTzTt7nJ1gzLeD GFzR90KXvlYtrs0wTPs9kKnWUpGz+I8hIuhLYVL9Kgq3LvgouBP8FNxK7hHjUsfIrTx6 Dw8Am/exSCQ5Fmw94RSJNgzk3jAsIaBDzno/mFzBJA29cblGHbazf9BN3KPfOycjmsrB 4uvpY5HQ1W09rIXVL2SjXrIIoDlH53g1WeV+oZDIJLrAR1Rl5wsCexzstnP2HbVvBUHr suuQ== X-Gm-Message-State: APt69E2nUC8esCT1MFUA2DFcpyRxn/SqOoBKIUNPMNYBULDyvKlhtvRm rNGXvsE8Y77oitaT+y0npOndguBv X-Google-Smtp-Source: ADUXVKKu+zKtD+HEAMYo4tCpfi1/F0HyMD84aCBzBmNNPg24Y08KDigS45OmAcHH+HkJ6J6WyDcu7g== X-Received: by 2002:a0c:9123:: with SMTP id q32-v6mr23499814qvq.136.1529604167468; Thu, 21 Jun 2018 11:02:47 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Peter Maydell Date: Thu, 21 Jun 2018 15:02:17 -0300 Message-Id: <20180621180224.8312-5-f4bug@amsat.org> X-Mailer: git-send-email 2.18.0.rc2 In-Reply-To: <20180621180224.8312-1-f4bug@amsat.org> References: <20180621180224.8312-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::242 Subject: [Qemu-devel] [PATCH 04/11] hw/dma/omap_dma: Use qemu_log_mask(GUEST_ERROR) instead of fprintf X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, qemu-arm@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/dma/omap_dma.c | 66 ++++++++++++++++++++++++++++++----------------- 1 file changed, 42 insertions(+), 24 deletions(-) diff --git a/hw/dma/omap_dma.c b/hw/dma/omap_dma.c index ab3a1b0451..a4a786f546 100644 --- a/hw/dma/omap_dma.c +++ b/hw/dma/omap_dma.c @@ -879,15 +879,18 @@ static int omap_dma_ch_reg_write(struct omap_dma_s *s, ch->burst[0] =3D (value & 0x0180) >> 7; ch->pack[0] =3D (value & 0x0040) >> 6; ch->port[0] =3D (enum omap_dma_port) ((value & 0x003c) >> 2); - if (ch->port[0] >=3D __omap_dma_port_last) - printf("%s: invalid DMA port %i\n", __func__, - ch->port[0]); - if (ch->port[1] >=3D __omap_dma_port_last) - printf("%s: invalid DMA port %i\n", __func__, - ch->port[1]); + if (ch->port[0] >=3D __omap_dma_port_last) { + qemu_log_mask(LOG_GUEST_ERROR, "%s: invalid DMA port %i\n", + __func__, ch->port[0]); + } + if (ch->port[1] >=3D __omap_dma_port_last) { + qemu_log_mask(LOG_GUEST_ERROR, "%s: invalid DMA port %i\n", + __func__, ch->port[1]); + } ch->data_type =3D 1 << (value & 3); if ((value & 3) =3D=3D 3) { - printf("%s: bad data_type for DMA channel\n", __func__); + qemu_log_mask(LOG_GUEST_ERROR, + "%s: bad data_type for DMA channel\n", __func__); ch->data_type >>=3D 1; } break; @@ -1899,14 +1902,20 @@ static void omap_dma4_write(void *opaque, hwaddr ad= dr, if (value & 2) /* SOFTRESET */ omap_dma_reset(s->dma); s->ocp =3D value & 0x3321; - if (((s->ocp >> 12) & 3) =3D=3D 3) /* MIDLEMODE */ - fprintf(stderr, "%s: invalid DMA power mode\n", __func__); + if (((s->ocp >> 12) & 3) =3D=3D 3) { + /* MIDLEMODE */ + qemu_log_mask(LOG_GUEST_ERROR, "%s: invalid DMA power mode\n", + __func__); + } return; =20 case 0x78: /* DMA4_GCR */ s->gcr =3D value & 0x00ff00ff; - if ((value & 0xff) =3D=3D 0x00) /* MAX_CHANNEL_FIFO_DEPTH */ - fprintf(stderr, "%s: wrong FIFO depth in GCR\n", __func__); + if ((value & 0xff) =3D=3D 0x00) { + /* MAX_CHANNEL_FIFO_DEPTH */ + qemu_log_mask(LOG_GUEST_ERROR, "%s: wrong FIFO depth in GCR\n", + __func__); + } return; =20 case 0x80 ... 0xfff: @@ -1935,9 +1944,11 @@ static void omap_dma4_write(void *opaque, hwaddr add= r, case 0x00: /* DMA4_CCR */ ch->buf_disable =3D (value >> 25) & 1; ch->src_sync =3D (value >> 24) & 1; /* XXX For CamDMA must be 1 */ - if (ch->buf_disable && !ch->src_sync) - fprintf(stderr, "%s: Buffering disable is not allowed in " - "destination synchronised mode\n", __func__); + if (ch->buf_disable && !ch->src_sync) { + qemu_log_mask(LOG_GUEST_ERROR, + "%s: Buffering disable is not allowed in " + "destination synchronised mode\n", __func__); + } ch->prefetch =3D (value >> 23) & 1; ch->bs =3D (value >> 18) & 1; ch->transparent_copy =3D (value >> 17) & 1; @@ -1947,9 +1958,11 @@ static void omap_dma4_write(void *opaque, hwaddr add= r, ch->suspend =3D (value & 0x0100) >> 8; ch->priority =3D (value & 0x0040) >> 6; ch->fs =3D (value & 0x0020) >> 5; - if (ch->fs && ch->bs && ch->mode[0] && ch->mode[1]) - fprintf(stderr, "%s: For a packet transfer at least one port " - "must be constant-addressed\n", __func__); + if (ch->fs && ch->bs && ch->mode[0] && ch->mode[1]) { + qemu_log_mask(LOG_GUEST_ERROR, + "%s: For a packet transfer at least one port " + "must be constant-addressed\n", __func__); + } ch->sync =3D (value & 0x001f) | ((value >> 14) & 0x0060); /* XXX must be 0x01 for CamDMA */ =20 @@ -1978,9 +1991,11 @@ static void omap_dma4_write(void *opaque, hwaddr add= r, ch->endian_lock[0] =3D(value >> 20) & 1; ch->endian[1] =3D(value >> 19) & 1; ch->endian_lock[1] =3D(value >> 18) & 1; - if (ch->endian[0] !=3D ch->endian[1]) - fprintf(stderr, "%s: DMA endianness conversion enable attempt\= n", - __func__); + if (ch->endian[0] !=3D ch->endian[1]) { + qemu_log_mask(LOG_GUEST_ERROR, + "%s: DMA endianness conversion enable attempt\n", + __func__); + } ch->write_mode =3D (value >> 16) & 3; ch->burst[1] =3D (value & 0xc000) >> 14; ch->pack[1] =3D (value & 0x2000) >> 13; @@ -1988,12 +2003,15 @@ static void omap_dma4_write(void *opaque, hwaddr ad= dr, ch->burst[0] =3D (value & 0x0180) >> 7; ch->pack[0] =3D (value & 0x0040) >> 6; ch->translate[0] =3D (value & 0x003c) >> 2; - if (ch->translate[0] | ch->translate[1]) - fprintf(stderr, "%s: bad MReqAddressTranslate sideband signal\= n", - __func__); + if (ch->translate[0] | ch->translate[1]) { + qemu_log_mask(LOG_GUEST_ERROR, + "%s: bad MReqAddressTranslate sideband signal\n", + __func__); + } ch->data_type =3D 1 << (value & 3); if ((value & 3) =3D=3D 3) { - printf("%s: bad data_type for DMA channel\n", __func__); + qemu_log_mask(LOG_GUEST_ERROR, + "%s: bad data_type for DMA channel\n", __func__); ch->data_type >>=3D 1; } break; --=20 2.18.0.rc2