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>
This commit is contained in:
Heiner Kallweit
2025-04-11 07:59:09 +02:00
committed by Damien Le Moal
parent 9d7a0577c9
commit e8866e26f5
2 changed files with 5 additions and 18 deletions

View 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);

View File

@@ -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