public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH v3] [media] mtk-vcodec: Show mtk driver error without DEBUG definition
@ 2017-07-05  5:33 Hirokazu Honda
  2017-07-05  5:35 ` Hirokazu Honda
  0 siblings, 1 reply; 2+ messages in thread
From: Hirokazu Honda @ 2017-07-05  5:33 UTC (permalink / raw)
  To: linux-arm-kernel

A driver error message is shown without DEBUG definition
to find an error and debug easily.

Signed-off-by: Hirokazu Honda <hiroh@chromium.org>
---
 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..c1378c1b402c 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) {}
 
-- 
2.13.2.725.g09c95d1e9-goog

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH v3] [media] mtk-vcodec: Show mtk driver error without DEBUG definition
  2017-07-05  5:33 [PATCH v3] [media] mtk-vcodec: Show mtk driver error without DEBUG definition Hirokazu Honda
@ 2017-07-05  5:35 ` Hirokazu Honda
  0 siblings, 0 replies; 2+ messages in thread
From: Hirokazu Honda @ 2017-07-05  5:35 UTC (permalink / raw)
  To: linux-arm-kernel

Fixing whitespace in the previous patch.

On Wed, Jul 5, 2017 at 2:33 PM, Hirokazu Honda <hiroh@chromium.org> wrote:
> A driver error message is shown without DEBUG definition
> to find an error and debug easily.
>
> Signed-off-by: Hirokazu Honda <hiroh@chromium.org>
> ---
>  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..c1378c1b402c 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) {}
>
> --
> 2.13.2.725.g09c95d1e9-goog
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-07-05  5:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-05  5:33 [PATCH v3] [media] mtk-vcodec: Show mtk driver error without DEBUG definition Hirokazu Honda
2017-07-05  5:35 ` Hirokazu Honda

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox