[RFC/PATCH] mtd: nand: Refactor print messages

Ezequiel Garcia ezequiel.garcia at free-electrons.com
Thu Dec 5 05:32:59 EST 2013


On Wed, Dec 04, 2013 at 06:01:37PM -0800, Brian Norris 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.
> 

You're right, user-visible strings shouldn't be splitted. The 80-char limit has
an exception about this (qouting Documentation/CodingStyle):

""
  Chapter 2: Breaking long lines and strings

[..]
Statements longer than 80 columns will be broken into sensible chunks, unless
exceeding 80 columns significantly increases readability and does not hide
information. [..] However, never break user-visible strings such as printk
messages, because that breaks the ability to grep for them.
""

Regards!
-- 
Ezequiel García, Free Electrons
Embedded Linux, Kernel and Android Engineering
http://free-electrons.com



More information about the linux-mtd mailing list