summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorHeiner Kallweit <hkallweit1@gmail.com>2025-04-11 08:59:09 +0300
committerDamien Le Moal <dlemoal@kernel.org>2025-04-21 02:52:48 +0300
commite8866e26f5e8ec551eec73dca1c30d458f9dca86 (patch)
treef1972e565fa9b5bf027ae168d3b4f317713d6b07 /include/linux
parent9d7a0577c9db35c4cc52db90bc415ea248446472 (diff)
downloadlinux-e8866e26f5e8ec551eec73dca1c30d458f9dca86.tar.xz
ata: libata-core: Simplify ata_print_version_once
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>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/libata.h17
1 files changed, 5 insertions, 12 deletions
diff --git a/include/linux/libata.h b/include/linux/libata.h
index e5695998acb0..98affa1d9136 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -41,17 +41,6 @@
*/
#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