Skip to contentSkip to conversation

dma: timb_dma: Fix compiler warning

PATCH In review [email protected] 2 participants 3 messages Feb 19, 2013 dmaengine

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dma: timb_dma: Fix compiler warning

From: "Maxin B. John" <[email protected]>

Fix this compiler warning:
warning: 'td_remove' defined but not used [-Wunused-function]

---
 drivers/dma/timb_dma.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/dma/timb_dma.c +1 -1
index 952f823..f709279 100644
@@ -798,7 +798,7 @@ err_release_region:
 
 }
 
-static int td_remove(struct platform_device *pdev)
+static int __exit td_remove(struct platform_device *pdev)
 {
 	struct timb_dma *td = platform_get_drvdata(pdev);
 	struct resource *iomem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
Signature · 1 line
1.7.7
#1 lore raw
Quoted 15 lines · On 02/18/2013 08:59 PM, [email protected] wrote:

From: "Maxin B. John" <[email protected]>

Fix this compiler warning:
warning: 'td_remove' defined but not used [-Wunused-function]

---
 drivers/dma/timb_dma.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/dma/timb_dma.c +0 -0
index 952f823..f709279 100644

drivers/dma/timb_dma.c err_release_region: · line 804

Quoted 8 lines
drivers/dma/timb_dma.c +1 -1
@@ -798,7 +798,7 @@ err_release_region:
 
 }
 
-static int td_remove(struct platform_device *pdev)
+static int __exit td_remove(struct platform_device *pdev)
 {
 
 

While this fixes the warning, it's the wrong fix. The correct fix is to remove the __exit_p. E.g. something like this:

drivers/dma/timb_dma.c +1 -1
@@ -823,7 +823,7 @@ static struct platform_driver td_driver = {
 		.owner  = THIS_MODULE,
 	},
 	.probe	= td_probe,
-	.remove	= __exit_p(td_remove),
+	.remove	= td_remove,
 };
 
 module_platform_driver(td_driver);
#2 lore raw
Quoted 31 lines · Lars-Peter Clausen
Quoted 15 lines · On 02/18/2013 08:59 PM, [email protected] wrote:

From: "Maxin B. John" <[email protected]>

Fix this compiler warning:
warning: 'td_remove' defined but not used [-Wunused-function]

---
 drivers/dma/timb_dma.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/dma/timb_dma.c +0 -0
index 952f823..f709279 100644

drivers/dma/timb_dma.c err_release_region: · line 804

Quoted 8 lines
drivers/dma/timb_dma.c +1 -1
@@ -798,7 +798,7 @@ err_release_region:
 
 }
 
-static int td_remove(struct platform_device *pdev)
+static int __exit td_remove(struct platform_device *pdev)
 {
 
 

While this fixes the warning, it's the wrong fix. The correct fix is to remove the __exit_p. E.g. something like this:

drivers/dma/timb_dma.c static struct platform_driver td_driver = { · line 829

Quoted 8 lines
drivers/dma/timb_dma.c +1 -1
@@ -823,7 +823,7 @@ static struct platform_driver td_driver = {
                .owner  = THIS_MODULE,
        },
        .probe  = td_probe,
-       .remove = __exit_p(td_remove),
+       .remove = td_remove,
 };
 
 module_platform_driver(td_driver);

You are right, my bad. I will modify this and send the revised version soon.

Thanks and Regards,
Maxin