diff mbox

[v4,05/12] mtd: nand: print out the cell information for nand chip

Message ID 1380092301-21924-6-git-send-email-b32955@freescale.com
State New, archived
Headers show

Commit Message

Huang Shijie Sept. 25, 2013, 6:58 a.m. UTC
Print out the cell information for nand chip.

(Since the message is too long, this patch also splits the log
with two separate pr_info())

Signed-off-by: Huang Shijie <b32955@freescale.com>
---
 drivers/mtd/nand/nand_base.c |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

Comments

Brian Norris Sept. 30, 2013, 10:49 p.m. UTC | #1
On Wed, Sep 25, 2013 at 02:58:14PM +0800, Huang Shijie wrote:
> Print out the cell information for nand chip.
> 
> (Since the message is too long, this patch also splits the log
> with two separate pr_info())
> 
> Signed-off-by: Huang Shijie <b32955@freescale.com>
> ---
>  drivers/mtd/nand/nand_base.c |   11 +++++++----
>  1 files changed, 7 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
> index 94d9084..b94309b 100644
> --- a/drivers/mtd/nand/nand_base.c
> +++ b/drivers/mtd/nand/nand_base.c
> @@ -3460,11 +3460,14 @@ ident_done:
>  	if (mtd->writesize > 512 && chip->cmdfunc == nand_command)
>  		chip->cmdfunc = nand_command_lp;
>  
> -	pr_info("NAND device: Manufacturer ID: 0x%02x, Chip ID: 0x%02x (%s %s),"
> -		" %dMiB, page size: %d, OOB size: %d\n",
> +	pr_info("NAND device: Manufacturer ID: 0x%02x,"
> +			"Chip ID: 0x%02x (%s %s) \n",

You're adding excess whitespace before the '\n'. I'll squash this
myself.

>  		*maf_id, *dev_id, nand_manuf_ids[maf_idx].name,
> -		chip->onfi_version ? chip->onfi_params.model : type->name,
> -		(int)(chip->chipsize >> 20), mtd->writesize, mtd->oobsize);
> +		chip->onfi_version ? chip->onfi_params.model : type->name);
> +
> +	pr_info("NAND device: %dMiB, %s, page size: %d, OOB size: %d\n",
> +		(int)(chip->chipsize >> 20), nand_is_slc(chip) ? "SLC" : "MLC",
> +		mtd->writesize, mtd->oobsize);
>  
>  	return type;
>  }

Brian
Artem Bityutskiy Oct. 3, 2013, 2:34 p.m. UTC | #2
On Mon, 2013-09-30 at 15:49 -0700, Brian Norris wrote:
> On Wed, Sep 25, 2013 at 02:58:14PM +0800, Huang Shijie wrote:
> > Print out the cell information for nand chip.
> > 
> > (Since the message is too long, this patch also splits the log
> > with two separate pr_info())
> > 
> > Signed-off-by: Huang Shijie <b32955@freescale.com>
> > ---
> >  drivers/mtd/nand/nand_base.c |   11 +++++++----
> >  1 files changed, 7 insertions(+), 4 deletions(-)
> > 
> > diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
> > index 94d9084..b94309b 100644
> > --- a/drivers/mtd/nand/nand_base.c
> > +++ b/drivers/mtd/nand/nand_base.c
> > @@ -3460,11 +3460,14 @@ ident_done:
> >  	if (mtd->writesize > 512 && chip->cmdfunc == nand_command)
> >  		chip->cmdfunc = nand_command_lp;
> >  
> > -	pr_info("NAND device: Manufacturer ID: 0x%02x, Chip ID: 0x%02x (%s %s),"
> > -		" %dMiB, page size: %d, OOB size: %d\n",
> > +	pr_info("NAND device: Manufacturer ID: 0x%02x,"
> > +			"Chip ID: 0x%02x (%s %s) \n",
> 
> You're adding excess whitespace before the '\n'. I'll squash this
> myself.

Nowadays' fashion is to never split strings, Huang.
Brian Norris Oct. 3, 2013, 3:53 p.m. UTC | #3
On 10/03/2013 07:34 AM, Artem Bityutskiy wrote:
> On Mon, 2013-09-30 at 15:49 -0700, Brian Norris wrote:
>> On Wed, Sep 25, 2013 at 02:58:14PM +0800, Huang Shijie wrote:
>>> Print out the cell information for nand chip.
>>>
>>> (Since the message is too long, this patch also splits the log
>>> with two separate pr_info())
>>>
>>> Signed-off-by: Huang Shijie <b32955@freescale.com>
>>> ---
>>>   drivers/mtd/nand/nand_base.c |   11 +++++++----
>>>   1 files changed, 7 insertions(+), 4 deletions(-)
>>>
>>> diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
>>> index 94d9084..b94309b 100644
>>> --- a/drivers/mtd/nand/nand_base.c
>>> +++ b/drivers/mtd/nand/nand_base.c
>>> @@ -3460,11 +3460,14 @@ ident_done:
>>>   	if (mtd->writesize > 512 && chip->cmdfunc == nand_command)
>>>   		chip->cmdfunc = nand_command_lp;
>>>
>>> -	pr_info("NAND device: Manufacturer ID: 0x%02x, Chip ID: 0x%02x (%s %s),"
>>> -		" %dMiB, page size: %d, OOB size: %d\n",
>>> +	pr_info("NAND device: Manufacturer ID: 0x%02x,"
>>> +			"Chip ID: 0x%02x (%s %s) \n",
>>
>> You're adding excess whitespace before the '\n'. I'll squash this
>> myself.
>
> Nowadays' fashion is to never split strings, Huang.

checkpatch.pl actually warns about this now, so I already fixed it but 
didn't remember to mention it. Also, in splitting this string, Huang 
removed a space (fixed as well).

Brian
diff mbox

Patch

diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index 94d9084..b94309b 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -3460,11 +3460,14 @@  ident_done:
 	if (mtd->writesize > 512 && chip->cmdfunc == nand_command)
 		chip->cmdfunc = nand_command_lp;
 
-	pr_info("NAND device: Manufacturer ID: 0x%02x, Chip ID: 0x%02x (%s %s),"
-		" %dMiB, page size: %d, OOB size: %d\n",
+	pr_info("NAND device: Manufacturer ID: 0x%02x,"
+			"Chip ID: 0x%02x (%s %s) \n",
 		*maf_id, *dev_id, nand_manuf_ids[maf_idx].name,
-		chip->onfi_version ? chip->onfi_params.model : type->name,
-		(int)(chip->chipsize >> 20), mtd->writesize, mtd->oobsize);
+		chip->onfi_version ? chip->onfi_params.model : type->name);
+
+	pr_info("NAND device: %dMiB, %s, page size: %d, OOB size: %d\n",
+		(int)(chip->chipsize >> 20), nand_is_slc(chip) ? "SLC" : "MLC",
+		mtd->writesize, mtd->oobsize);
 
 	return type;
 }