Skip to content

Commit e8866e2

Browse files
hkallweitdamien-lemoal
authored andcommitted
ata: libata-core: Simplify ata_print_version_once
Use dev_dbg_once() instead of open-coding the once functionality. Signed-off-by: Heiner Kallweit <[email protected]> Signed-off-by: Damien Le Moal <[email protected]>
1 parent 9d7a057 commit e8866e2

File tree

2 files changed

+5
-18
lines changed

2 files changed

+5
-18
lines changed

drivers/ata/libata-core.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6682,12 +6682,6 @@ const struct ata_port_info ata_dummy_port_info = {
66826682
};
66836683
EXPORT_SYMBOL_GPL(ata_dummy_port_info);
66846684

6685-
void ata_print_version(const struct device *dev, const char *version)
6686-
{
6687-
dev_printk(KERN_DEBUG, dev, "version %s\n", version);
6688-
}
6689-
EXPORT_SYMBOL(ata_print_version);
6690-
66916685
EXPORT_TRACEPOINT_SYMBOL_GPL(ata_tf_load);
66926686
EXPORT_TRACEPOINT_SYMBOL_GPL(ata_exec_command);
66936687
EXPORT_TRACEPOINT_SYMBOL_GPL(ata_bmdma_setup);

include/linux/libata.h

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -41,17 +41,6 @@
4141
*/
4242
#undef ATA_IRQ_TRAP /* define to ack screaming irqs */
4343

44-
45-
#define ata_print_version_once(dev, version) \
46-
({ \
47-
static bool __print_once; \
48-
\
49-
if (!__print_once) { \
50-
__print_once = true; \
51-
ata_print_version(dev, version); \
52-
} \
53-
})
54-
5544
/* defines only for the constants which don't work well as enums */
5645
#define ATA_TAG_POISON 0xfafbfcfdU
5746

@@ -1593,7 +1582,11 @@ do { \
15931582
#define ata_dev_dbg(dev, fmt, ...) \
15941583
ata_dev_printk(debug, dev, fmt, ##__VA_ARGS__)
15951584

1596-
void ata_print_version(const struct device *dev, const char *version);
1585+
static inline void ata_print_version_once(const struct device *dev,
1586+
const char *version)
1587+
{
1588+
dev_dbg_once(dev, "version %s\n", version);
1589+
}
15971590

15981591
/*
15991592
* ata_eh_info helpers

0 commit comments

Comments
 (0)