Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

dax: fix missing-prototype warnings

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>
Link: https://lore.kernel.org/r/20230517125532.931157-1-arnd@kernel.org
Signed-off-by: Dan Williams <dan.j.williams@intel.com>

authored by

Arnd Bergmann and committed by
Dan Williams
2d515352 e764f122

+8 -9
-7
drivers/dax/bus.h
··· 49 49 void kill_dev_dax(struct dev_dax *dev_dax); 50 50 bool static_dev_dax(struct dev_dax *dev_dax); 51 51 52 - /* 53 - * While run_dax() is potentially a generic operation that could be 54 - * defined in include/linux/dax.h we don't want to grow any users 55 - * outside of drivers/dax/ 56 - */ 57 - void run_dax(struct dax_device *dax_dev); 58 - 59 52 #define MODULE_ALIAS_DAX_DEVICE(type) \ 60 53 MODULE_ALIAS("dax:t" __stringify(type) "*") 61 54 #define DAX_DEVICE_MODALIAS_FMT "dax:t%d"
+7
drivers/dax/dax-private.h
··· 76 76 } *ranges; 77 77 }; 78 78 79 + /* 80 + * While run_dax() is potentially a generic operation that could be 81 + * defined in include/linux/dax.h we don't want to grow any users 82 + * outside of drivers/dax/ 83 + */ 84 + void run_dax(struct dax_device *dax_dev); 85 + 79 86 static inline struct dev_dax *to_dev_dax(struct device *dev) 80 87 { 81 88 return container_of(dev, struct dev_dax, dev);
+1 -2
drivers/dax/device.c
··· 396 396 kill_dev_dax(dev_dax); 397 397 } 398 398 399 - int dev_dax_probe(struct dev_dax *dev_dax) 399 + static int dev_dax_probe(struct dev_dax *dev_dax) 400 400 { 401 401 struct dax_device *dax_dev = dev_dax->dax_dev; 402 402 struct device *dev = &dev_dax->dev; ··· 471 471 run_dax(dax_dev); 472 472 return devm_add_action_or_reset(dev, dev_dax_kill, dev_dax); 473 473 } 474 - EXPORT_SYMBOL_GPL(dev_dax_probe); 475 474 476 475 static struct dax_device_driver device_dax_driver = { 477 476 .probe = dev_dax_probe,