lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210215172655.GL3@paasikivi.fi.intel.com>
Date:   Mon, 15 Feb 2021 19:26:55 +0200
From:   Sakari Ailus <sakari.ailus@...ux.intel.com>
To:     Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc:     linux-kernel@...r.kernel.org, linux-media@...r.kernel.org,
        Petr Mladek <pmladek@...e.com>,
        Dave Stevenson <dave.stevenson@...pberrypi.com>,
        dri-devel@...ts.freedesktop.org, hverkuil@...all.nl,
        laurent.pinchart@...asonboard.com, mchehab@...nel.org,
        Sergey Senozhatsky <sergey.senozhatsky@...il.com>,
        Steven Rostedt <rostedt@...dmis.org>,
        Joe Perches <joe@...ches.com>,
        Jani Nikula <jani.nikula@...ux.intel.com>,
        Rasmus Villemoes <linux@...musvillemoes.dk>
Subject: Re: [PATCH v7 3/3] drm: Switch to %p4cc format modifier

On Mon, Feb 15, 2021 at 03:41:14PM +0200, Andy Shevchenko wrote:
...
> > diff --git a/drivers/gpu/drm/i915/display/intel_display_debugfs.c b/drivers/gpu/drm/i915/display/intel_display_debugfs.c
> > index ca41e8c00ad7..a5c9fe2e56b3 100644
> > --- a/drivers/gpu/drm/i915/display/intel_display_debugfs.c
> > +++ b/drivers/gpu/drm/i915/display/intel_display_debugfs.c
> > @@ -771,21 +771,21 @@ static void intel_plane_uapi_info(struct seq_file *m, struct intel_plane *plane)
> >  	const struct intel_plane_state *plane_state =
> >  		to_intel_plane_state(plane->base.state);
> >  	const struct drm_framebuffer *fb = plane_state->uapi.fb;
> > -	struct drm_format_name_buf format_name;
> >  	struct drm_rect src, dst;
> >  	char rot_str[48];
> >  
> >  	src = drm_plane_state_src(&plane_state->uapi);
> >  	dst = drm_plane_state_dest(&plane_state->uapi);
> >  
> > -	if (fb)
> > -		drm_get_format_name(fb->format->format, &format_name);
> > -
> >  	plane_rotation(rot_str, sizeof(rot_str),
> >  		       plane_state->uapi.rotation);
> >  
> > -	seq_printf(m, "\t\tuapi: [FB:%d] %s,0x%llx,%dx%d, visible=%s, src=" DRM_RECT_FP_FMT ", dst=" DRM_RECT_FMT ", rotation=%s\n",
> > -		   fb ? fb->base.id : 0, fb ? format_name.str : "n/a",
> > +	seq_printf(m, "\t\tuapi: [FB:%d] ", fb ? fb->base.id : 0);
> > +	if (fb)
> > +		seq_printf(m, "%p4cc", &fb->format->format);
> > +	else
> > +		seq_puts(m, "n/a");
> 
> > +	seq_printf(m, ",0x%llx,%dx%d, visible=%s, src=" DRM_RECT_FP_FMT ", dst=" DRM_RECT_FMT ", rotation=%s\n",
> 
> Why not to keep two seq_printf() calls?
> 
> if (fb) {
> 	seq_printf();
> } else {
> 	seq_printf();
> }
> 
> ?

I could, but it'd repeat a lot of the same format string that is very
complicated right now. Therefore I thought it's better to split.

Or do you mean seq_printf() vs. seq_puts()? checkpatch.pl (rightly) warns
about it.

> 
> >  		   fb ? fb->modifier : 0,
> >  		   fb ? fb->width : 0, fb ? fb->height : 0,
> >  		   plane_visibility(plane_state),

-- 
Sakari Ailus

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ