From: Daniel Vetter Subject: Re: [PATCH] drm/print: add DRM_DEV_WARN macro Date: Tue, 12 Nov 2019 19:27:05 +0100 Message-ID: <20191112182705.GL23790@phenom.ffwll.local> References: <20191112170909.13733-1-wambui.karugax@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <20191112170909.13733-1-wambui.karugax@gmail.com> Sender: linux-kernel-owner@vger.kernel.org To: Wambui Karuga Cc: maarten.lankhorst@linux.intel.com, mripard@kernel.org, sean@poorly.run, airlied@linux.ie, daniel@ffwll.ch, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org List-Id: dri-devel@lists.freedesktop.org On Tue, Nov 12, 2019 at 08:09:09PM +0300, Wambui Karuga wrote: > Add the DRM_DEV_WARN helper macro for printing warnings > that use device pointers in their log output format. > DRM_DEV_WARN can replace the use of dev_warn in such cases. > > Signed-off-by: Wambui Karuga Can you pls include this in the patch to add the first user with rockchip? Otherwise always a bit awkward when we add functions without callers. lgtm otherwise. -Daniel > --- > include/drm/drm_print.h | 9 +++++++++ > 1 file changed, 9 insertions(+) > > diff --git a/include/drm/drm_print.h b/include/drm/drm_print.h > index 5b8049992c24..6ddf91c0cb29 100644 > --- a/include/drm/drm_print.h > +++ b/include/drm/drm_print.h > @@ -329,6 +329,15 @@ void drm_err(const char *format, ...); > #define DRM_WARN_ONCE(fmt, ...) \ > _DRM_PRINTK(_once, WARNING, fmt, ##__VA_ARGS__) > > +/** > + * Warning output. > + * > + * @dev: device pointer > + * @fmt: printf() like format string. > + */ > +#define DRM_DEV_WARN(dev, fmt, ...) \ > + drm_dev_printk(dev, KERN_WARNING, fmt, ##__VA_ARGS__) > + > /** > * Error output. > * > -- > 2.17.1 > -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch