Re: [PATCH v7 3/3] drm: Switch to %p4cc format modifier

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Feb 15, 2021 at 07:26:55PM +0200, Sakari Ailus wrote:
> On Mon, Feb 15, 2021 at 03:41:14PM +0200, Andy Shevchenko wrote:
> ...
> > > +	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.

It's fine, why not?

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

If it doesn't take run-time parameters, then definitely
if (fb)
	seq_printf();
else
	seq_puts();

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

-- 
With Best Regards,
Andy Shevchenko


_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel



[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux