[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAJfuBxyRvPbjBQ0dVL5g9SL=hRgKxNKaadb5cxeEoEWt56k-Gg@mail.gmail.com>
Date: Mon, 12 Jul 2021 19:38:25 -0600
From: jim.cromie@...il.com
To: Joe Perches <joe@...ches.com>
Cc: Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
Maxime Ripard <mripard@...nel.org>,
Thomas Zimmermann <tzimmermann@...e.de>,
David Airlie <airlied@...ux.ie>,
Daniel Vetter <daniel@...ll.ch>,
Zhenyu Wang <zhenyuw@...ux.intel.com>,
Zhi Wang <zhi.a.wang@...el.com>,
Jani Nikula <jani.nikula@...ux.intel.com>,
Joonas Lahtinen <joonas.lahtinen@...ux.intel.com>,
Rodrigo Vivi <rodrigo.vivi@...el.com>,
dri-devel@...ts.freedesktop.org,
LKML <linux-kernel@...r.kernel.org>,
intel-gvt-dev@...ts.freedesktop.org,
intel-gfx@...ts.freedesktop.org, Jason Baron <jbaron@...mai.com>
Subject: Re: [RFC PATCH v2 1/4] drm_print.h: rewrap __DRM_DEFINE_DBG_RATELIMITED
macro
On Sun, Jul 11, 2021 at 10:17 AM Joe Perches <joe@...ches.com> wrote:
>
> On Sat, 2021-07-10 at 23:49 -0600, Jim Cromie wrote:
> > whitespace only, to diff-minimize a later commit.
> > no functional changes
> []
> > diff --git a/include/drm/drm_print.h b/include/drm/drm_print.h
> []
> > @@ -524,19 +524,24 @@ void __drm_err(const char *format, ...);
> > #define DRM_DEBUG_DP(fmt, ...) \
> > __drm_dbg(DRM_UT_DP, fmt, ## __VA_ARGS__)
> >
> >
> > -#define __DRM_DEFINE_DBG_RATELIMITED(category, drm, fmt, ...) \
> > -({ \
> > - static DEFINE_RATELIMIT_STATE(rs_, DEFAULT_RATELIMIT_INTERVAL, DEFAULT_RATELIMIT_BURST);\
> > - const struct drm_device *drm_ = (drm); \
> > - \
> > - if (drm_debug_enabled(DRM_UT_ ## category) && __ratelimit(&rs_)) \
> > - drm_dev_printk(drm_ ? drm_->dev : NULL, KERN_DEBUG, fmt, ## __VA_ARGS__); \
> > +#define __DRM_DEFINE_DBG_RATELIMITED(category, drm, fmt, ...) \
> > +({ \
> > + static DEFINE_RATELIMIT_STATE(rs_, \
> > + DEFAULT_RATELIMIT_INTERVAL, \
> > + DEFAULT_RATELIMIT_BURST); \
> > + const struct drm_device *drm_ = (drm); \
> > + \
> > + if (drm_debug_enabled(DRM_UT_ ## category) \
> > + && __ratelimit(&rs_)) \
>
> Though I don't really see the need for the change, the typical style
> has the logical continuation at the end of the test.
>
yes I caught that late, old habit, hard to break.
That if-statement is altered as part of HEAD+2
drm: RFC add choice to use dynamic debug in drm-debug
which replaces drm_dev_printk with drm_dev_dbg
(which calls pr_debug in DRM_USE_DYNAMIC_DEBUG)
> if (drm_debug_enabled(DRM_UT_ ## category) && \
> __ratelimit(&rs_)) \
>
>
Powered by blists - more mailing lists