linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Deming Wang <wangdeming@inspur.com>
Cc: <richard@nod.at>, <vigneshr@ti.com>,
	<linux-mtd@lists.infradead.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] mtd: Delete commented printk and add some space for required
Date: Thu, 6 Oct 2022 11:15:36 +0200	[thread overview]
Message-ID: <20221006111536.2c285116@xps-13> (raw)
In-Reply-To: <20221006090419.1635-1-wangdeming@inspur.com>

Hi Deming,

wangdeming@inspur.com wrote on Thu, 6 Oct 2022 05:04:19 -0400:

> Delete commented printk for NFTL_findwriteunit and
> 
> NFTL_makefreeblock. Add required space for the variable blockofs

I would rather not delete these comments because they are very old and
I believe were debugging lines in the past. I hope we will never have
to dig into this driver anymore but if we have to, I would suggest to
use debug printk's instead.

Also, if you want to clean up a bit the driver, you can go a little bit
further and address eg. all whitespace issues.

> Signed-off-by: Deming Wang <wangdeming@inspur.com>
> ---
>  drivers/mtd/nftlcore.c | 9 +--------
>  1 file changed, 1 insertion(+), 8 deletions(-)
> 
> diff --git a/drivers/mtd/nftlcore.c b/drivers/mtd/nftlcore.c
> index 64d319e959b2..e3c17ed4c219 100644
> --- a/drivers/mtd/nftlcore.c
> +++ b/drivers/mtd/nftlcore.c
> @@ -486,7 +486,6 @@ static u16 NFTL_makefreeblock( struct NFTLrecord *nftl , unsigned pendingblock)
>  
>  		while (EUN <= nftl->lastEUN) {
>  			thislen++;
> -			//printk("VUC %d reaches len %d with EUN %d\n", chain, thislen, EUN);
>  			EUN = nftl->ReplUnitTable[EUN] & 0x7fff;
>  			if (thislen > 0xff00) {
>  				printk("Endless loop in Virtual Chain %d: Unit %x\n",
> @@ -501,7 +500,6 @@ static u16 NFTL_makefreeblock( struct NFTLrecord *nftl , unsigned pendingblock)
>  		}
>  
>  		if (thislen > ChainLength) {
> -			//printk("New longest chain is %d with length %d\n", chain, thislen);
>  			ChainLength = thislen;
>  			LongestChain = chain;
>  		}
> @@ -525,7 +523,7 @@ static inline u16 NFTL_findwriteunit(struct NFTLrecord *nftl, unsigned block)
>  	u16 thisVUC = block / (nftl->EraseSize / 512);
>  	struct mtd_info *mtd = nftl->mbd.mtd;
>  	unsigned int writeEUN;
> -	unsigned long blockofs = (block * 512) & (nftl->EraseSize -1);
> +	unsigned long blockofs = (block * 512) & (nftl->EraseSize - 1);
>  	size_t retlen;
>  	int silly, silly2 = 3;
>  	struct nftl_oob oob;
> @@ -592,10 +590,6 @@ static inline u16 NFTL_findwriteunit(struct NFTLrecord *nftl, unsigned block)
>  			   a chain to make room.
>  			*/
>  
> -			/* First remember the start of this chain */
> -			//u16 startEUN = nftl->EUNtable[thisVUC];
> -
> -			//printk("Write to VirtualUnitChain %d, calling makefreeblock()\n", thisVUC);
>  			writeEUN = NFTL_makefreeblock(nftl, BLOCK_NIL);
>  
>  			if (writeEUN == BLOCK_NIL) {
> @@ -618,7 +612,6 @@ static inline u16 NFTL_findwriteunit(struct NFTLrecord *nftl, unsigned block)
>  				printk(KERN_WARNING "Cannot make free space.\n");
>  				return BLOCK_NIL;
>  			}
> -			//printk("Restarting scan\n");
>  			continue;
>  		}
>  


Thanks,
Miquèl

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

      reply	other threads:[~2022-10-06  9:15 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-06  9:04 [PATCH] mtd: Delete commented printk and add some space for required Deming Wang
2022-10-06  9:15 ` Miquel Raynal [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221006111536.2c285116@xps-13 \
    --to=miquel.raynal@bootlin.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=richard@nod.at \
    --cc=vigneshr@ti.com \
    --cc=wangdeming@inspur.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).