Re: [RFC] staging: csr: remove usage of CsrSnprintf and use snprintf

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

 



On Thu, Aug 16, 2012 at 6:39 PM, Dan Carpenter <dan.carpenter@xxxxxxxxxx> wrote:
>
> UNIFI_SNPRINTF_RET() is a disgusting macro.  If you wanted to remove
> it at the same time that would be fine.
>
I need some more time in doing that, anyway i will be doing it in next
patch (not in this patch) may be.

> Use scnprintf().  The snprintf() function returns the number of
> bytes which would have been written and the scnprintf() function
> returns the number of bytes which actually were written.  It would
> be something like:
>
>         int len = 0;
>
>         len += scnprintf(p + len, size - len, "Chip ID %u\n", ...);
>         len += scnprintf(p + len, size - len, "Chip Version %04X\n", ...);
>
> etc.
>
Thanks for the new things, i would have read the documentation before
doing this, anyway i implemented this change.

> regards,
> dan carpenter
>
>

Thanks!
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel


[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux