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
52 kcov_remote_start(kcov_remote_handle(KCOV_SUBSYSTEM_USB, id));52 kcov_remote_start(kcov_remote_handle(KCOV_SUBSYSTEM_USB, id));
53}53}
54 54
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
62static inline void kcov_remote_start_usb_softirq(u64 id)
63{
64 if (in_serving_softirq())
65 kcov_remote_start_usb(id);
66}
67
68static inline void kcov_remote_stop_softirq(void)
69{
70 if (in_serving_softirq())
71 kcov_remote_stop();
72}
73
55#else74#else
56 75
57static inline void kcov_task_init(struct task_struct *t) {}76static inline void kcov_task_init(struct task_struct *t) {}
@@ -66,6 +85,8 @@ static inline u64 kcov_common_handle(void) · 8 unmodified lines
66}85}
67static inline void kcov_remote_start_common(u64 id) {}86static inline void kcov_remote_start_common(u64 id) {}
68static inline void kcov_remote_start_usb(u64 id) {}87static inline void kcov_remote_start_usb(u64 id) {}
88static inline void kcov_remote_start_usb_softirq(u64 id) {}
89static inline void kcov_remote_stop_softirq(void) {}
69 90
70#endif /* CONFIG_KCOV */91#endif /* CONFIG_KCOV */
71#endif /* _LINUX_KCOV_H */92#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