some variable and judgement are unnecessary in activate_mappings
sign_off_by Shuang Xia <xiashuang1@huawei.com>
This commit is contained in:
parent
f7fdebbaa4
commit
cfe3d10d37
15
activate.c
15
activate.c
|
@ -60,8 +60,6 @@ static void activate_mapping(struct irq_info *info, void *data __attribute__((un
|
||||||
{
|
{
|
||||||
char buf[PATH_MAX];
|
char buf[PATH_MAX];
|
||||||
FILE *file;
|
FILE *file;
|
||||||
cpumask_t applied_mask;
|
|
||||||
int valid_mask = 0;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* only activate mappings for irqs that have moved
|
* 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)
|
if (!info->moved)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (info->assigned_obj) {
|
if (!info->assigned_obj)
|
||||||
applied_mask = info->assigned_obj->mask;
|
return;
|
||||||
valid_mask = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Don't activate anything for which we have an invalid mask
|
* Don't activate anything for which we have an invalid mask
|
||||||
*/
|
*/
|
||||||
if (!valid_mask || check_affinity(info, applied_mask))
|
if (check_affinity(info, info->assigned_obj->mask))
|
||||||
return;
|
|
||||||
|
|
||||||
if (!info->assigned_obj)
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
sprintf(buf, "/proc/irq/%i/smp_affinity", info->irq);
|
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)
|
if (!file)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
cpumask_scnprintf(buf, PATH_MAX, applied_mask);
|
cpumask_scnprintf(buf, PATH_MAX, info->assigned_obj->mask);
|
||||||
fprintf(file, "%s", buf);
|
fprintf(file, "%s", buf);
|
||||||
fclose(file);
|
fclose(file);
|
||||||
info->moved = 0; /*migration is done*/
|
info->moved = 0; /*migration is done*/
|
||||||
|
|
Loading…
Reference in a new issue