]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ata: libata-core: Simplify ata_print_version_once
authorHeiner Kallweit <hkallweit1@gmail.com>
Fri, 11 Apr 2025 05:59:09 +0000 (07:59 +0200)
committerDamien Le Moal <dlemoal@kernel.org>
Sun, 20 Apr 2025 23:52:48 +0000 (08:52 +0900)
Use dev_dbg_once() instead of open-coding the once functionality.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
drivers/ata/libata-core.c
include/linux/libata.h

index 773799cfd44308967f46f2c1efb176d443cba624..79b20da0a256eeeaa73586bb85456fba504b8090 100644 (file)
@@ -6682,12 +6682,6 @@ const struct ata_port_info ata_dummy_port_info = {
 };
 EXPORT_SYMBOL_GPL(ata_dummy_port_info);
 
-void ata_print_version(const struct device *dev, const char *version)
-{
-       dev_printk(KERN_DEBUG, dev, "version %s\n", version);
-}
-EXPORT_SYMBOL(ata_print_version);
-
 EXPORT_TRACEPOINT_SYMBOL_GPL(ata_tf_load);
 EXPORT_TRACEPOINT_SYMBOL_GPL(ata_exec_command);
 EXPORT_TRACEPOINT_SYMBOL_GPL(ata_bmdma_setup);
index e5695998acb027f87b71487496e12e551c8061a2..98affa1d9136d276d404bf2dd4e1b0fad0cf8f8a 100644 (file)
  */
 #undef ATA_IRQ_TRAP            /* define to ack screaming irqs */
 
-
-#define ata_print_version_once(dev, version)                   \
-({                                                             \
-       static bool __print_once;                               \
-                                                               \
-       if (!__print_once) {                                    \
-               __print_once = true;                            \
-               ata_print_version(dev, version);                \
-       }                                                       \
-})
-
 /* defines only for the constants which don't work well as enums */
 #define ATA_TAG_POISON         0xfafbfcfdU
 
@@ -1593,7 +1582,11 @@ do {                                                             \
 #define ata_dev_dbg(dev, fmt, ...)                             \
        ata_dev_printk(debug, dev, fmt, ##__VA_ARGS__)
 
-void ata_print_version(const struct device *dev, const char *version);
+static inline void ata_print_version_once(const struct device *dev,
+                                         const char *version)
+{
+       dev_dbg_once(dev, "version %s\n", version);
+}
 
 /*
  * ata_eh_info helpers