Linux CXL
 help / color / mirror / Atom feed
* [PATCH] dax: fix missing-prototype warnings
@ 2023-05-17 12:55 Arnd Bergmann
  2023-05-19  0:27 ` Dan Williams
  0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2023-05-17 12:55 UTC (permalink / raw)
  To: Dan Williams, Vishal Verma, Dave Jiang, Jane Chu, Dave Hansen
  Cc: Arnd Bergmann, Gregory Price, nvdimm, linux-cxl, linux-kernel

From: Arnd Bergmann <arnd@arndb.de>

dev_dax_probe declaration for this function was removed with the only
caller outside of device.c. Mark it static to avoid a W=1
warning:
drivers/dax/device.c:399:5: error: no previous prototype for 'dev_dax_probe'

Similarly, run_dax() causes a warning, but this one is because the
declaration needs to be included:

drivers/dax/super.c:337:6: error: no previous prototype for 'run_dax'

Fixes: 83762cb5c7c4 ("dax: Kill DEV_DAX_PMEM_COMPAT")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/dax/device.c | 3 +--
 drivers/dax/super.c  | 1 +
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/dax/device.c b/drivers/dax/device.c
index af9930c03c9c..30665a3ff6ea 100644
--- a/drivers/dax/device.c
+++ b/drivers/dax/device.c
@@ -396,7 +396,7 @@ static void dev_dax_kill(void *dev_dax)
 	kill_dev_dax(dev_dax);
 }
 
-int dev_dax_probe(struct dev_dax *dev_dax)
+static int dev_dax_probe(struct dev_dax *dev_dax)
 {
 	struct dax_device *dax_dev = dev_dax->dax_dev;
 	struct device *dev = &dev_dax->dev;
@@ -471,7 +471,6 @@ int dev_dax_probe(struct dev_dax *dev_dax)
 	run_dax(dax_dev);
 	return devm_add_action_or_reset(dev, dev_dax_kill, dev_dax);
 }
-EXPORT_SYMBOL_GPL(dev_dax_probe);
 
 static struct dax_device_driver device_dax_driver = {
 	.probe = dev_dax_probe,
diff --git a/drivers/dax/super.c b/drivers/dax/super.c
index c4c4728a36e4..8c05dae19bfe 100644
--- a/drivers/dax/super.c
+++ b/drivers/dax/super.c
@@ -14,6 +14,7 @@
 #include <linux/dax.h>
 #include <linux/fs.h>
 #include "dax-private.h"
+#include "bus.h"
 
 /**
  * struct dax_device - anchor object for dax services
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* RE: [PATCH] dax: fix missing-prototype warnings
  2023-05-17 12:55 [PATCH] dax: fix missing-prototype warnings Arnd Bergmann
@ 2023-05-19  0:27 ` Dan Williams
  0 siblings, 0 replies; 2+ messages in thread
From: Dan Williams @ 2023-05-19  0:27 UTC (permalink / raw)
  To: Arnd Bergmann, Dan Williams, Vishal Verma, Dave Jiang, Jane Chu,
	Dave Hansen
  Cc: Arnd Bergmann, Gregory Price, nvdimm, linux-cxl, linux-kernel,
	ira.weiny

Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> dev_dax_probe declaration for this function was removed with the only
> caller outside of device.c. Mark it static to avoid a W=1
> warning:
> drivers/dax/device.c:399:5: error: no previous prototype for 'dev_dax_probe'
> 
> Similarly, run_dax() causes a warning, but this one is because the
> declaration needs to be included:
> 
> drivers/dax/super.c:337:6: error: no previous prototype for 'run_dax'
> 
> Fixes: 83762cb5c7c4 ("dax: Kill DEV_DAX_PMEM_COMPAT")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

> ---
>  drivers/dax/device.c | 3 +--
>  drivers/dax/super.c  | 1 +
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/dax/device.c b/drivers/dax/device.c
> index af9930c03c9c..30665a3ff6ea 100644
> --- a/drivers/dax/device.c
> +++ b/drivers/dax/device.c
> @@ -396,7 +396,7 @@ static void dev_dax_kill(void *dev_dax)
>  	kill_dev_dax(dev_dax);
>  }
>  
> -int dev_dax_probe(struct dev_dax *dev_dax)
> +static int dev_dax_probe(struct dev_dax *dev_dax)
>  {
>  	struct dax_device *dax_dev = dev_dax->dax_dev;
>  	struct device *dev = &dev_dax->dev;
> @@ -471,7 +471,6 @@ int dev_dax_probe(struct dev_dax *dev_dax)
>  	run_dax(dax_dev);
>  	return devm_add_action_or_reset(dev, dev_dax_kill, dev_dax);
>  }
> -EXPORT_SYMBOL_GPL(dev_dax_probe);
>  
>  static struct dax_device_driver device_dax_driver = {
>  	.probe = dev_dax_probe,

This hunk looks good.

> diff --git a/drivers/dax/super.c b/drivers/dax/super.c
> index c4c4728a36e4..8c05dae19bfe 100644
> --- a/drivers/dax/super.c
> +++ b/drivers/dax/super.c
> @@ -14,6 +14,7 @@
>  #include <linux/dax.h>
>  #include <linux/fs.h>
>  #include "dax-private.h"
> +#include "bus.h"

This one came up before, and IIRC last time I said lets just move the run_dax()
prototype to dax-private.h.

https://lore.kernel.org/all/YiqF1a9VNiSWI5j0@iweiny-desk3

I can fix that up when applying.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-05-19  0:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-17 12:55 [PATCH] dax: fix missing-prototype warnings Arnd Bergmann
2023-05-19  0:27 ` Dan Williams

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox