All of lore.kernel.org
 help / color / mirror / Atom feed
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: kbuild-all@lists.01.org
Subject: Re: [mtd:spi-mem-ecc 16/29] drivers/mtd/nand/ecc-mxic.c:652 mxic_ecc_finish_io_req_external() error: uninitialized symbol 'ret'.
Date: Thu, 10 Feb 2022 09:33:59 +0100	[thread overview]
Message-ID: <20220210093359.779eb1dc@xps13> (raw)
In-Reply-To: <202202100023.AD5wMMvp-lkp@intel.com>

[-- Attachment #1: Type: text/plain, Size: 5325 bytes --]

Hi Dan,

dan.carpenter(a)oracle.com wrote on Wed, 9 Feb 2022 20:58:57 +0300:

> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git spi-mem-ecc
> head:   b556a86810e25b9d5a56da553bc65e5f4dcbedb6
> commit: f46b431b115d2ead7ccf71da53a5d1993f0acfcd [16/29] mtd: nand: mxic-ecc: Support SPI pipelined mode
> config: arm64-randconfig-m031-20220209 (https://download.01.org/0day-ci/archive/20220210/202202100023.AD5wMMvp-lkp(a)intel.com/config)
> compiler: aarch64-linux-gcc (GCC) 11.2.0
> 
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@intel.com>
> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> vim +/ret +652 drivers/mtd/nand/ecc-mxic.c
> 
> 48e6633a9fa2400 Miquel Raynal 2021-12-16  611  static int mxic_ecc_finish_io_req_external(struct nand_device *nand,
> 48e6633a9fa2400 Miquel Raynal 2021-12-16  612  					   struct nand_page_io_req *req)
> 48e6633a9fa2400 Miquel Raynal 2021-12-16  613  {
> 48e6633a9fa2400 Miquel Raynal 2021-12-16  614  	struct mxic_ecc_engine *mxic = nand_to_mxic(nand);
> 48e6633a9fa2400 Miquel Raynal 2021-12-16  615  	struct mxic_ecc_ctx *ctx = nand_to_ecc_ctx(nand);
> 48e6633a9fa2400 Miquel Raynal 2021-12-16  616  	int nents, step, ret;
> 48e6633a9fa2400 Miquel Raynal 2021-12-16  617  
> 48e6633a9fa2400 Miquel Raynal 2021-12-16  618  	if (req->mode == MTD_OPS_RAW)
> 48e6633a9fa2400 Miquel Raynal 2021-12-16  619  		return 0;
> 48e6633a9fa2400 Miquel Raynal 2021-12-16  620  
> 48e6633a9fa2400 Miquel Raynal 2021-12-16  621  	if (req->type == NAND_PAGE_WRITE) {
> 48e6633a9fa2400 Miquel Raynal 2021-12-16  622  		nand_ecc_restore_req(&ctx->req_ctx, req);
> 48e6633a9fa2400 Miquel Raynal 2021-12-16  623  		return 0;
> 48e6633a9fa2400 Miquel Raynal 2021-12-16  624  	}
> 48e6633a9fa2400 Miquel Raynal 2021-12-16  625  
> 48e6633a9fa2400 Miquel Raynal 2021-12-16  626  	/* Copy the OOB buffer and add room for the ECC engine status bytes */
> 48e6633a9fa2400 Miquel Raynal 2021-12-16  627  	mxic_ecc_add_room_in_oobbuf(ctx, ctx->oobwithstat, ctx->req->oobbuf.in);
> 48e6633a9fa2400 Miquel Raynal 2021-12-16  628  
> 48e6633a9fa2400 Miquel Raynal 2021-12-16  629  	sg_set_buf(&ctx->sg[0], req->databuf.in, req->datalen);
> 48e6633a9fa2400 Miquel Raynal 2021-12-16  630  	sg_set_buf(&ctx->sg[1], ctx->oobwithstat,
> 48e6633a9fa2400 Miquel Raynal 2021-12-16  631  		   req->ooblen + (ctx->steps * STAT_BYTES));
> 48e6633a9fa2400 Miquel Raynal 2021-12-16  632  	nents = dma_map_sg(mxic->dev, ctx->sg, 2, DMA_BIDIRECTIONAL);
> 48e6633a9fa2400 Miquel Raynal 2021-12-16  633  	if (!nents)
> 48e6633a9fa2400 Miquel Raynal 2021-12-16  634  		return -EINVAL;
> 48e6633a9fa2400 Miquel Raynal 2021-12-16  635  
> 48e6633a9fa2400 Miquel Raynal 2021-12-16  636  	mutex_lock(&mxic->lock);
> 48e6633a9fa2400 Miquel Raynal 2021-12-16  637  
> 48e6633a9fa2400 Miquel Raynal 2021-12-16  638  	for (step = 0; step < ctx->steps; step++) {
> 48e6633a9fa2400 Miquel Raynal 2021-12-16  639  		writel(sg_dma_address(&ctx->sg[0]) + (step * ctx->data_step_sz),
> 48e6633a9fa2400 Miquel Raynal 2021-12-16  640  		       mxic->regs + SDMA_MAIN_ADDR);
> 48e6633a9fa2400 Miquel Raynal 2021-12-16  641  		writel(sg_dma_address(&ctx->sg[1]) + (step * (ctx->oob_step_sz + STAT_BYTES)),
> 48e6633a9fa2400 Miquel Raynal 2021-12-16  642  		       mxic->regs + SDMA_SPARE_ADDR);
> 48e6633a9fa2400 Miquel Raynal 2021-12-16  643  		ret = mxic_ecc_process_data(mxic, ctx->req->type);
> 48e6633a9fa2400 Miquel Raynal 2021-12-16  644  		if (ret)
> 48e6633a9fa2400 Miquel Raynal 2021-12-16  645  			break;
> 48e6633a9fa2400 Miquel Raynal 2021-12-16  646  	}
> 48e6633a9fa2400 Miquel Raynal 2021-12-16  647  
> 48e6633a9fa2400 Miquel Raynal 2021-12-16  648  	mutex_unlock(&mxic->lock);
> 48e6633a9fa2400 Miquel Raynal 2021-12-16  649  
> 48e6633a9fa2400 Miquel Raynal 2021-12-16  650  	dma_unmap_sg(mxic->dev, ctx->sg, 2, DMA_BIDIRECTIONAL);
> 48e6633a9fa2400 Miquel Raynal 2021-12-16  651  
> f46b431b115d2ea Miquel Raynal 2021-12-16 @652  	if (!ret) {
> 
> Hi Miquel,
> 
> This if statement is reversed.  No !

-___-

I've attempted to do something else, and finally got rid of it, but
left the '!' behind...

> f46b431b115d2ea Miquel Raynal 2021-12-16  653  		nand_ecc_restore_req(&ctx->req_ctx, req);
> f46b431b115d2ea Miquel Raynal 2021-12-16  654  		return ret;
> f46b431b115d2ea Miquel Raynal 2021-12-16  655  	}
> f46b431b115d2ea Miquel Raynal 2021-12-16  656  
> 48e6633a9fa2400 Miquel Raynal 2021-12-16  657  	/* Extract the status bytes and reconstruct the buffer */
> 48e6633a9fa2400 Miquel Raynal 2021-12-16  658  	mxic_ecc_extract_status_bytes(ctx);
> 48e6633a9fa2400 Miquel Raynal 2021-12-16  659  	mxic_ecc_reconstruct_oobbuf(ctx, ctx->req->oobbuf.in, ctx->oobwithstat);
> 48e6633a9fa2400 Miquel Raynal 2021-12-16  660  
> 48e6633a9fa2400 Miquel Raynal 2021-12-16  661  	nand_ecc_restore_req(&ctx->req_ctx, req);
> 48e6633a9fa2400 Miquel Raynal 2021-12-16  662  
> 48e6633a9fa2400 Miquel Raynal 2021-12-16  663  	return mxic_ecc_count_biterrs(mxic, nand);
> 48e6633a9fa2400 Miquel Raynal 2021-12-16  664  }
> 
> ---
> 0-DAY CI Kernel Test Service, Intel Corporation
> https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
> 


Thanks,
Miquèl

WARNING: multiple messages have this Message-ID (diff)
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: kbuild@lists.01.org, lkp@intel.com, kbuild-all@lists.01.org,
	linux-kernel@vger.kernel.org
Subject: Re: [mtd:spi-mem-ecc 16/29] drivers/mtd/nand/ecc-mxic.c:652 mxic_ecc_finish_io_req_external() error: uninitialized symbol 'ret'.
Date: Thu, 10 Feb 2022 09:33:59 +0100	[thread overview]
Message-ID: <20220210093359.779eb1dc@xps13> (raw)
In-Reply-To: <202202100023.AD5wMMvp-lkp@intel.com>

Hi Dan,

dan.carpenter@oracle.com wrote on Wed, 9 Feb 2022 20:58:57 +0300:

> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git spi-mem-ecc
> head:   b556a86810e25b9d5a56da553bc65e5f4dcbedb6
> commit: f46b431b115d2ead7ccf71da53a5d1993f0acfcd [16/29] mtd: nand: mxic-ecc: Support SPI pipelined mode
> config: arm64-randconfig-m031-20220209 (https://download.01.org/0day-ci/archive/20220210/202202100023.AD5wMMvp-lkp@intel.com/config)
> compiler: aarch64-linux-gcc (GCC) 11.2.0
> 
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@intel.com>
> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> vim +/ret +652 drivers/mtd/nand/ecc-mxic.c
> 
> 48e6633a9fa2400 Miquel Raynal 2021-12-16  611  static int mxic_ecc_finish_io_req_external(struct nand_device *nand,
> 48e6633a9fa2400 Miquel Raynal 2021-12-16  612  					   struct nand_page_io_req *req)
> 48e6633a9fa2400 Miquel Raynal 2021-12-16  613  {
> 48e6633a9fa2400 Miquel Raynal 2021-12-16  614  	struct mxic_ecc_engine *mxic = nand_to_mxic(nand);
> 48e6633a9fa2400 Miquel Raynal 2021-12-16  615  	struct mxic_ecc_ctx *ctx = nand_to_ecc_ctx(nand);
> 48e6633a9fa2400 Miquel Raynal 2021-12-16  616  	int nents, step, ret;
> 48e6633a9fa2400 Miquel Raynal 2021-12-16  617  
> 48e6633a9fa2400 Miquel Raynal 2021-12-16  618  	if (req->mode == MTD_OPS_RAW)
> 48e6633a9fa2400 Miquel Raynal 2021-12-16  619  		return 0;
> 48e6633a9fa2400 Miquel Raynal 2021-12-16  620  
> 48e6633a9fa2400 Miquel Raynal 2021-12-16  621  	if (req->type == NAND_PAGE_WRITE) {
> 48e6633a9fa2400 Miquel Raynal 2021-12-16  622  		nand_ecc_restore_req(&ctx->req_ctx, req);
> 48e6633a9fa2400 Miquel Raynal 2021-12-16  623  		return 0;
> 48e6633a9fa2400 Miquel Raynal 2021-12-16  624  	}
> 48e6633a9fa2400 Miquel Raynal 2021-12-16  625  
> 48e6633a9fa2400 Miquel Raynal 2021-12-16  626  	/* Copy the OOB buffer and add room for the ECC engine status bytes */
> 48e6633a9fa2400 Miquel Raynal 2021-12-16  627  	mxic_ecc_add_room_in_oobbuf(ctx, ctx->oobwithstat, ctx->req->oobbuf.in);
> 48e6633a9fa2400 Miquel Raynal 2021-12-16  628  
> 48e6633a9fa2400 Miquel Raynal 2021-12-16  629  	sg_set_buf(&ctx->sg[0], req->databuf.in, req->datalen);
> 48e6633a9fa2400 Miquel Raynal 2021-12-16  630  	sg_set_buf(&ctx->sg[1], ctx->oobwithstat,
> 48e6633a9fa2400 Miquel Raynal 2021-12-16  631  		   req->ooblen + (ctx->steps * STAT_BYTES));
> 48e6633a9fa2400 Miquel Raynal 2021-12-16  632  	nents = dma_map_sg(mxic->dev, ctx->sg, 2, DMA_BIDIRECTIONAL);
> 48e6633a9fa2400 Miquel Raynal 2021-12-16  633  	if (!nents)
> 48e6633a9fa2400 Miquel Raynal 2021-12-16  634  		return -EINVAL;
> 48e6633a9fa2400 Miquel Raynal 2021-12-16  635  
> 48e6633a9fa2400 Miquel Raynal 2021-12-16  636  	mutex_lock(&mxic->lock);
> 48e6633a9fa2400 Miquel Raynal 2021-12-16  637  
> 48e6633a9fa2400 Miquel Raynal 2021-12-16  638  	for (step = 0; step < ctx->steps; step++) {
> 48e6633a9fa2400 Miquel Raynal 2021-12-16  639  		writel(sg_dma_address(&ctx->sg[0]) + (step * ctx->data_step_sz),
> 48e6633a9fa2400 Miquel Raynal 2021-12-16  640  		       mxic->regs + SDMA_MAIN_ADDR);
> 48e6633a9fa2400 Miquel Raynal 2021-12-16  641  		writel(sg_dma_address(&ctx->sg[1]) + (step * (ctx->oob_step_sz + STAT_BYTES)),
> 48e6633a9fa2400 Miquel Raynal 2021-12-16  642  		       mxic->regs + SDMA_SPARE_ADDR);
> 48e6633a9fa2400 Miquel Raynal 2021-12-16  643  		ret = mxic_ecc_process_data(mxic, ctx->req->type);
> 48e6633a9fa2400 Miquel Raynal 2021-12-16  644  		if (ret)
> 48e6633a9fa2400 Miquel Raynal 2021-12-16  645  			break;
> 48e6633a9fa2400 Miquel Raynal 2021-12-16  646  	}
> 48e6633a9fa2400 Miquel Raynal 2021-12-16  647  
> 48e6633a9fa2400 Miquel Raynal 2021-12-16  648  	mutex_unlock(&mxic->lock);
> 48e6633a9fa2400 Miquel Raynal 2021-12-16  649  
> 48e6633a9fa2400 Miquel Raynal 2021-12-16  650  	dma_unmap_sg(mxic->dev, ctx->sg, 2, DMA_BIDIRECTIONAL);
> 48e6633a9fa2400 Miquel Raynal 2021-12-16  651  
> f46b431b115d2ea Miquel Raynal 2021-12-16 @652  	if (!ret) {
> 
> Hi Miquel,
> 
> This if statement is reversed.  No !

-___-

I've attempted to do something else, and finally got rid of it, but
left the '!' behind...

> f46b431b115d2ea Miquel Raynal 2021-12-16  653  		nand_ecc_restore_req(&ctx->req_ctx, req);
> f46b431b115d2ea Miquel Raynal 2021-12-16  654  		return ret;
> f46b431b115d2ea Miquel Raynal 2021-12-16  655  	}
> f46b431b115d2ea Miquel Raynal 2021-12-16  656  
> 48e6633a9fa2400 Miquel Raynal 2021-12-16  657  	/* Extract the status bytes and reconstruct the buffer */
> 48e6633a9fa2400 Miquel Raynal 2021-12-16  658  	mxic_ecc_extract_status_bytes(ctx);
> 48e6633a9fa2400 Miquel Raynal 2021-12-16  659  	mxic_ecc_reconstruct_oobbuf(ctx, ctx->req->oobbuf.in, ctx->oobwithstat);
> 48e6633a9fa2400 Miquel Raynal 2021-12-16  660  
> 48e6633a9fa2400 Miquel Raynal 2021-12-16  661  	nand_ecc_restore_req(&ctx->req_ctx, req);
> 48e6633a9fa2400 Miquel Raynal 2021-12-16  662  
> 48e6633a9fa2400 Miquel Raynal 2021-12-16  663  	return mxic_ecc_count_biterrs(mxic, nand);
> 48e6633a9fa2400 Miquel Raynal 2021-12-16  664  }
> 
> ---
> 0-DAY CI Kernel Test Service, Intel Corporation
> https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
> 


Thanks,
Miquèl

  reply	other threads:[~2022-02-10  8:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-09 16:52 [mtd:spi-mem-ecc 16/29] drivers/mtd/nand/ecc-mxic.c:652 mxic_ecc_finish_io_req_external() error: uninitialized symbol 'ret' kernel test robot
2022-02-09 17:58 ` Dan Carpenter
2022-02-09 17:58 ` Dan Carpenter
2022-02-10  8:33 ` Miquel Raynal [this message]
2022-02-10  8:33   ` Miquel Raynal

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=20220210093359.779eb1dc@xps13 \
    --to=miquel.raynal@bootlin.com \
    --cc=kbuild-all@lists.01.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.