Re: [PATCH v2 2/6] staging: video: rockchip: add v4l2 decoder

From: Joe Perches
Date: Thu Mar 07 2019 - 21:33:49 EST


On Thu, 2019-03-07 at 18:03 +0800, Randy Li wrote:
> It is based on the vendor driver sent to mail list before.

trivial notes:

> diff --git a/drivers/staging/rockchip-mpp/mpp_debug.h b/drivers/staging/rockchip-mpp/mpp_debug.h
[]
> +#define mpp_debug_func(type, fmt, args...) \
> + do { \
> + if (unlikely(debug & type)) { \
> + pr_info("%s:%d: " fmt, \
> + __func__, __LINE__, ##args); \
> + } \
> + } while (0)
> +#define mpp_debug(type, fmt, args...) \
> + do { \
> + if (unlikely(debug & type)) { \
> + pr_info(fmt, ##args); \
> + } \
> + } while (0)
> +

It's generally better to emit debug messages at KERN_DEBUG

> +#define mpp_debug_enter() \
> + do { \
> + if (unlikely(debug & DEBUG_FUNCTION)) { \
> + pr_info("%s:%d: enter\n", \
> + __func__, __LINE__); \
> + } \
> + } while (0)
> +
> +#define mpp_debug_leave() \
> + do { \
> + if (unlikely(debug & DEBUG_FUNCTION)) { \
> + pr_info("%s:%d: leave\n", \
> + __func__, __LINE__); \
> + } \
> + } while (0)

I suggest removal of these macros and uses.

There's not much value in enter/leave markings as
the generic ftrace facility does this already.

> +
> +#define mpp_err(fmt, args...) \
> + pr_err("%s:%d: " fmt, __func__, __LINE__, ##args)

__func__, __LINE__ markings generally have little value.