From: Stefan Roese Date: Wed, 28 Oct 2020 12:16:55 +0100 Subject: [PATCH v2 4/5] mtd: pxa3xx_nand: remove dead code In-Reply-To: <889cc270e4ac23d71b332a54b2340543302c76d8.1603024480.git.baruch@tkos.co.il> References: <889cc270e4ac23d71b332a54b2340543302c76d8.1603024480.git.baruch@tkos.co.il> Message-ID: <33904a84-9eb3-e470-ce45-4b62e11661b0@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 18.10.20 14:56, Baruch Siach wrote: > The kfree() call is unreachable, and is not needed. Remove this call and > the fail_disable_clk label. > > Signed-off-by: Baruch Siach Reviewed-by: Stefan Roese Thanks, Stefan > --- > drivers/mtd/nand/raw/pxa3xx_nand.c | 12 +++--------- > 1 file changed, 3 insertions(+), 9 deletions(-) > > diff --git a/drivers/mtd/nand/raw/pxa3xx_nand.c b/drivers/mtd/nand/raw/pxa3xx_nand.c > index 6f66db065357..635794b1691a 100644 > --- a/drivers/mtd/nand/raw/pxa3xx_nand.c > +++ b/drivers/mtd/nand/raw/pxa3xx_nand.c > @@ -1768,7 +1768,7 @@ static int alloc_nand_resource(struct pxa3xx_nand_info *info) > struct pxa3xx_nand_host *host; > struct nand_chip *chip = NULL; > struct mtd_info *mtd; > - int ret, cs; > + int cs; > > pdata = info->pdata; > if (pdata->num_cs <= 0) > @@ -1804,19 +1804,13 @@ static int alloc_nand_resource(struct pxa3xx_nand_info *info) > /* Allocate a buffer to allow flash detection */ > info->buf_size = INIT_BUFFER_SIZE; > info->data_buff = kmalloc(info->buf_size, GFP_KERNEL); > - if (info->data_buff == NULL) { > - ret = -ENOMEM; > - goto fail_disable_clk; > - } > + if (info->data_buff == NULL) > + return -ENOMEM; > > /* initialize all interrupts to be disabled */ > disable_int(info, NDSR_MASK); > > return 0; > - > - kfree(info->data_buff); > -fail_disable_clk: > - return ret; > } > > static int pxa3xx_nand_probe_dt(struct udevice *dev, struct pxa3xx_nand_info *info) > Viele Gr??e, Stefan -- DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr at denx.de