]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/blobdiff - include/linux/thread_info.h
Merge remote-tracking branches 'regulator/topic/of', 'regulator/topic/pv88080', ...
[mirror_ubuntu-hirsute-kernel.git] / include / linux / thread_info.h
index cbd8990e2e77e6ffa49f45611eb6710980fddd23..2b5b10eed74ff52fc5b11fe911be7d84b08eda77 100644 (file)
@@ -118,10 +118,11 @@ static inline int arch_within_stack_frames(const void * const stack,
 extern void __check_object_size(const void *ptr, unsigned long n,
                                        bool to_user);
 
-static inline void check_object_size(const void *ptr, unsigned long n,
-                                    bool to_user)
+static __always_inline void check_object_size(const void *ptr, unsigned long n,
+                                             bool to_user)
 {
-       __check_object_size(ptr, n, to_user);
+       if (!__builtin_constant_p(n))
+               __check_object_size(ptr, n, to_user);
 }
 #else
 static inline void check_object_size(const void *ptr, unsigned long n,