On Fri, Aug 3, 2012 at 11:43 AM, Nikunj A Dadhania <nik...@linux.vnet.ibm.com> wrote: > On Fri, 3 Aug 2012 02:16:18 -0700, Vikram Pandita <vikram.pand...@ti.com> > wrote:
>> +static size_t print_cpuid(u8 cpuid, char *buf) >> +{ >> + >> + if (!printk_cpuid) >> + return 0; >> + >> + if (!buf) >> + return 4; >> + > Firstly, why this magic number? > Secondly, if buf is NULL, why should you increment? The !buffer logic is used when we only calculate the size of the output buffer, but do not print to it. It's just an optimization. And yes, the number returned should match the number of chars that would have been printed, so this does not look right. Kay -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/