[PATCH v2 11/11] kcov: use enum kcov_mode in kcov_mode_enabled()

From: Alexander Potapenko
Date: Thu Jun 26 2025 - 09:45:04 EST


Replace the remaining declarations of `unsigned int mode` with
`enum kcov_mode mode`. No functional change.

Signed-off-by: Alexander Potapenko <glider@xxxxxxxxxx>
---
kernel/kcov.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/kernel/kcov.c b/kernel/kcov.c
index 1693004d89764..62ce4c65f79fa 100644
--- a/kernel/kcov.c
+++ b/kernel/kcov.c
@@ -951,7 +951,7 @@ static const struct file_operations kcov_fops = {
* collecting coverage and copies all collected coverage into the kcov area.
*/

-static inline bool kcov_mode_enabled(unsigned int mode)
+static inline bool kcov_mode_enabled(enum kcov_mode mode)
{
return (mode & ~KCOV_IN_CTXSW) != KCOV_MODE_DISABLED;
}
@@ -959,7 +959,7 @@ static inline bool kcov_mode_enabled(unsigned int mode)
static void kcov_remote_softirq_start(struct task_struct *t)
{
struct kcov_percpu_data *data = this_cpu_ptr(&kcov_percpu_data);
- unsigned int mode;
+ enum kcov_mode mode;

mode = READ_ONCE(t->kcov_mode);
barrier();
@@ -1135,7 +1135,7 @@ void kcov_remote_stop(void)
{
struct task_struct *t = current;
struct kcov *kcov;
- unsigned int mode;
+ enum kcov_mode mode;
void *area, *trace;
unsigned int size, trace_size;
int sequence;
--
2.50.0.727.gbf7dc18ff4-goog