Skip to content

Commit 632b746

Browse files
anarsoulrafaeljw
authored andcommitted
ACPICA: Implement ACPI_WARNING_ONCE and ACPI_ERROR_ONCE
ACPICA commit 2ad4e6e7c4118f4cdfcad321c930b836cec77406 In some cases it is not practical nor useful to nag user about some firmware errors that they cannot fix. Add a macro that will print a warning or error only once to be used in these cases. Link: acpica/acpica@2ad4e6e7 Signed-off-by: Vasily Khoruzhick <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent cf94e10 commit 632b746

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

include/acpi/acoutput.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@
193193
*/
194194
#ifndef ACPI_NO_ERROR_MESSAGES
195195
#define AE_INFO _acpi_module_name, __LINE__
196+
#define ACPI_ONCE(_fn, _plist) { static char _done; if (!_done) { _done = 1; _fn _plist; } }
196197

197198
/*
198199
* Error reporting. Callers module and line number are inserted by AE_INFO,
@@ -201,8 +202,10 @@
201202
*/
202203
#define ACPI_INFO(plist) acpi_info plist
203204
#define ACPI_WARNING(plist) acpi_warning plist
205+
#define ACPI_WARNING_ONCE(plist) ACPI_ONCE(acpi_warning, plist)
204206
#define ACPI_EXCEPTION(plist) acpi_exception plist
205207
#define ACPI_ERROR(plist) acpi_error plist
208+
#define ACPI_ERROR_ONCE(plist) ACPI_ONCE(acpi_error, plist)
206209
#define ACPI_BIOS_WARNING(plist) acpi_bios_warning plist
207210
#define ACPI_BIOS_EXCEPTION(plist) acpi_bios_exception plist
208211
#define ACPI_BIOS_ERROR(plist) acpi_bios_error plist
@@ -214,8 +217,10 @@
214217

215218
#define ACPI_INFO(plist)
216219
#define ACPI_WARNING(plist)
220+
#define ACPI_WARNING_ONCE(plist)
217221
#define ACPI_EXCEPTION(plist)
218222
#define ACPI_ERROR(plist)
223+
#define ACPI_ERROR_ONCE(plist)
219224
#define ACPI_BIOS_WARNING(plist)
220225
#define ACPI_BIOS_EXCEPTION(plist)
221226
#define ACPI_BIOS_ERROR(plist)

0 commit comments

Comments
 (0)