Re: [PATCH] drm: Use vsnprintf extension %ph

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

 



On Wed, May 31, 2017 at 2:35 AM, Joe Perches <joe@xxxxxxxxxxx> wrote:
> Using the extension saves a bit of code.

> +               seq_printf(m, "faux/mst: %*ph\n", 2, buf);

> +               seq_printf(m, "mst ctrl: %*ph\n", 1, buf);

> +               seq_printf(m, "branch oui: %*phN devid: ", 3, buf);

All above may use shorter form, i.e.
"..., "%Xph", buf);", where X is a constant written explicitly inplace.

> +               seq_printf(m, " revision: hw: %x.%x sw: %x.%x\n",
> +                          buf[0x9] >> 4, buf[0x9] & 0xf, buf[0xa], buf[0xb]);

Matter of taste, though buf[9], buf[10], buf[11] looks better to me :-)

-- 
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