#ifndef __ASM_PREEMPT_H #define __ASM_PREEMPT_H #include #define PREEMPT_ENABLED (0) static __always_inline int preempt_count(void) { return READ_ONCE(current_thread_info()->preempt_count); } static __always_inline volatile int *preempt_count_ptr(void) { return ¤t_thread_info()->preempt_count; } static __always_inline void preempt_count_set(int pc) { *preempt_count_ptr() = pc; } /* * must be macros to avoid header recursion hell */ #define init_task_preempt_count(p) do { \ task_thread_info(p)->preempt_count = FORK_PREEMPT_COUNT; \ } while (0) #define init_idle_preempt_count(p, cpu) do { \ task_thread_info(p)->preempt_count = PREEMPT_ENABLED; \ } while (0) static __always_inline void set_preempt_need_resched(void) { } static __always_inline void clear_preempt_need_resched(void) { } static __always_inline bool test_preempt_need_resched(void) { return false; } /* * The various preempt_count add/sub methods */ static __always_inline void __preempt_count_add(int val) { *preempt_count_ptr() += val; } static __always_inline void __preempt_count_sub(int val) { *preempt_count_ptr() -= val; } static __always_inline bool __preempt_count_dec_and_test(void) { /* * Because of load-store architectures cannot do per-cpu atomic * operations; we cannot use PREEMPT_NEED_RESCHED because it might get * lost. */ return !--*preempt_count_ptr() && tif_need_resched(); } /* * Returns true when we need to resched and can (barring IRQ state). */ static __always_inline bool should_resched(int preempt_offset) { return unlikely(preempt_count() == preempt_offset && tif_need_resched()); } #ifdef CONFIG_PREEMPT extern asmlinkage void preempt_schedule(void); #define __preempt_schedule() preempt_schedule() extern asmlinkage void preempt_schedule_notrace(void); #define __preempt_schedule_notrace() preempt_schedule_notrace() #endif /* CONFIG_PREEMPT */ #endif /* __ASM_PREEMPT_H */ private-remove&id=b4cfe3971f6eab542dd7ecc398bfa1aeec889934'>treecommitdiff
path: root/include/crypto/internal/rsa.h
diff options
context:
space:
mode:
authorJack Morgenstein <jackm@dev.mellanox.co.il>2017-01-15 20:15:00 +0200
committerDoug Ledford <dledford@redhat.com>2017-01-27 14:29:04 -0500
commitb4cfe3971f6eab542dd7ecc398bfa1aeec889934 (patch)
treec7ad49d05da0535170c8e7710cd44ae1cecc271f /include/crypto/internal/rsa.h
parent2d4b21e0a2913612274a69a3ba1bfee4cffc6e77 (diff)
RDMA/cma: Fix unknown symbol when CONFIG_IPV6 is not enabled
If IPV6 has not been enabled in the underlying kernel, we must avoid calling IPV6 procedures in rdma_cm.ko. This requires using "IS_ENABLED(CONFIG_IPV6)" in "if" statements surrounding any code which calls external IPV6 procedures. In the instance fixed here, procedure cma_bind_addr() called ipv6_addr_type() -- which resulted in calling external procedure __ipv6_addr_type(). Fixes: 6c26a77124ff ("RDMA/cma: fix IPv6 address resolution") Cc: <stable@vger.kernel.org> # v4.2+ Cc: Spencer Baugh <sbaugh@catern.com> Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il> Reviewed-by: Moni Shoua <monis@mellanox.com> Signed-off-by: Leon Romanovsky <leon@kernel.org> Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'include/crypto/internal/rsa.h')