diff mbox series

kcov: Remove kcov include from sched.h and move it to its users.

Message ID 20210218173124.iy5iyqv3a4oia4vv@linutronix.de (mailing list archive)
State Not Applicable
Delegated to: Netdev Maintainers
Headers show
Series kcov: Remove kcov include from sched.h and move it to its users. | expand

Checks

Context Check Description
netdev/cover_letter success Link
netdev/fixes_present success Link
netdev/patch_count success Link
netdev/tree_selection success Guessed tree name to be net-next
netdev/subject_prefix warning Target tree name not specified in the subject
netdev/cc_maintainers warning 8 maintainers not CCed: jonathan.lemon@gmail.com linux-wireless@vger.kernel.org gnault@redhat.com gregkh@linuxfoundation.org linmiaohe@huawei.com andreyknvl@google.com alobakin@pm.me willemb@google.com
netdev/source_inline success Was 0 now: 0
netdev/verify_signedoff success Link
netdev/module_param success Was 0 now: 0
netdev/build_32bit success Errors and warnings before: 23890 this patch: 23890
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/verify_fixes success Link
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 35 lines checked
netdev/build_allmodconfig_warn success Errors and warnings before: 23685 this patch: 23685
netdev/header_inline success Link
netdev/stable success Stable not CCed

Commit Message

Sebastian Sewior Feb. 18, 2021, 5:31 p.m. UTC
The recent addition of in_serving_softirq() to kconv.h results in
compile failure on PREEMPT_RT because it requires
task_struct::softirq_disable_cnt. This is not available if kconv.h is
included from sched.h.

It is not needed to include kconv.h from sched.h. All but the net/ user
already include the kconv header file.

Move the include of the kconv.h header from sched.h it its users.
Additionally include sched.h from kconv.h to ensure that everything
task_struct related is available.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
 include/linux/kcov.h  | 1 +
 include/linux/sched.h | 1 -
 net/core/skbuff.c     | 1 +
 net/mac80211/iface.c  | 1 +
 net/mac80211/rx.c     | 1 +
 5 files changed, 4 insertions(+), 1 deletion(-)

Comments

Johannes Berg Feb. 18, 2021, 6 p.m. UTC | #1
On Thu, 2021-02-18 at 18:31 +0100, Sebastian Andrzej Siewior wrote:
> The recent addition of in_serving_softirq() to kconv.h results in

You typo'ed "kconv.h" pretty consistently ;-)

But yes, that makes sense.

Acked-by: Johannes Berg <johannes@sipsolutions.net>

johannes
Andrey Konovalov Feb. 18, 2021, 6:52 p.m. UTC | #2
On Thu, Feb 18, 2021 at 6:31 PM Sebastian Andrzej Siewior
<bigeasy@linutronix.de> wrote:
>
> The recent addition of in_serving_softirq() to kconv.h results in
> compile failure on PREEMPT_RT because it requires
> task_struct::softirq_disable_cnt. This is not available if kconv.h is
> included from sched.h.
>
> It is not needed to include kconv.h from sched.h. All but the net/ user
> already include the kconv header file.
>
> Move the include of the kconv.h header from sched.h it its users.
> Additionally include sched.h from kconv.h to ensure that everything
> task_struct related is available.
>
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> ---
>  include/linux/kcov.h  | 1 +
>  include/linux/sched.h | 1 -
>  net/core/skbuff.c     | 1 +
>  net/mac80211/iface.c  | 1 +
>  net/mac80211/rx.c     | 1 +
>  5 files changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/include/linux/kcov.h b/include/linux/kcov.h
> index 4e3037dc12048..55dc338f6bcdd 100644
> --- a/include/linux/kcov.h
> +++ b/include/linux/kcov.h
> @@ -2,6 +2,7 @@
>  #ifndef _LINUX_KCOV_H
>  #define _LINUX_KCOV_H
>
> +#include <linux/sched.h>
>  #include <uapi/linux/kcov.h>
>
>  struct task_struct;
> diff --git a/include/linux/sched.h b/include/linux/sched.h
> index 7337630326751..183e9d90841cb 100644
> --- a/include/linux/sched.h
> +++ b/include/linux/sched.h
> @@ -14,7 +14,6 @@
>  #include <linux/pid.h>
>  #include <linux/sem.h>
>  #include <linux/shm.h>
> -#include <linux/kcov.h>
>  #include <linux/mutex.h>
>  #include <linux/plist.h>
>  #include <linux/hrtimer.h>
> diff --git a/net/core/skbuff.c b/net/core/skbuff.c
> index 785daff48030d..e64d0a2e21c31 100644
> --- a/net/core/skbuff.c
> +++ b/net/core/skbuff.c
> @@ -60,6 +60,7 @@
>  #include <linux/prefetch.h>
>  #include <linux/if_vlan.h>
>  #include <linux/mpls.h>
> +#include <linux/kcov.h>
>
>  #include <net/protocol.h>
>  #include <net/dst.h>
> diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
> index b31417f40bd56..39943c33abbfa 100644
> --- a/net/mac80211/iface.c
> +++ b/net/mac80211/iface.c
> @@ -15,6 +15,7 @@
>  #include <linux/if_arp.h>
>  #include <linux/netdevice.h>
>  #include <linux/rtnetlink.h>
> +#include <linux/kcov.h>
>  #include <net/mac80211.h>
>  #include <net/ieee80211_radiotap.h>
>  #include "ieee80211_i.h"
> diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
> index 972895e9f22dc..3527b17f235a8 100644
> --- a/net/mac80211/rx.c
> +++ b/net/mac80211/rx.c
> @@ -17,6 +17,7 @@
>  #include <linux/etherdevice.h>
>  #include <linux/rcupdate.h>
>  #include <linux/export.h>
> +#include <linux/kcov.h>
>  #include <linux/bitops.h>
>  #include <net/mac80211.h>
>  #include <net/ieee80211_radiotap.h>
> --
> 2.30.0

Acked-by: Andrey Konovalov <andreyknvl@google.com>
diff mbox series

Patch

diff --git a/include/linux/kcov.h b/include/linux/kcov.h
index 4e3037dc12048..55dc338f6bcdd 100644
--- a/include/linux/kcov.h
+++ b/include/linux/kcov.h
@@ -2,6 +2,7 @@ 
 #ifndef _LINUX_KCOV_H
 #define _LINUX_KCOV_H
 
+#include <linux/sched.h>
 #include <uapi/linux/kcov.h>
 
 struct task_struct;
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 7337630326751..183e9d90841cb 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -14,7 +14,6 @@ 
 #include <linux/pid.h>
 #include <linux/sem.h>
 #include <linux/shm.h>
-#include <linux/kcov.h>
 #include <linux/mutex.h>
 #include <linux/plist.h>
 #include <linux/hrtimer.h>
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 785daff48030d..e64d0a2e21c31 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -60,6 +60,7 @@ 
 #include <linux/prefetch.h>
 #include <linux/if_vlan.h>
 #include <linux/mpls.h>
+#include <linux/kcov.h>
 
 #include <net/protocol.h>
 #include <net/dst.h>
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
index b31417f40bd56..39943c33abbfa 100644
--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
@@ -15,6 +15,7 @@ 
 #include <linux/if_arp.h>
 #include <linux/netdevice.h>
 #include <linux/rtnetlink.h>
+#include <linux/kcov.h>
 #include <net/mac80211.h>
 #include <net/ieee80211_radiotap.h>
 #include "ieee80211_i.h"
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index 972895e9f22dc..3527b17f235a8 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -17,6 +17,7 @@ 
 #include <linux/etherdevice.h>
 #include <linux/rcupdate.h>
 #include <linux/export.h>
+#include <linux/kcov.h>
 #include <linux/bitops.h>
 #include <net/mac80211.h>
 #include <net/ieee80211_radiotap.h>