From patchwork Tue May 30 08:59:31 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hirokazu Honda X-Patchwork-Id: 9754109 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 EE198602F0 for ; Tue, 30 May 2017 08:59:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E221D27E63 for ; Tue, 30 May 2017 08:59:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D6C4D27F89; Tue, 30 May 2017 08:59:58 +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.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5D41727E63 for ; Tue, 30 May 2017 08:59:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751355AbdE3I7v (ORCPT ); Tue, 30 May 2017 04:59:51 -0400 Received: from mail-pf0-f177.google.com ([209.85.192.177]:35546 "EHLO mail-pf0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751331AbdE3I7s (ORCPT ); Tue, 30 May 2017 04:59:48 -0400 Received: by mail-pf0-f177.google.com with SMTP id n23so66568525pfb.2 for ; Tue, 30 May 2017 01:59:48 -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=HdAhzdiOIStrOc268AS7OjUNXCpxIjZjrjyvRKJUm4l+aP1eFW5E6+EXvz7WXIL2cY LFXEBkRqomhX9plQHgUvS+mE34vHGQ/1SzUzKEjTqnA8wTrYenn42X/BNWZ0QP8C+PEq ldrKtm/SWXeYetWZ9vScQNAOgBVPn8r9GdcuE= 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=nhKoEVdT6QBhossKd3gJEGovF4/hINbMsrODxpoC6/KN8w93LVyA5Qui1XGQUR+jn6 HyDNUhCpY85irx9ix32vtLZsF+j/lMv8Eecb5k8oKzPf1mBwi7FQa2lthAg0Q1cLJkN/ //6KsCGlmH2UcUsoJgcTL/vHtPqiIgCKbz1+WQwYDj6IJ/e6APpGS8hFi/ntKhA2zQEY 49UN2z6tsxsNq0e1kh04PbmXLQzBENpxITcu1DpQvg1bIHephHHUtOtv/x7mApwqZJun KhhuhPOqJ5gY7b7Cc5ExVKvWdHdL0QHPBosyaqFloSLH3HY/OYJGzTG64i6b/c23eHTp FgsA== X-Gm-Message-State: AODbwcC+hnyUZXeHNK70EUCTty9evbb8MeHeMrHSaUg94U3bo/uwf4j/ /W6moAufdlELZZeu X-Received: by 10.84.248.73 with SMTP id e9mr82057005pln.76.1496134782883; Tue, 30 May 2017 01:59:42 -0700 (PDT) Received: from hiroh.tok.corp.google.com ([100.103.2.121]) by smtp.gmail.com with ESMTPSA id c196sm21402240pga.23.2017.05.30.01.59.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 30 May 2017 01:59:41 -0700 (PDT) From: Hirokazu Honda To: Tiffany Lin , Andrew-CT Chen , Mauro Carvalho Chehab , Matthias Brugger Cc: linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, Hirokazu Honda Subject: [PATCH] mtk-vcodec: Show mtk driver error without DEBUG definition Date: Tue, 30 May 2017 17:59:31 +0900 Message-Id: <20170530085931.187344-1-hiroh@chromium.org> X-Mailer: git-send-email 2.13.0.219.gdb65acc882-goog Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.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 --- 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) {}