[RFC/PATCH] mtd: nand: Refactor print messages
Gupta, Pekon
pekon at ti.com
Thu Dec 5 01:26:39 EST 2013
>From: Brian Norris [mailto:computersforpeace at gmail.com]
>>On Mon, Nov 25, 2013 at 08:30:31AM -0300, Ezequiel Garcia wrote:
[...]
>> diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
>> index bd39f7b..4bdc0df 100644
>> --- a/drivers/mtd/nand/nand_base.c
>> +++ b/drivers/mtd/nand/nand_base.c
>...
>> @@ -3372,8 +3374,8 @@ static struct nand_flash_dev *nand_get_flash_type(struct mtd_info *mtd,
>> id_data[i] = chip->read_byte(mtd);
>>
>> if (id_data[0] != *maf_id || id_data[1] != *dev_id) {
>> - pr_info("%s: second ID read did not match "
>> - "%02x,%02x against %02x,%02x\n", __func__,
>> + pr_info("second ID read did not match "
>> + "%02x,%02x against %02x,%02x\n",
>
>scripts/checkpatch.pl and Documentation/CodingStyle don't like this long
>string (even though it would be over 80 chars). I think we should combine them.
>
Yes, breaking the string into multiple prints have a problem that you don't know
whether all parts of string get displayed continuously in console log.
Or they are scattered and mixed with other device probes logs because
device probe can sleep. Thus, we need to justify between:
- constrain print log to be within 80 character, (even in world where most
modern have gone much beyond 80+ character of display). OR
- have logs scattered and mixed with other device probe logs, which makes
On-field tracing and debugging difficult.
(I like the other part of this patch, prefixing all messages with consistent string).
with regards, pekon
More information about the linux-mtd
mailing list