From patchwork Thu Feb 1 17:27:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Programmingkid X-Patchwork-Id: 10195729 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 50EF760380 for ; Thu, 1 Feb 2018 17:29:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 489B128B88 for ; Thu, 1 Feb 2018 17:29:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3D6A828B8A; Thu, 1 Feb 2018 17:29:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E7D4228B88 for ; Thu, 1 Feb 2018 17:29:05 +0000 (UTC) Received: from localhost ([::1]:49681 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ehIfY-0002yh-D3 for patchwork-qemu-devel@patchwork.kernel.org; Thu, 01 Feb 2018 12:29:04 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38146) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ehIeW-00023M-Bm for qemu-devel@nongnu.org; Thu, 01 Feb 2018 12:28:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ehIeR-0004gg-DU for qemu-devel@nongnu.org; Thu, 01 Feb 2018 12:28:00 -0500 Received: from mail-io0-x242.google.com ([2607:f8b0:4001:c06::242]:44675) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ehIeR-0004g3-6h for qemu-devel@nongnu.org; Thu, 01 Feb 2018 12:27:55 -0500 Received: by mail-io0-x242.google.com with SMTP id z6so20003630iob.11 for ; Thu, 01 Feb 2018 09:27:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=hZV4/wCe2uCjO9l3b+ExDF7Xv4JrUEDhMmAsH7WQ5fc=; b=fCYmEnyLeGzJ/O+zCNKfyj0YCQyBz9BFYA1r5O4Bl2Soe4IDhHIG+J81SXN8oj/AeX ypLh25VY13UlawRNEhAL1uRLDwRei6hgHPklBCN3GFmXOlcRVrWiaB8mSBfAT9PRIhd/ DOGKmnz3CT3Q6xFZ/4eRJNKSrCxUX00YmxWAxq1NN0HoenxAmsMTpfLjG8qsxdIBhHYV qyT2OHKGMjgnNKIFDMjsNJcESgTyDFRDrCihqjiEqE8PvtmionsPpnH6fJx4CxS3A0/K bNSXRBMkJ9eWMixrK+eA+Ma9p3OAX7LqJ1/H1l7t766CHksVkEchpGyUCzWcjfRFtzAF ALSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=hZV4/wCe2uCjO9l3b+ExDF7Xv4JrUEDhMmAsH7WQ5fc=; b=Sc2v7yg62G01yhWRk9eJWEXhv5NrJ2/mFjrpzhDtRxMsqpf3xRN95RT4wctGCZAygB iftt3frfgdlNPbQg4ya2wnrb0WtTLibepoTqdkm6hkOQ+9HgvliUwT6O2hr0gj3HMHKV jZxZhrXe25RqUctCa58pcoM0/CK4Pzu9VRwuZcdP454EjROkZG9b1Bgcdk51OeqGVEb/ McJlQx3wE+sshfMA8BsA78tU8DrQjojJDtUlsI+pn+VqrHW9/DFjtY+cRQwSkV+zbEIJ 2++PPpR56GvBygW5Fhaix33Ue5xC8h/u9frrR4C0WQjMLWjxhdHyfGwYms8SnkWa/vWN FVww== X-Gm-Message-State: AKwxytecbuuPqtlQxm4xEioR1rTvSKtqFoOcXXkNevJxTOvBh7nN9OgN dBmzNb0eGEikkr6haPLVqfGX3w== X-Google-Smtp-Source: AH8x2245n2ljbQuY1QePnHnnrGLPClaoDvqaxBnQnK6K44itNz7V1pd0jxSrbjSlmb6vX7vqUHsjZQ== X-Received: by 10.107.136.86 with SMTP id k83mr37413166iod.128.1517506074260; Thu, 01 Feb 2018 09:27:54 -0800 (PST) Received: from localhost.localdomain (d14-69-20-184.try.wideopenwest.com. [69.14.184.20]) by smtp.gmail.com with ESMTPSA id v65sm210671itb.30.2018.02.01.09.27.53 (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 01 Feb 2018 09:27:53 -0800 (PST) From: John Arbuckle To: qemu-devel@nongnu.org, kraxel@redhat.com Date: Thu, 1 Feb 2018 12:27:44 -0500 Message-Id: <20180201172744.7504-1-programmingkidx@gmail.com> X-Mailer: git-send-email 2.14.3 (Apple Git-98) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4001:c06::242 Subject: [Qemu-devel] [PATCH v2] hw/audio/sb16.c: change dolog() to qemu_log_mask() 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: John Arbuckle Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Changes all the occurrances of dolog() to qemu_log_mask(). Signed-off-by: John Arbuckle --- v2 changes: Removed several replaces of dolog() to qemu_log_mask(). Added one error_setg() call. hw/audio/sb16.c | 79 +++++++++++++++++++++++++++++++-------------------------- 1 file changed, 43 insertions(+), 36 deletions(-) diff --git a/hw/audio/sb16.c b/hw/audio/sb16.c index 6ab2f6f89a..31de264ab7 100644 --- a/hw/audio/sb16.c +++ b/hw/audio/sb16.c @@ -29,6 +29,8 @@ #include "hw/qdev.h" #include "qemu/timer.h" #include "qemu/host-utils.h" +#include "qemu/log.h" +#include "qapi/error.h" #define dolog(...) AUD_log ("sb16", __VA_ARGS__) @@ -123,7 +125,7 @@ static int magic_of_irq (int irq) case 10: return 8; default: - dolog ("bad irq %d\n", irq); + qemu_log_mask(LOG_GUEST_ERROR, "bad irq %d\n", irq); return 2; } } @@ -140,7 +142,7 @@ static int irq_of_magic (int magic) case 8: return 10; default: - dolog ("bad irq magic %d\n", magic); + qemu_log_mask(LOG_GUEST_ERROR, "bad irq magic %d\n", magic); return -1; } } @@ -258,8 +260,8 @@ static void dma_cmd8 (SB16State *s, int mask, int dma_len) s->align = (1 << s->fmt_stereo) - 1; if (s->block_size & s->align) { - dolog ("warning: misaligned block size %d, alignment %d\n", - s->block_size, s->align + 1); + qemu_log_mask(LOG_GUEST_ERROR, "warning: misaligned block size %d," + " alignment %d\n", s->block_size, s->align + 1); } ldebug ("freq %d, stereo %d, sign %d, bits %d, " @@ -338,8 +340,8 @@ static void dma_cmd (SB16State *s, uint8_t cmd, uint8_t d0, int dma_len) s->highspeed = 0; s->align = (1 << (s->fmt_stereo + (s->fmt_bits == 16))) - 1; if (s->block_size & s->align) { - dolog ("warning: misaligned block size %d, alignment %d\n", - s->block_size, s->align + 1); + qemu_log_mask(LOG_GUEST_ERROR, "warning: misaligned block size %d," + " alignment %d\n", s->block_size, s->align + 1); } if (s->freq) { @@ -391,7 +393,8 @@ static void command (SB16State *s, uint8_t cmd) if (cmd > 0xaf && cmd < 0xd0) { if (cmd & 8) { - dolog ("ADC not yet supported (command %#x)\n", cmd); + qemu_log_mask(LOG_UNIMP, "ADC not yet supported (command %#x)\n", + cmd); } switch (cmd >> 4) { @@ -399,7 +402,7 @@ static void command (SB16State *s, uint8_t cmd) case 12: break; default: - dolog ("%#x wrong bits\n", cmd); + qemu_log_mask(LOG_GUEST_ERROR, "%#x wrong bits\n", cmd); } s->needed_bytes = 3; } @@ -453,7 +456,7 @@ static void command (SB16State *s, uint8_t cmd) goto warn; case 0x35: - dolog ("0x35 - MIDI command not implemented\n"); + qemu_log_mask(LOG_UNIMP, "0x35 - MIDI command not implemented\n"); break; case 0x40: @@ -487,34 +490,38 @@ static void command (SB16State *s, uint8_t cmd) case 0x74: s->needed_bytes = 2; /* DMA DAC, 4-bit ADPCM */ - dolog ("0x75 - DMA DAC, 4-bit ADPCM not implemented\n"); + qemu_log_mask(LOG_UNIMP, "0x75 - DMA DAC, 4-bit ADPCM not" + " implemented\n"); break; case 0x75: /* DMA DAC, 4-bit ADPCM Reference */ s->needed_bytes = 2; - dolog ("0x74 - DMA DAC, 4-bit ADPCM Reference not implemented\n"); + qemu_log_mask(LOG_UNIMP, "0x74 - DMA DAC, 4-bit ADPCM Reference not" + " implemented\n"); break; case 0x76: /* DMA DAC, 2.6-bit ADPCM */ s->needed_bytes = 2; - dolog ("0x74 - DMA DAC, 2.6-bit ADPCM not implemented\n"); + qemu_log_mask(LOG_UNIMP, "0x74 - DMA DAC, 2.6-bit ADPCM not" + " implemented\n"); break; case 0x77: /* DMA DAC, 2.6-bit ADPCM Reference */ s->needed_bytes = 2; - dolog ("0x74 - DMA DAC, 2.6-bit ADPCM Reference not implemented\n"); + qemu_log_mask(LOG_UNIMP, "0x74 - DMA DAC, 2.6-bit ADPCM Reference" + " not implemented\n"); break; case 0x7d: - dolog ("0x7d - Autio-Initialize DMA DAC, 4-bit ADPCM Reference\n"); - dolog ("not implemented\n"); + qemu_log_mask(LOG_UNIMP, "0x7d - Autio-Initialize DMA DAC, 4-bit" + " ADPCM Reference\n"); + qemu_log_mask(LOG_UNIMP, "not implemented\n"); break; case 0x7f: - dolog ( - "0x7d - Autio-Initialize DMA DAC, 2.6-bit ADPCM Reference\n" - ); - dolog ("not implemented\n"); + qemu_log_mask(LOG_UNIMP, "0x7d - Autio-Initialize DMA DAC, 2.6-bit" + " ADPCM Reference\n"); + qemu_log_mask(LOG_UNIMP, "not implemented\n"); break; case 0x80: @@ -586,7 +593,7 @@ static void command (SB16State *s, uint8_t cmd) break; case 0xe7: - dolog ("Attempt to probe for ESS (0xe7)?\n"); + qemu_log_mask(LOG_UNIMP, "Attempt to probe for ESS (0xe7)?\n"); break; case 0xe8: /* read test reg */ @@ -613,7 +620,7 @@ static void command (SB16State *s, uint8_t cmd) goto warn; default: - dolog ("Unrecognized command %#x\n", cmd); + qemu_log_mask(LOG_UNIMP, "Unrecognized command %#x\n", cmd); break; } } @@ -632,8 +639,8 @@ static void command (SB16State *s, uint8_t cmd) return; warn: - dolog ("warning: command %#x,%d is not truly understood yet\n", - cmd, s->needed_bytes); + qemu_log_mask(LOG_UNIMP, "warning: command %#x,%d is not truly understood" + " yet\n", cmd, s->needed_bytes); goto exit; } @@ -735,9 +742,8 @@ static void complete (SB16State *s) break; case 0x42: /* FT2 sets output freq with this, go figure */ -#if 0 - dolog ("cmd 0x42 might not do what it think it should\n"); -#endif + qemu_log_mask(LOG_UNIMP, "cmd 0x42 might not do what it think it" + " should\n"); case 0x41: s->freq = dsp_get_hilo (s); ldebug ("set freq %d\n", s->freq); @@ -820,7 +826,8 @@ static void complete (SB16State *s) break; default: - dolog ("complete: unrecognized command %#x\n", s->cmd); + qemu_log_mask(LOG_UNIMP, "complete: unrecognized command %#x\n", + s->cmd); return; } } @@ -1095,10 +1102,9 @@ static void mixer_write_datab(void *opaque, uint32_t nport, uint32_t val) dma = ctz32 (val & 0xf); hdma = ctz32 (val & 0xf0); if (dma != s->dma || hdma != s->hdma) { - dolog ( - "attempt to change DMA " - "8bit %d(%d), 16bit %d(%d) (val=%#x)\n", - dma, s->dma, hdma, s->hdma, val); + qemu_log_mask(LOG_GUEST_ERROR, "attempt to change DMA 8bit" + " %d(%d), 16bit %d(%d) (val=%#x)\n", dma, s->dma, + hdma, s->hdma, val); } #if 0 s->dma = dma; @@ -1108,8 +1114,8 @@ static void mixer_write_datab(void *opaque, uint32_t nport, uint32_t val) break; case 0x82: - dolog ("attempt to write into IRQ status register (val=%#x)\n", - val); + qemu_log_mask(LOG_GUEST_ERROR, "attempt to write into IRQ status" + " register (val=%#x)\n", val); return; default: @@ -1181,8 +1187,9 @@ static int SB_read_DMA (void *opaque, int nchan, int dma_pos, int dma_len) int till, copy, written, free; if (s->block_size <= 0) { - dolog ("invalid block size=%d nchan=%d dma_pos=%d dma_len=%d\n", - s->block_size, nchan, dma_pos, dma_len); + qemu_log_mask(LOG_GUEST_ERROR, "invalid block size=%d nchan=%d" + " dma_pos=%d dma_len=%d\n", s->block_size, nchan, + dma_pos, dma_len); return dma_pos; } @@ -1376,7 +1383,7 @@ static void sb16_realizefn (DeviceState *dev, Error **errp) reset_mixer (s); s->aux_ts = timer_new_ns(QEMU_CLOCK_VIRTUAL, aux_timer, s); if (!s->aux_ts) { - dolog ("warning: Could not create auxiliary timer\n"); + error_setg(errp, "warning: Could not create auxiliary timer"); } isa_register_portio_list(isadev, &s->portio_list, s->port,