From patchwork Tue May 30 09:53:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hirokazu Honda X-Patchwork-Id: 9754233 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 687DC602BF for ; Tue, 30 May 2017 09:54:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5AB4C2013D for ; Tue, 30 May 2017 09:54:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4E67027D4D; Tue, 30 May 2017 09:54:32 +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=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D66B92013D for ; Tue, 30 May 2017 09:54:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=IKW90bSpBoUtLlKi/pW/+xxqynlVc6VTPGQF98s+vdw=; b=sma LmomobZGtwnGnsiu1aX45vgIka0l25+U1zHhG6QsQpmioGwM2PexUzdXSoJ3I+ZZ3ILu2dZGMmeJx k83WHbt4nWPdJmpr6SWn836G2UiPzEFPx8Eg2c54l4FyxX5h4JypHcNosRtQkHi/NgNX4uyI4GIYm 6H7VLDLzUmNTvBcEUU55naCl5fo0gZ+eeoWinN/L35snqHPnMKdBVqEjeQZpobQ+Zl2iqk3W6ubRH aAk74lAOSaHKV7C6g9lQ+AYl5muCBNf3IOiOIWu98qskKC3GyyyK4karZ9sc0iEcZH5WkWeyXhK5E j3TKmD7Fce8zzUmGXaruSallF1YTV7w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dFdrC-0000JI-O4; Tue, 30 May 2017 09:54:30 +0000 Received: from mail-pf0-x22a.google.com ([2607:f8b0:400e:c00::22a]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dFdr9-0000GN-QO for linux-mediatek@lists.infradead.org; Tue, 30 May 2017 09:54:29 +0000 Received: by mail-pf0-x22a.google.com with SMTP id n23so67849165pfb.2 for ; Tue, 30 May 2017 02:54:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id; bh=kN9X7OkdJtjY4cUxSG3RPdOE98OJmb/I7FvDwd21p0Y=; b=VkmXZ2gnc3F3cfD6CfFqSMdxhSXtl6W/mmZMvReTQFovqrzmSaoywqf+1xUXnbtLhL +TfyXQVCZD+nePlmTDsnzIRcxhZRmdcNbmh2yFoeO5dpwiVvf6GzTYgSBTCK7Mi+NUq8 QmAoANThuQL9nFExWj5Rb+ky4EPfNY9cC8XJM= 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=kN9X7OkdJtjY4cUxSG3RPdOE98OJmb/I7FvDwd21p0Y=; b=iPc/21oFAHyu4JL2/3VOLdyZwGRXCrw78vqKsC1/SFJTvyN0WDDgcn/oIXUJfGlHj7 hfHCpQJ2li4PHQ+xHOg1d180Xc8QOQxQcL6TaiOZWoy9g+awCrbdfdOmTyA3c6EHHz3Q ZjHj4rNhtB2cVb6qJC2Z6QXFVsBwjolY07irZcJZd3eR19KxONCP9fc/1ng/twkJzodL S77eoEz5slf5/69u6Gai6mXhyMyE/dR09WURwKi7jDv2B+6QomlC9tKAqkxgFkgDy5bj XGTU2dAk4ZMulo0TKoD7TQacqzBv1M7hmQhs/nJBDDZ/PKlwWgC+pwCdYRKdhlr1aUQt d1yA== X-Gm-Message-State: AODbwcDZrhrZzwR4rewprr5aqhgMT1ya/UtagCq8PbDgTVJMLdjGnXiR E3WLKXN0OkF+LlZs X-Received: by 10.84.254.2 with SMTP id b2mr81791740plm.185.1496138045091; Tue, 30 May 2017 02:54:05 -0700 (PDT) Received: from hiroh.tok.corp.google.com ([100.103.2.121]) by smtp.gmail.com with ESMTPSA id c12sm22481282pfl.79.2017.05.30.02.54.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 30 May 2017 02:54:04 -0700 (PDT) From: Hirokazu Honda To: Tiffany Lin , Andrew-CT Chen , Mauro Carvalho Chehab , Matthias Brugger Subject: [PATCH v2] [media] mtk-vcodec: Show mtk driver error without DEBUG definition Date: Tue, 30 May 2017 18:53:58 +0900 Message-Id: <20170530095358.2685-1-hiroh@chromium.org> X-Mailer: git-send-email 2.13.0.219.gdb65acc882-goog X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170530_025427_931120_2885F8CC X-CRM114-Status: UNSURE ( 8.41 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Hirokazu Honda , linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org MIME-Version: 1.0 Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP A driver error message is shown without DEBUG definition to find an error and debug easily. Signed-off-by: Hirokazu Honda Acked-by: Tiffany Lin --- drivers/media/platform/mtk-vcodec/mtk_vcodec_util.h | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/drivers/media/platform/mtk-vcodec/mtk_vcodec_util.h b/drivers/media/platform/mtk-vcodec/mtk_vcodec_util.h index 237e144c194f..06c254f5c171 100644 --- a/drivers/media/platform/mtk-vcodec/mtk_vcodec_util.h +++ b/drivers/media/platform/mtk-vcodec/mtk_vcodec_util.h @@ -32,6 +32,15 @@ extern int mtk_v4l2_dbg_level; extern bool mtk_vcodec_dbg; +#define mtk_v4l2_err(fmt, args...) \ + pr_err("[MTK_V4L2][ERROR] %s:%d: " fmt "\n", __func__, __LINE__, \ + ##args) + +#define mtk_vcodec_err(h, fmt, args...) \ + pr_err("[MTK_VCODEC][ERROR][%d]: %s() " fmt "\n", \ + ((struct mtk_vcodec_ctx *)h->ctx)->id, __func__, ##args) + + #if defined(DEBUG) #define mtk_v4l2_debug(level, fmt, args...) \ @@ -41,11 +50,6 @@ extern bool mtk_vcodec_dbg; level, __func__, __LINE__, ##args); \ } while (0) -#define mtk_v4l2_err(fmt, args...) \ - pr_err("[MTK_V4L2][ERROR] %s:%d: " fmt "\n", __func__, __LINE__, \ - ##args) - - #define mtk_v4l2_debug_enter() mtk_v4l2_debug(3, "+") #define mtk_v4l2_debug_leave() mtk_v4l2_debug(3, "-") @@ -57,22 +61,16 @@ extern bool mtk_vcodec_dbg; __func__, ##args); \ } while (0) -#define mtk_vcodec_err(h, fmt, args...) \ - pr_err("[MTK_VCODEC][ERROR][%d]: %s() " fmt "\n", \ - ((struct mtk_vcodec_ctx *)h->ctx)->id, __func__, ##args) - #define mtk_vcodec_debug_enter(h) mtk_vcodec_debug(h, "+") #define mtk_vcodec_debug_leave(h) mtk_vcodec_debug(h, "-") #else #define mtk_v4l2_debug(level, fmt, args...) {} -#define mtk_v4l2_err(fmt, args...) {} #define mtk_v4l2_debug_enter() {} #define mtk_v4l2_debug_leave() {} #define mtk_vcodec_debug(h, fmt, args...) {} -#define mtk_vcodec_err(h, fmt, args...) {} #define mtk_vcodec_debug_enter(h) {} #define mtk_vcodec_debug_leave(h) {}