[RFC] staging: csr: remove usage of CsrSnprintf and use snprintf
Devendra Naga
develkernel412222 at gmail.com
Thu Aug 16 16:09:12 UTC 2012
On Thu, Aug 16, 2012 at 6:39 PM, Dan Carpenter <dan.carpenter at oracle.com> 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!
More information about the devel
mailing list