Commit 4506bf2329cab39d41f027cdccb1cf455de2bf79

Authored by Lv Zheng
Committed by Rafael J. Wysocki
1 parent d21f600b0e

ACPICA: Prevent possible build issues for use of ACPI_PRINTF_LIKE macro

The following build error:
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   CC      arch/x86/kernel/setup.o
 In file included from include/acpi/acpi.h:64:0,
                  from include/linux/iscsi_ibft.h:24,
                  from arch/x86/kernel/setup.c:43:
 include/acpi/acpixf.h:543:1: error: expected ',' or ';' before '{' token
 include/acpi/acpixf.h:540:1: warning: 'acpi_error' declared 'static' but never defined [-Wunused-function]
 make[2]: *** [arch/x86/kernel/setup.o] Error 1
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
can be triggerred by the following stub function (if implemented):
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 static inline void ACPI_INTERNAL_VAR_XFACE
 acpi_error(const char *module_name,
 	   u32 line_number, const char *format, ...) ACPI_PRINTF_LIKE(3)
 {
 }
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This patch changes the position of ACPI_PRINTF_LIKE(x) to follow the
style of __printf(x, x+1) used in Linux to prevent such issues from
happening.  Lv Zheng.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

Showing 1 changed file with 16 additions and 13 deletions Side-by-side Diff

include/acpi/acpixf.h
... ... @@ -530,50 +530,53 @@
530 530 /*
531 531 * Error/Warning output
532 532 */
  533 +ACPI_PRINTF_LIKE(3)
533 534 void ACPI_INTERNAL_VAR_XFACE
534   -acpi_error(const char *module_name,
535   - u32 line_number, const char *format, ...) ACPI_PRINTF_LIKE(3);
  535 +acpi_error(const char *module_name, u32 line_number, const char *format, ...);
536 536  
  537 +ACPI_PRINTF_LIKE(4)
537 538 void ACPI_INTERNAL_VAR_XFACE
538 539 acpi_exception(const char *module_name,
539   - u32 line_number,
540   - acpi_status status, const char *format, ...) ACPI_PRINTF_LIKE(4);
  540 + u32 line_number, acpi_status status, const char *format, ...);
541 541  
  542 +ACPI_PRINTF_LIKE(3)
542 543 void ACPI_INTERNAL_VAR_XFACE
543   -acpi_warning(const char *module_name,
544   - u32 line_number, const char *format, ...) ACPI_PRINTF_LIKE(3);
  544 +acpi_warning(const char *module_name, u32 line_number, const char *format, ...);
545 545  
  546 +ACPI_PRINTF_LIKE(3)
546 547 void ACPI_INTERNAL_VAR_XFACE
547   -acpi_info(const char *module_name,
548   - u32 line_number, const char *format, ...) ACPI_PRINTF_LIKE(3);
  548 +acpi_info(const char *module_name, u32 line_number, const char *format, ...);
549 549  
  550 +ACPI_PRINTF_LIKE(3)
550 551 void ACPI_INTERNAL_VAR_XFACE
551 552 acpi_bios_error(const char *module_name,
552   - u32 line_number, const char *format, ...) ACPI_PRINTF_LIKE(3);
  553 + u32 line_number, const char *format, ...);
553 554  
  555 +ACPI_PRINTF_LIKE(3)
554 556 void ACPI_INTERNAL_VAR_XFACE
555 557 acpi_bios_warning(const char *module_name,
556   - u32 line_number, const char *format, ...) ACPI_PRINTF_LIKE(3);
  558 + u32 line_number, const char *format, ...);
557 559  
558 560 /*
559 561 * Debug output
560 562 */
561 563 #ifdef ACPI_DEBUG_OUTPUT
562 564  
  565 +ACPI_PRINTF_LIKE(6)
563 566 void ACPI_INTERNAL_VAR_XFACE
564 567 acpi_debug_print(u32 requested_debug_level,
565 568 u32 line_number,
566 569 const char *function_name,
567 570 const char *module_name,
568   - u32 component_id, const char *format, ...) ACPI_PRINTF_LIKE(6);
  571 + u32 component_id, const char *format, ...);
569 572  
  573 +ACPI_PRINTF_LIKE(6)
570 574 void ACPI_INTERNAL_VAR_XFACE
571 575 acpi_debug_print_raw(u32 requested_debug_level,
572 576 u32 line_number,
573 577 const char *function_name,
574 578 const char *module_name,
575   - u32 component_id,
576   - const char *format, ...) ACPI_PRINTF_LIKE(6);
  579 + u32 component_id, const char *format, ...);
577 580 #endif
578 581  
579 582 #endif /* __ACXFACE_H__ */