Merge tag 'compiler-attributes-for-linus-v5.11' of git://github.com/ojeda/linux
authorLinus Torvalds <torvalds@linux-foundation.org>
Mon, 4 Jan 2021 18:47:38 +0000 (10:47 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 4 Jan 2021 18:47:38 +0000 (10:47 -0800)
Pull ENABLE_MUST_CHECK removal from Miguel Ojeda:
 "Remove CONFIG_ENABLE_MUST_CHECK (Masahiro Yamada)"

Note that this removes the config option by making the must-check
unconditional, not by removing must check itself.

* tag 'compiler-attributes-for-linus-v5.11' of git://github.com/ojeda/linux:
  Compiler Attributes: remove CONFIG_ENABLE_MUST_CHECK

1  2 
include/linux/compiler_types.h
lib/Kconfig.debug

@@@ -64,17 -64,6 +64,17 @@@ static inline void __chk_io_ptr(const v
  /* Attributes */
  #include <linux/compiler_attributes.h>
  
 +/* Builtins */
 +
 +/*
 + * __has_builtin is supported on gcc >= 10, clang >= 3 and icc >= 21.
 + * In the meantime, to support gcc < 10, we implement __has_builtin
 + * by hand.
 + */
 +#ifndef __has_builtin
 +#define __has_builtin(x) (0)
 +#endif
 +
  /* Compiler specific macros. */
  #ifdef __clang__
  #include <linux/compiler-clang.h>
@@@ -121,12 -110,6 +121,6 @@@ struct ftrace_likely_data 
        unsigned long                   constant;
  };
  
- #ifdef CONFIG_ENABLE_MUST_CHECK
- #define __must_check          __attribute__((__warn_unused_result__))
- #else
- #define __must_check
- #endif
  #if defined(CC_USING_HOTPATCH)
  #define notrace                       __attribute__((hotpatch(0, 0)))
  #elif defined(CC_USING_PATCHABLE_FUNCTION_ENTRY)
diff --combined lib/Kconfig.debug
@@@ -274,15 -274,6 +274,15 @@@ config DEBUG_INFO_BT
          Turning this on expects presence of pahole tool, which will convert
          DWARF type info into equivalent deduplicated BTF type info.
  
 +config PAHOLE_HAS_SPLIT_BTF
 +      def_bool $(success, test `$(PAHOLE) --version | sed -E 's/v([0-9]+)\.([0-9]+)/\1\2/'` -ge "119")
 +
 +config DEBUG_INFO_BTF_MODULES
 +      def_bool y
 +      depends on DEBUG_INFO_BTF && MODULES && PAHOLE_HAS_SPLIT_BTF
 +      help
 +        Generate compact split BTF type information for kernel modules.
 +
  config GDB_SCRIPTS
        bool "Provide GDB scripts for kernel debugging"
        help
  
  endif # DEBUG_INFO
  
- config ENABLE_MUST_CHECK
-       bool "Enable __must_check logic"
-       default y
-       help
-         Enable the __must_check logic in the kernel build.  Disable this to
-         suppress the "warning: ignoring return value of 'foo', declared with
-         attribute warn_unused_result" messages.
  config FRAME_WARN
        int "Warn for stack frames larger than"
        range 0 8192
@@@ -858,31 -841,9 +850,31 @@@ config DEBUG_PER_CPU_MAP
  
          Say N if unsure.
  
 +config DEBUG_KMAP_LOCAL
 +      bool "Debug kmap_local temporary mappings"
 +      depends on DEBUG_KERNEL && KMAP_LOCAL
 +      help
 +        This option enables additional error checking for the kmap_local
 +        infrastructure.  Disable for production use.
 +
 +config ARCH_SUPPORTS_KMAP_LOCAL_FORCE_MAP
 +      bool
 +
 +config DEBUG_KMAP_LOCAL_FORCE_MAP
 +      bool "Enforce kmap_local temporary mappings"
 +      depends on DEBUG_KERNEL && ARCH_SUPPORTS_KMAP_LOCAL_FORCE_MAP
 +      select KMAP_LOCAL
 +      select DEBUG_KMAP_LOCAL
 +      help
 +        This option enforces temporary mappings through the kmap_local
 +        mechanism for non-highmem pages and on non-highmem systems.
 +        Disable this for production systems!
 +
  config DEBUG_HIGHMEM
        bool "Highmem debugging"
        depends on DEBUG_KERNEL && HIGHMEM
 +      select DEBUG_KMAP_LOCAL_FORCE_MAP if ARCH_SUPPORTS_KMAP_LOCAL_FORCE_MAP
 +      select DEBUG_KMAP_LOCAL
        help
          This option enables additional error checking for high memory
          systems.  Disable for production systems.
@@@ -1676,7 -1637,7 +1668,7 @@@ config ARCH_HAS_DEVMEM_IS_ALLOWE
  config STRICT_DEVMEM
        bool "Filter access to /dev/mem"
        depends on MMU && DEVMEM
 -      depends on ARCH_HAS_DEVMEM_IS_ALLOWED
 +      depends on ARCH_HAS_DEVMEM_IS_ALLOWED || GENERIC_LIB_DEVMEM_IS_ALLOWED
        default y if PPC || X86 || ARM64
        help
          If this option is disabled, you allow userspace (root) access to all
@@@ -2257,17 -2218,6 +2249,17 @@@ config BITFIELD_KUNI
  
          If unsure, say N.
  
 +config RESOURCE_KUNIT_TEST
 +      tristate "KUnit test for resource API"
 +      depends on KUNIT
 +      help
 +        This builds the resource API unit test.
 +        Tests the logic of API provided by resource.c and ioport.h.
 +        For more information on KUnit and unit tests in general please refer
 +        to the KUnit documentation in Documentation/dev-tools/kunit/.
 +
 +        If unsure, say N.
 +
  config SYSCTL_KUNIT_TEST
        tristate "KUnit test for sysctl" if !KUNIT_ALL_TESTS
        depends on KUNIT
@@@ -2307,17 -2257,6 +2299,17 @@@ config LINEAR_RANGES_TES
          This builds the linear_ranges unit test, which runs on boot.
          Tests the linear_ranges logic correctness.
          For more information on KUnit and unit tests in general please refer
 +        to the KUnit documentation in Documentation/dev-tools/kunit/.
 +
 +        If unsure, say N.
 +
 +config CMDLINE_KUNIT_TEST
 +      tristate "KUnit test for cmdline API"
 +      depends on KUNIT
 +      help
 +        This builds the cmdline API unit test.
 +        Tests the logic of API provided by cmdline.c.
 +        For more information on KUnit and unit tests in general please refer
          to the KUnit documentation in Documentation/dev-tools/kunit/.
  
          If unsure, say N.