2020-03-24 11:44:22 +08:00
|
|
|
From cfe3d10d37e44be4bb94cb715dbe6fde9e8a60ff Mon Sep 17 00:00:00 2001
|
|
|
|
|
From: Pyxisha <xiashuang1@huawei.com>
|
|
|
|
|
Date: Mon, 15 Jul 2019 10:44:50 +0800
|
2020-07-03 17:09:39 +08:00
|
|
|
Subject: [PATCH 04/53] some variable and judgement are unnecessary in
|
2020-03-24 11:44:22 +08:00
|
|
|
activate_mappings
|
|
|
|
|
|
|
|
|
|
sign_off_by Shuang Xia <xiashuang1@huawei.com>
|
|
|
|
|
---
|
|
|
|
|
activate.c | 15 ++++-----------
|
|
|
|
|
1 file changed, 4 insertions(+), 11 deletions(-)
|
|
|
|
|
|
|
|
|
|
diff --git a/activate.c b/activate.c
|
|
|
|
|
index 8fd3dd0..8fd9bde 100644
|
|
|
|
|
--- a/activate.c
|
|
|
|
|
+++ b/activate.c
|
|
|
|
|
@@ -60,8 +60,6 @@ static void activate_mapping(struct irq_info *info, void *data __attribute__((un
|
|
|
|
|
{
|
|
|
|
|
char buf[PATH_MAX];
|
|
|
|
|
FILE *file;
|
|
|
|
|
- cpumask_t applied_mask;
|
|
|
|
|
- int valid_mask = 0;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* only activate mappings for irqs that have moved
|
|
|
|
|
@@ -69,18 +67,13 @@ static void activate_mapping(struct irq_info *info, void *data __attribute__((un
|
|
|
|
|
if (!info->moved)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
- if (info->assigned_obj) {
|
|
|
|
|
- applied_mask = info->assigned_obj->mask;
|
|
|
|
|
- valid_mask = 1;
|
|
|
|
|
- }
|
|
|
|
|
+ if (!info->assigned_obj)
|
|
|
|
|
+ return;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Don't activate anything for which we have an invalid mask
|
|
|
|
|
*/
|
|
|
|
|
- if (!valid_mask || check_affinity(info, applied_mask))
|
|
|
|
|
- return;
|
|
|
|
|
-
|
|
|
|
|
- if (!info->assigned_obj)
|
|
|
|
|
+ if (check_affinity(info, info->assigned_obj->mask))
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
sprintf(buf, "/proc/irq/%i/smp_affinity", info->irq);
|
|
|
|
|
@@ -88,7 +81,7 @@ static void activate_mapping(struct irq_info *info, void *data __attribute__((un
|
|
|
|
|
if (!file)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
- cpumask_scnprintf(buf, PATH_MAX, applied_mask);
|
|
|
|
|
+ cpumask_scnprintf(buf, PATH_MAX, info->assigned_obj->mask);
|
|
|
|
|
fprintf(file, "%s", buf);
|
|
|
|
|
fclose(file);
|
|
|
|
|
info->moved = 0; /*migration is done*/
|
|
|
|
|
--
|
2020-07-03 17:09:39 +08:00
|
|
|
2.23.0
|
2020-03-24 11:44:22 +08:00
|
|
|
|