mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-04-19 20:59:11 +08:00
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:
committed by
Damien Le Moal
parent
9d7a0577c9
commit
e8866e26f5
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user