[PATCH EDACv16 1/2] edac: Change internal representation to work with layers

Luck, Tony tony.luck at intel.com
Sat Apr 28 04:11:49 EST 2012


>>> +	for (i = 0; i < dimm->mci->n_layers; i++) {
>>> +		printk(KERN_CONT "%d", dimm->location[i]);
>>> +		if (i < dimm->mci->n_layers - 1)
>>> +			printk(KERN_CONT ".");
>>> +	}
>>> +	printk(KERN_CONT "\n");
>> 
>> This looks hacky but I don't have a good suggestion what to do instead
>> here. Maybe snprintf into a complete string which you can issue with
>> debugf4()...
>
> This is not hacky. There are several places at the Kernel doing loops like
> that. Look, for example, at lib/hexdump.c (without KERN_CONT, as this
> macro was added later - probably to avoid checkpatch.pl complains).

There is some benefit to "one printk == one output line" ... it means
that console output will not be (as) jumbled if multiple cpus are
printk'ing at the same time.

-Tony


More information about the Linuxppc-dev mailing list