From 4f17e2abd6d313b53aa2cea6ac49de72ea7fe40a Mon Sep 17 00:00:00 2001 From: "Luis R. Rodriguez" Date: Fri, 30 Jan 2009 08:10:44 -0800 Subject: [PATCH] Adds WARN_ONCE Signed-off-by: Luis R. Rodriguez --- compat/compat.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/compat/compat.h b/compat/compat.h index 1165f2837ba2..7e4b9b136a2a 100644 --- a/compat/compat.h +++ b/compat/compat.h @@ -14,6 +14,18 @@ #include +#ifndef WARN_ONCE +#define WARN_ONCE(condition, format...) ({ \ + static int __warned; \ + int __ret_warn_once = !!(condition); \ + \ + if (unlikely(__ret_warn_once)) \ + if (WARN(!__warned, format)) \ + __warned = 1; \ + unlikely(__ret_warn_once); \ +}) +#endif /* From include/asm-generic/bug.h */ + void __iomem *pci_ioremap_bar(struct pci_dev *pdev, int bar); #endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,28)) */ -- 2.30.2