History

kcov, usb: hide in_serving_softirq checks in __usb_hcd_giveback_urb

Done opencode in_serving_softirq() checks in in_serving_softirq() to avoid cluttering the code, hide them in kcov helpers instead.

Andrey Konovalov committed 5 years ago

Commit e89eed01 parent 10a05402 files · +24 −5Browse files

Showing the changes to include/linux (1 of 2 files). Show all

Unified · Split

include/linux/kcov.h+21−0
@@ -52,6 +52,25 @@ static inline void kcov_remote_start_usb(u64 id) · 51 unmodified lines
5252 kcov_remote_start(kcov_remote_handle(KCOV_SUBSYSTEM_USB, id));
5353 }
5454
55+/*
56+ * The softirq flavor of kcov_remote_*() functions is introduced as a temporary
57+ * work around for kcov's lack of nested remote coverage sections support in
58+ * task context. Adding suport for nested sections is tracked in:
59+ * https://bugzilla.kernel.org/show_bug.cgi?id=210337
60+ */
61+
62+static inline void kcov_remote_start_usb_softirq(u64 id)
63+{
64+ if (in_serving_softirq())
65+ kcov_remote_start_usb(id);
66+}
67+
68+static inline void kcov_remote_stop_softirq(void)
69+{
70+ if (in_serving_softirq())
71+ kcov_remote_stop();
72+}
73+
5574 #else
5675
5776 static inline void kcov_task_init(struct task_struct *t) {}
@@ -66,6 +85,8 @@ static inline u64 kcov_common_handle(void) · 8 unmodified lines
6685 }
6786 static inline void kcov_remote_start_common(u64 id) {}
6887 static inline void kcov_remote_start_usb(u64 id) {}
88+static inline void kcov_remote_start_usb_softirq(u64 id) {}
89+static inline void kcov_remote_stop_softirq(void) {}
6990
7091 #endif /* CONFIG_KCOV */
7192 #endif /* _LINUX_KCOV_H */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t