* [PATCH] drivers/ata/pata_mpc52xx.c: add missing kfree @ 2012-03-10 17:56 ` Julia Lawall 0 siblings, 0 replies; 18+ messages in thread From: Julia Lawall @ 2012-03-10 17:56 UTC (permalink / raw) To: Jeff Garzik Cc: kernel-janitors, Grant Likely, Rob Herring, linux-ide, linux-kernel, devicetree-discuss From: Julia Lawall <Julia.Lawall@lip6.fr> There is no need to call the devm cleanup functions on failure of a probe or remove function. Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> --- drivers/ata/pata_mpc52xx.c | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/drivers/ata/pata_mpc52xx.c b/drivers/ata/pata_mpc52xx.c index 00748ae..1f02008 100644 --- a/drivers/ata/pata_mpc52xx.c +++ b/drivers/ata/pata_mpc52xx.c @@ -806,17 +806,12 @@ mpc52xx_ata_probe(struct platform_device *op) return 0; err: - devm_release_mem_region(&op->dev, res_mem.start, sizeof(*ata_regs)); if (ata_irq) irq_dispose_mapping(ata_irq); if (task_irq) irq_dispose_mapping(task_irq); if (dmatsk) bcom_ata_release(dmatsk); - if (ata_regs) - devm_iounmap(&op->dev, ata_regs); - if (priv) - devm_kfree(&op->dev, priv); return rv; } @@ -835,12 +830,6 @@ mpc52xx_ata_remove(struct platform_device *op) bcom_ata_release(priv->dmatsk); irq_dispose_mapping(priv->ata_irq); - /* Clear up IO allocations */ - devm_iounmap(&op->dev, priv->ata_regs); - devm_release_mem_region(&op->dev, priv->ata_regs_pa, - sizeof(*priv->ata_regs)); - devm_kfree(&op->dev, priv); - return 0; } ^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH] drivers/ata/pata_mpc52xx.c: add missing kfree @ 2012-03-10 17:56 ` Julia Lawall 0 siblings, 0 replies; 18+ messages in thread From: Julia Lawall @ 2012-03-10 17:56 UTC (permalink / raw) To: Jeff Garzik Cc: kernel-janitors, Grant Likely, Rob Herring, linux-ide, linux-kernel, devicetree-discuss From: Julia Lawall <Julia.Lawall@lip6.fr> There is no need to call the devm cleanup functions on failure of a probe or remove function. Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> --- drivers/ata/pata_mpc52xx.c | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/drivers/ata/pata_mpc52xx.c b/drivers/ata/pata_mpc52xx.c index 00748ae..1f02008 100644 --- a/drivers/ata/pata_mpc52xx.c +++ b/drivers/ata/pata_mpc52xx.c @@ -806,17 +806,12 @@ mpc52xx_ata_probe(struct platform_device *op) return 0; err: - devm_release_mem_region(&op->dev, res_mem.start, sizeof(*ata_regs)); if (ata_irq) irq_dispose_mapping(ata_irq); if (task_irq) irq_dispose_mapping(task_irq); if (dmatsk) bcom_ata_release(dmatsk); - if (ata_regs) - devm_iounmap(&op->dev, ata_regs); - if (priv) - devm_kfree(&op->dev, priv); return rv; } @@ -835,12 +830,6 @@ mpc52xx_ata_remove(struct platform_device *op) bcom_ata_release(priv->dmatsk); irq_dispose_mapping(priv->ata_irq); - /* Clear up IO allocations */ - devm_iounmap(&op->dev, priv->ata_regs); - devm_release_mem_region(&op->dev, priv->ata_regs_pa, - sizeof(*priv->ata_regs)); - devm_kfree(&op->dev, priv); - return 0; } ^ permalink raw reply related [flat|nested] 18+ messages in thread
* Re: [PATCH] drivers/ata/pata_mpc52xx.c: add missing kfree 2012-03-10 17:56 ` Julia Lawall @ 2012-03-10 18:13 ` Wolfram Sang -1 siblings, 0 replies; 18+ messages in thread From: Wolfram Sang @ 2012-03-10 18:13 UTC (permalink / raw) To: Julia Lawall Cc: Jeff Garzik, kernel-janitors, Grant Likely, Rob Herring, linux-ide, linux-kernel, devicetree-discuss [-- Attachment #1: Type: text/plain, Size: 592 bytes --] On Sat, Mar 10, 2012 at 06:56:39PM +0100, Julia Lawall wrote: > From: Julia Lawall <Julia.Lawall@lip6.fr> > > There is no need to call the devm cleanup functions on failure of a probe > or remove function. > > Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Right. Only the subject is bogus and the maintainer for MPC5xxx is Anatolij meanwhile :) Other than that: Acked-by: Wolfram Sang <w.sang@pengutronix.de> -- Pengutronix e.K. | Wolfram Sang | Industrial Linux Solutions | http://www.pengutronix.de/ | [-- Attachment #2: Digital signature --] [-- Type: application/pgp-signature, Size: 198 bytes --] ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH] drivers/ata/pata_mpc52xx.c: add missing kfree @ 2012-03-10 18:13 ` Wolfram Sang 0 siblings, 0 replies; 18+ messages in thread From: Wolfram Sang @ 2012-03-10 18:13 UTC (permalink / raw) To: Julia Lawall Cc: Jeff Garzik, kernel-janitors, Grant Likely, Rob Herring, linux-ide, linux-kernel, devicetree-discuss [-- Attachment #1: Type: text/plain, Size: 592 bytes --] On Sat, Mar 10, 2012 at 06:56:39PM +0100, Julia Lawall wrote: > From: Julia Lawall <Julia.Lawall@lip6.fr> > > There is no need to call the devm cleanup functions on failure of a probe > or remove function. > > Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Right. Only the subject is bogus and the maintainer for MPC5xxx is Anatolij meanwhile :) Other than that: Acked-by: Wolfram Sang <w.sang@pengutronix.de> -- Pengutronix e.K. | Wolfram Sang | Industrial Linux Solutions | http://www.pengutronix.de/ | [-- Attachment #2: Digital signature --] [-- Type: application/pgp-signature, Size: 198 bytes --] ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH] drivers/ata/pata_mpc52xx.c: add missing kfree 2012-03-10 18:13 ` Wolfram Sang @ 2012-03-10 18:32 ` Joe Perches -1 siblings, 0 replies; 18+ messages in thread From: Joe Perches @ 2012-03-10 18:32 UTC (permalink / raw) To: Wolfram Sang, Anatolij Gustschin Cc: Julia Lawall, Jeff Garzik, kernel-janitors, Grant Likely, Rob Herring, linux-ide, linux-kernel, devicetree-discuss On Sat, 2012-03-10 at 19:13 +0100, Wolfram Sang wrote: > On Sat, Mar 10, 2012 at 06:56:39PM +0100, Julia Lawall wrote: > > From: Julia Lawall <Julia.Lawall@lip6.fr> > > There is no need to call the devm cleanup functions on failure of a probe > > or remove function. > > Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> > the maintainer for MPC5xxx is Anatolij Anatolij is not listed as a maintainer for this file nor has he ever written or signed a patch for it. It'd be possible to add patterns to MAINTAINERS if Anatolij really wants to see changes to drivers. Something like: LINUX FOR POWERPC EMBEDDED MPC5XXX M: Anatolij Gustschin <agust@denx.de> L: linuxppc-dev@lists.ozlabs.org T: git git://git.denx.de/linux-2.6-agust.git S: Maintained F: arch/powerpc/platforms/512x/ F: arch/powerpc/platforms/52xx/ F: */*/*mpc5[\dx][\dx][\dx]* F: */*/*/*mpc5[\dx][\dx][\dx]* F: */*/*/*/*mpc5[\dx][\dx][\dx]* ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH] drivers/ata/pata_mpc52xx.c: add missing kfree @ 2012-03-10 18:32 ` Joe Perches 0 siblings, 0 replies; 18+ messages in thread From: Joe Perches @ 2012-03-10 18:32 UTC (permalink / raw) To: Wolfram Sang, Anatolij Gustschin Cc: Julia Lawall, Jeff Garzik, kernel-janitors, Grant Likely, Rob Herring, linux-ide, linux-kernel, devicetree-discuss On Sat, 2012-03-10 at 19:13 +0100, Wolfram Sang wrote: > On Sat, Mar 10, 2012 at 06:56:39PM +0100, Julia Lawall wrote: > > From: Julia Lawall <Julia.Lawall@lip6.fr> > > There is no need to call the devm cleanup functions on failure of a probe > > or remove function. > > Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> > the maintainer for MPC5xxx is Anatolij Anatolij is not listed as a maintainer for this file nor has he ever written or signed a patch for it. It'd be possible to add patterns to MAINTAINERS if Anatolij really wants to see changes to drivers. Something like: LINUX FOR POWERPC EMBEDDED MPC5XXX M: Anatolij Gustschin <agust@denx.de> L: linuxppc-dev@lists.ozlabs.org T: git git://git.denx.de/linux-2.6-agust.git S: Maintained F: arch/powerpc/platforms/512x/ F: arch/powerpc/platforms/52xx/ F: */*/*mpc5[\dx][\dx][\dx]* F: */*/*/*mpc5[\dx][\dx][\dx]* F: */*/*/*/*mpc5[\dx][\dx][\dx]* ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH] drivers/ata/pata_mpc52xx.c: add missing kfree 2012-03-10 18:32 ` Joe Perches (?) @ 2012-03-10 18:44 ` Wolfram Sang -1 siblings, 0 replies; 18+ messages in thread From: Wolfram Sang @ 2012-03-10 18:44 UTC (permalink / raw) To: Joe Perches Cc: linux-ide-u79uwXL29TY76Z2rM5mHXA, devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, kernel-janitors-u79uwXL29TY76Z2rM5mHXA, linux-kernel-u79uwXL29TY76Z2rM5mHXA, Rob Herring, Julia Lawall, Jeff Garzik [-- Attachment #1: Type: text/plain, Size: 698 bytes --] > Anatolij is not listed as a maintainer for this file > nor has he ever written or signed a patch for it. I noticed that Grant was in CC, assumed that it was because of his previous MPC maintainership and mentioned that Anatolij took over. Nothing more, just wanted to help. > It'd be possible to add patterns to MAINTAINERS > if Anatolij really wants to see changes to drivers. It seems a bit too much for my taste (hardly readable? false positives?), but then again, it is not my decision, but Anatolij's :) Thanks! -- Pengutronix e.K. | Wolfram Sang | Industrial Linux Solutions | http://www.pengutronix.de/ | [-- Attachment #2: Digital signature --] [-- Type: application/pgp-signature, Size: 198 bytes --] ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH] drivers/ata/pata_mpc52xx.c: add missing kfree @ 2012-03-10 18:44 ` Wolfram Sang 0 siblings, 0 replies; 18+ messages in thread From: Wolfram Sang @ 2012-03-10 18:44 UTC (permalink / raw) To: Joe Perches Cc: Anatolij Gustschin, Julia Lawall, Jeff Garzik, kernel-janitors, Grant Likely, Rob Herring, linux-ide, linux-kernel, devicetree-discuss [-- Attachment #1: Type: text/plain, Size: 698 bytes --] > Anatolij is not listed as a maintainer for this file > nor has he ever written or signed a patch for it. I noticed that Grant was in CC, assumed that it was because of his previous MPC maintainership and mentioned that Anatolij took over. Nothing more, just wanted to help. > It'd be possible to add patterns to MAINTAINERS > if Anatolij really wants to see changes to drivers. It seems a bit too much for my taste (hardly readable? false positives?), but then again, it is not my decision, but Anatolij's :) Thanks! -- Pengutronix e.K. | Wolfram Sang | Industrial Linux Solutions | http://www.pengutronix.de/ | [-- Attachment #2: Digital signature --] [-- Type: application/pgp-signature, Size: 198 bytes --] ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH] drivers/ata/pata_mpc52xx.c: add missing kfree @ 2012-03-10 18:44 ` Wolfram Sang 0 siblings, 0 replies; 18+ messages in thread From: Wolfram Sang @ 2012-03-10 18:44 UTC (permalink / raw) To: Joe Perches Cc: linux-ide-u79uwXL29TY76Z2rM5mHXA, devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, kernel-janitors-u79uwXL29TY76Z2rM5mHXA, linux-kernel-u79uwXL29TY76Z2rM5mHXA, Rob Herring, Julia Lawall, Jeff Garzik [-- Attachment #1.1: Type: text/plain, Size: 698 bytes --] > Anatolij is not listed as a maintainer for this file > nor has he ever written or signed a patch for it. I noticed that Grant was in CC, assumed that it was because of his previous MPC maintainership and mentioned that Anatolij took over. Nothing more, just wanted to help. > It'd be possible to add patterns to MAINTAINERS > if Anatolij really wants to see changes to drivers. It seems a bit too much for my taste (hardly readable? false positives?), but then again, it is not my decision, but Anatolij's :) Thanks! -- Pengutronix e.K. | Wolfram Sang | Industrial Linux Solutions | http://www.pengutronix.de/ | [-- Attachment #1.2: Digital signature --] [-- Type: application/pgp-signature, Size: 198 bytes --] [-- Attachment #2: Type: text/plain, Size: 192 bytes --] _______________________________________________ devicetree-discuss mailing list devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org https://lists.ozlabs.org/listinfo/devicetree-discuss ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH] drivers/ata/pata_mpc52xx.c: add missing kfree 2012-03-10 18:44 ` Wolfram Sang @ 2012-03-10 19:22 ` Joe Perches -1 siblings, 0 replies; 18+ messages in thread From: Joe Perches @ 2012-03-10 19:22 UTC (permalink / raw) To: Wolfram Sang Cc: Anatolij Gustschin, Julia Lawall, Jeff Garzik, kernel-janitors, Grant Likely, Rob Herring, linux-ide, linux-kernel, devicetree-discuss On Sat, 2012-03-10 at 19:44 +0100, Wolfram Sang wrote: > > Anatolij is not listed as a maintainer for this file > > nor has he ever written or signed a patch for it. > I noticed that Grant was in CC, assumed that it was because of his previous MPC > maintainership and mentioned that Anatolij took over. Nothing more, just wanted > to help. Actually, it's because there's a K: of_get_property line in OPEN FIRMWARE and the file has one. I suppose that get_maintainers could be told to ignore K: entries when using -f <file>. > > It'd be possible to add patterns to MAINTAINERS > > if Anatolij really wants to see changes to drivers. > It seems a bit too much for my taste (hardly readable? false positives?), There are no false positives as far as I can tell. Just using *mpc5* doesn't give any either today. It's perlish so the whole thing is gibberish anyway. ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH] drivers/ata/pata_mpc52xx.c: add missing kfree @ 2012-03-10 19:22 ` Joe Perches 0 siblings, 0 replies; 18+ messages in thread From: Joe Perches @ 2012-03-10 19:22 UTC (permalink / raw) To: Wolfram Sang Cc: Anatolij Gustschin, Julia Lawall, Jeff Garzik, kernel-janitors, Grant Likely, Rob Herring, linux-ide, linux-kernel, devicetree-discuss On Sat, 2012-03-10 at 19:44 +0100, Wolfram Sang wrote: > > Anatolij is not listed as a maintainer for this file > > nor has he ever written or signed a patch for it. > I noticed that Grant was in CC, assumed that it was because of his previous MPC > maintainership and mentioned that Anatolij took over. Nothing more, just wanted > to help. Actually, it's because there's a K: of_get_property line in OPEN FIRMWARE and the file has one. I suppose that get_maintainers could be told to ignore K: entries when using -f <file>. > > It'd be possible to add patterns to MAINTAINERS > > if Anatolij really wants to see changes to drivers. > It seems a bit too much for my taste (hardly readable? false positives?), There are no false positives as far as I can tell. Just using *mpc5* doesn't give any either today. It's perlish so the whole thing is gibberish anyway. ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH] drivers/ata/pata_mpc52xx.c: add missing kfree 2012-03-10 17:56 ` Julia Lawall @ 2012-03-10 18:32 ` walter harms -1 siblings, 0 replies; 18+ messages in thread From: walter harms @ 2012-03-10 18:32 UTC (permalink / raw) To: Julia Lawall Cc: Jeff Garzik, kernel-janitors, Grant Likely, Rob Herring, linux-ide, linux-kernel, devicetree-discuss Am 10.03.2012 18:56, schrieb Julia Lawall: > From: Julia Lawall <Julia.Lawall@lip6.fr> > > There is no need to call the devm cleanup functions on failure of a probe > or remove function. > > Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> > > --- > drivers/ata/pata_mpc52xx.c | 11 ----------- > 1 file changed, 11 deletions(-) > > diff --git a/drivers/ata/pata_mpc52xx.c b/drivers/ata/pata_mpc52xx.c > index 00748ae..1f02008 100644 > --- a/drivers/ata/pata_mpc52xx.c > +++ b/drivers/ata/pata_mpc52xx.c > @@ -806,17 +806,12 @@ mpc52xx_ata_probe(struct platform_device *op) > return 0; > > err: > - devm_release_mem_region(&op->dev, res_mem.start, sizeof(*ata_regs)); > if (ata_irq) > irq_dispose_mapping(ata_irq); > if (task_irq) > irq_dispose_mapping(task_irq); hi julia, i did a quick look at lxr and it showed that irq_dispose_mapping() is only used with powerpc, and here is it checking for if (virq = NO_IRQ) return; I do not know how current the lxt on free-electrons.com is but perhaps it is possible to dump the if (ata_irq) stuff. can you double check it ? re, wh > if (dmatsk) > bcom_ata_release(dmatsk); > - if (ata_regs) > - devm_iounmap(&op->dev, ata_regs); > - if (priv) > - devm_kfree(&op->dev, priv); > return rv; > } > > @@ -835,12 +830,6 @@ mpc52xx_ata_remove(struct platform_device *op) > bcom_ata_release(priv->dmatsk); > irq_dispose_mapping(priv->ata_irq); > > - /* Clear up IO allocations */ > - devm_iounmap(&op->dev, priv->ata_regs); > - devm_release_mem_region(&op->dev, priv->ata_regs_pa, > - sizeof(*priv->ata_regs)); > - devm_kfree(&op->dev, priv); > - > return 0; > } > > > -- > To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > > ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH] drivers/ata/pata_mpc52xx.c: add missing kfree @ 2012-03-10 18:32 ` walter harms 0 siblings, 0 replies; 18+ messages in thread From: walter harms @ 2012-03-10 18:32 UTC (permalink / raw) To: Julia Lawall Cc: Jeff Garzik, kernel-janitors, Grant Likely, Rob Herring, linux-ide, linux-kernel, devicetree-discuss Am 10.03.2012 18:56, schrieb Julia Lawall: > From: Julia Lawall <Julia.Lawall@lip6.fr> > > There is no need to call the devm cleanup functions on failure of a probe > or remove function. > > Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> > > --- > drivers/ata/pata_mpc52xx.c | 11 ----------- > 1 file changed, 11 deletions(-) > > diff --git a/drivers/ata/pata_mpc52xx.c b/drivers/ata/pata_mpc52xx.c > index 00748ae..1f02008 100644 > --- a/drivers/ata/pata_mpc52xx.c > +++ b/drivers/ata/pata_mpc52xx.c > @@ -806,17 +806,12 @@ mpc52xx_ata_probe(struct platform_device *op) > return 0; > > err: > - devm_release_mem_region(&op->dev, res_mem.start, sizeof(*ata_regs)); > if (ata_irq) > irq_dispose_mapping(ata_irq); > if (task_irq) > irq_dispose_mapping(task_irq); hi julia, i did a quick look at lxr and it showed that irq_dispose_mapping() is only used with powerpc, and here is it checking for if (virq == NO_IRQ) return; I do not know how current the lxt on free-electrons.com is but perhaps it is possible to dump the if (ata_irq) stuff. can you double check it ? re, wh > if (dmatsk) > bcom_ata_release(dmatsk); > - if (ata_regs) > - devm_iounmap(&op->dev, ata_regs); > - if (priv) > - devm_kfree(&op->dev, priv); > return rv; > } > > @@ -835,12 +830,6 @@ mpc52xx_ata_remove(struct platform_device *op) > bcom_ata_release(priv->dmatsk); > irq_dispose_mapping(priv->ata_irq); > > - /* Clear up IO allocations */ > - devm_iounmap(&op->dev, priv->ata_regs); > - devm_release_mem_region(&op->dev, priv->ata_regs_pa, > - sizeof(*priv->ata_regs)); > - devm_kfree(&op->dev, priv); > - > return 0; > } > > > -- > To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > > ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH] drivers/ata/pata_mpc52xx.c: add missing kfree 2012-03-10 18:32 ` walter harms @ 2012-03-10 21:50 ` Julia Lawall -1 siblings, 0 replies; 18+ messages in thread From: Julia Lawall @ 2012-03-10 21:50 UTC (permalink / raw) To: walter harms Cc: Julia Lawall, Jeff Garzik, kernel-janitors, Grant Likely, Rob Herring, linux-ide, linux-kernel, devicetree-discuss On Sat, 10 Mar 2012, walter harms wrote: > > > Am 10.03.2012 18:56, schrieb Julia Lawall: >> From: Julia Lawall <Julia.Lawall@lip6.fr> >> >> There is no need to call the devm cleanup functions on failure of a probe >> or remove function. >> >> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> >> >> --- >> drivers/ata/pata_mpc52xx.c | 11 ----------- >> 1 file changed, 11 deletions(-) >> >> diff --git a/drivers/ata/pata_mpc52xx.c b/drivers/ata/pata_mpc52xx.c >> index 00748ae..1f02008 100644 >> --- a/drivers/ata/pata_mpc52xx.c >> +++ b/drivers/ata/pata_mpc52xx.c >> @@ -806,17 +806,12 @@ mpc52xx_ata_probe(struct platform_device *op) >> return 0; >> >> err: >> - devm_release_mem_region(&op->dev, res_mem.start, sizeof(*ata_regs)); >> if (ata_irq) >> irq_dispose_mapping(ata_irq); >> if (task_irq) >> irq_dispose_mapping(task_irq); > > hi julia, > i did a quick look at lxr and it showed that irq_dispose_mapping() > is only used with powerpc, and here is it checking for > if (virq = NO_IRQ) > return; > > I do not know how current the lxt on free-electrons.com is but perhaps > it is possible to dump the if (ata_irq) stuff. > > can you double check it ? The definition in v3.2.9/kernel/irq/irqdomain.c does nothing but says: nothing yet; will be filled when support for dynamic allocation of irq_descs is added to irq_domain So it would seem better to keep the call. On the other hand, the error handling code of this function seems to be a mess. When the initialization of ata_irq fails, it just returns instead of cleaning up. Prior code goes to err. On ther other hand, now that the devm cleanups are gone, it is the goto err, which is unnecessary. I'll look at the code some more. julia > > re, > wh > > >> if (dmatsk) >> bcom_ata_release(dmatsk); >> - if (ata_regs) >> - devm_iounmap(&op->dev, ata_regs); >> - if (priv) >> - devm_kfree(&op->dev, priv); >> return rv; >> } >> >> @@ -835,12 +830,6 @@ mpc52xx_ata_remove(struct platform_device *op) >> bcom_ata_release(priv->dmatsk); >> irq_dispose_mapping(priv->ata_irq); >> >> - /* Clear up IO allocations */ >> - devm_iounmap(&op->dev, priv->ata_regs); >> - devm_release_mem_region(&op->dev, priv->ata_regs_pa, >> - sizeof(*priv->ata_regs)); >> - devm_kfree(&op->dev, priv); >> - >> return 0; >> } >> >> >> -- >> To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in >> the body of a message to majordomo@vger.kernel.org >> More majordomo info at http://vger.kernel.org/majordomo-info.html >> >> > -- > To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH] drivers/ata/pata_mpc52xx.c: add missing kfree @ 2012-03-10 21:50 ` Julia Lawall 0 siblings, 0 replies; 18+ messages in thread From: Julia Lawall @ 2012-03-10 21:50 UTC (permalink / raw) To: walter harms Cc: Julia Lawall, Jeff Garzik, kernel-janitors, Grant Likely, Rob Herring, linux-ide, linux-kernel, devicetree-discuss On Sat, 10 Mar 2012, walter harms wrote: > > > Am 10.03.2012 18:56, schrieb Julia Lawall: >> From: Julia Lawall <Julia.Lawall@lip6.fr> >> >> There is no need to call the devm cleanup functions on failure of a probe >> or remove function. >> >> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> >> >> --- >> drivers/ata/pata_mpc52xx.c | 11 ----------- >> 1 file changed, 11 deletions(-) >> >> diff --git a/drivers/ata/pata_mpc52xx.c b/drivers/ata/pata_mpc52xx.c >> index 00748ae..1f02008 100644 >> --- a/drivers/ata/pata_mpc52xx.c >> +++ b/drivers/ata/pata_mpc52xx.c >> @@ -806,17 +806,12 @@ mpc52xx_ata_probe(struct platform_device *op) >> return 0; >> >> err: >> - devm_release_mem_region(&op->dev, res_mem.start, sizeof(*ata_regs)); >> if (ata_irq) >> irq_dispose_mapping(ata_irq); >> if (task_irq) >> irq_dispose_mapping(task_irq); > > hi julia, > i did a quick look at lxr and it showed that irq_dispose_mapping() > is only used with powerpc, and here is it checking for > if (virq == NO_IRQ) > return; > > I do not know how current the lxt on free-electrons.com is but perhaps > it is possible to dump the if (ata_irq) stuff. > > can you double check it ? The definition in v3.2.9/kernel/irq/irqdomain.c does nothing but says: nothing yet; will be filled when support for dynamic allocation of irq_descs is added to irq_domain So it would seem better to keep the call. On the other hand, the error handling code of this function seems to be a mess. When the initialization of ata_irq fails, it just returns instead of cleaning up. Prior code goes to err. On ther other hand, now that the devm cleanups are gone, it is the goto err, which is unnecessary. I'll look at the code some more. julia > > re, > wh > > >> if (dmatsk) >> bcom_ata_release(dmatsk); >> - if (ata_regs) >> - devm_iounmap(&op->dev, ata_regs); >> - if (priv) >> - devm_kfree(&op->dev, priv); >> return rv; >> } >> >> @@ -835,12 +830,6 @@ mpc52xx_ata_remove(struct platform_device *op) >> bcom_ata_release(priv->dmatsk); >> irq_dispose_mapping(priv->ata_irq); >> >> - /* Clear up IO allocations */ >> - devm_iounmap(&op->dev, priv->ata_regs); >> - devm_release_mem_region(&op->dev, priv->ata_regs_pa, >> - sizeof(*priv->ata_regs)); >> - devm_kfree(&op->dev, priv); >> - >> return 0; >> } >> >> >> -- >> To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in >> the body of a message to majordomo@vger.kernel.org >> More majordomo info at http://vger.kernel.org/majordomo-info.html >> >> > -- > To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > ^ permalink raw reply [flat|nested] 18+ messages in thread
[parent not found: <1331402199-8000-1-git-send-email-Julia.Lawall-L2FTfq7BK8M@public.gmane.org>]
* Re: [PATCH] drivers/ata/pata_mpc52xx.c: add missing kfree [not found] ` <1331402199-8000-1-git-send-email-Julia.Lawall-L2FTfq7BK8M@public.gmane.org> 2012-03-11 10:04 ` Sergei Shtylyov @ 2012-03-11 10:04 ` Sergei Shtylyov 0 siblings, 0 replies; 18+ messages in thread From: Sergei Shtylyov @ 2012-03-11 10:04 UTC (permalink / raw) To: Julia Lawall Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, kernel-janitors-u79uwXL29TY76Z2rM5mHXA, linux-kernel-u79uwXL29TY76Z2rM5mHXA, Rob Herring, linux-ide-u79uwXL29TY76Z2rM5mHXA, Jeff Garzik Hello. On 10-03-2012 21:56, Julia Lawall wrote: > From: Julia Lawall<Julia.Lawall@lip6.fr> > There is no need to call the devm cleanup functions on failure of a probe > or remove function. This doesn't correlate with the subject. > Signed-off-by: Julia Lawall<Julia.Lawall@lip6.fr> WBR, Sergei ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH] drivers/ata/pata_mpc52xx.c: add missing kfree @ 2012-03-11 10:04 ` Sergei Shtylyov 0 siblings, 0 replies; 18+ messages in thread From: Sergei Shtylyov @ 2012-03-11 10:04 UTC (permalink / raw) To: Julia Lawall Cc: Jeff Garzik, kernel-janitors, Grant Likely, Rob Herring, linux-ide, linux-kernel, devicetree-discuss Hello. On 10-03-2012 21:56, Julia Lawall wrote: > From: Julia Lawall<Julia.Lawall@lip6.fr> > There is no need to call the devm cleanup functions on failure of a probe > or remove function. This doesn't correlate with the subject. > Signed-off-by: Julia Lawall<Julia.Lawall@lip6.fr> WBR, Sergei ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH] drivers/ata/pata_mpc52xx.c: add missing kfree @ 2012-03-11 10:04 ` Sergei Shtylyov 0 siblings, 0 replies; 18+ messages in thread From: Sergei Shtylyov @ 2012-03-11 10:04 UTC (permalink / raw) To: Julia Lawall Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, kernel-janitors-u79uwXL29TY76Z2rM5mHXA, linux-kernel-u79uwXL29TY76Z2rM5mHXA, Rob Herring, linux-ide-u79uwXL29TY76Z2rM5mHXA, Jeff Garzik Hello. On 10-03-2012 21:56, Julia Lawall wrote: > From: Julia Lawall<Julia.Lawall-L2FTfq7BK8M@public.gmane.org> > There is no need to call the devm cleanup functions on failure of a probe > or remove function. This doesn't correlate with the subject. > Signed-off-by: Julia Lawall<Julia.Lawall-L2FTfq7BK8M@public.gmane.org> WBR, Sergei ^ permalink raw reply [flat|nested] 18+ messages in thread
end of thread, other threads:[~2012-03-11 10:06 UTC | newest]
Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-10 17:56 [PATCH] drivers/ata/pata_mpc52xx.c: add missing kfree Julia Lawall
2012-03-10 17:56 ` Julia Lawall
2012-03-10 18:13 ` Wolfram Sang
2012-03-10 18:13 ` Wolfram Sang
2012-03-10 18:32 ` Joe Perches
2012-03-10 18:32 ` Joe Perches
2012-03-10 18:44 ` Wolfram Sang
2012-03-10 18:44 ` Wolfram Sang
2012-03-10 18:44 ` Wolfram Sang
2012-03-10 19:22 ` Joe Perches
2012-03-10 19:22 ` Joe Perches
2012-03-10 18:32 ` walter harms
2012-03-10 18:32 ` walter harms
2012-03-10 21:50 ` Julia Lawall
2012-03-10 21:50 ` Julia Lawall
[not found] ` <1331402199-8000-1-git-send-email-Julia.Lawall-L2FTfq7BK8M@public.gmane.org>
2012-03-11 10:04 ` Sergei Shtylyov
2012-03-11 10:04 ` Sergei Shtylyov
2012-03-11 10:04 ` Sergei Shtylyov
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.