From patchwork Tue Sep 9 07:01:57 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Hahn X-Patchwork-Id: 387176 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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 ozlabs.org (Postfix) with ESMTPS id 2FD5214012A for ; Tue, 9 Sep 2014 17:02:37 +1000 (EST) Received: from localhost ([::1]:47651 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XRFRj-0007yO-L6 for incoming@patchwork.ozlabs.org; Tue, 09 Sep 2014 03:02:35 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39703) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XRFRO-0007gl-66 for qemu-devel@nongnu.org; Tue, 09 Sep 2014 03:02:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XRFRJ-0008Vq-3w for qemu-devel@nongnu.org; Tue, 09 Sep 2014 03:02:14 -0400 Received: from mail.univention.de ([82.198.197.8]:1961) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XRFRI-0008VV-UC for qemu-devel@nongnu.org; Tue, 09 Sep 2014 03:02:09 -0400 Received: from localhost (localhost [127.0.0.1]) by solig.knut.univention.de (Postfix) with ESMTP id 01F1510B712C for ; Tue, 9 Sep 2014 09:02:06 +0200 (CEST) X-Virus-Scanned: by amavisd-new-2.6.4 (20090625) (Debian) at knut.univention.de Received: from mail.univention.de ([127.0.0.1]) by localhost (solig.knut.univention.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id pnR0hEM38JKm; Tue, 9 Sep 2014 09:02:06 +0200 (CEST) Received: from stave.knut.univention.de (stave.knut.univention.de [192.168.0.191]) by solig.knut.univention.de (Postfix) with ESMTPSA id B8C1D10B712B; Tue, 9 Sep 2014 09:02:06 +0200 (CEST) Received: by stave.knut.univention.de (Postfix, from userid 2260) id 6A27640F2F; Tue, 9 Sep 2014 09:02:06 +0200 (CEST) From: Philipp Hahn To: qemu-devel@nongnu.org Date: Tue, 9 Sep 2014 09:01:57 +0200 Message-Id: <99e4360794b046985ff18c584ee6c11858457392.1410246092.git.hahn@univention.de> X-Mailer: git-send-email 1.9.1 Organization: Univention GmbH, Bremen, Germany X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 82.198.197.8 Cc: Philipp Hahn Subject: [Qemu-devel] [PATCH] hw/dma: Print error message only once X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org otherwise the message dma: unregistered DMA channel used nchan=0 dma_pos=0 dma_len=1 gets printed every time and fills up the log-file with 50 MiB / minute. Signed-off-by: Philipp Hahn --- hw/dma/i8257.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/hw/dma/i8257.c b/hw/dma/i8257.c index dd370ed..9673ab6 100644 --- a/hw/dma/i8257.c +++ b/hw/dma/i8257.c @@ -473,8 +473,14 @@ static void dma_reset(void *opaque) static int dma_phony_handler (void *opaque, int nchan, int dma_pos, int dma_len) { - dolog ("unregistered DMA channel used nchan=%d dma_pos=%d dma_len=%d\n", - nchan, dma_pos, dma_len); + static int once; + int mask = 1 << nchan; + + if (0 == (once & mask)) { + once |= mask; + dolog("unregistered DMA channel used nchan=%d dma_pos=%d dma_len=%d\n", + nchan, dma_pos, dma_len); + } return dma_pos; }