[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.64.0905021519390.9563@pc-004.diku.dk>
Date: Sat, 2 May 2009 15:20:23 +0200 (CEST)
From: Julia Lawall <julia@...u.dk>
To: joerg.roedel@....com, iommu@...ts.linux-foundation.org,
linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org
Subject: amd_iommu_init.c: possible problem with IVHD_FLAG_HT_TUN_EN
The file arch/x86/kernel/amd_iommu_init.c contains the following code:
(starting at line 586 in a recent linux-next)
h->flags & IVHD_FLAG_HT_TUN_EN ?
iommu_feature_enable(iommu, CONTROL_HT_TUN_EN) :
iommu_feature_disable(iommu, CONTROL_HT_TUN_EN);
h->flags & IVHD_FLAG_PASSPW_EN ?
iommu_feature_enable(iommu, CONTROL_PASSPW_EN) :
iommu_feature_disable(iommu, CONTROL_PASSPW_EN);
h->flags & IVHD_FLAG_RESPASSPW_EN ?
iommu_feature_enable(iommu, CONTROL_RESPASSPW_EN) :
iommu_feature_disable(iommu, CONTROL_RESPASSPW_EN);
h->flags & IVHD_FLAG_ISOC_EN ?
iommu_feature_enable(iommu, CONTROL_ISOC_EN) :
iommu_feature_disable(iommu, CONTROL_ISOC_EN);
The only possible value of IVHD_FLAG_HT_TUN_EN, however, seems to be 0, as
defined in the same file, and thus the first test is never true. Is this
what is intended, or should the test be expressed in another way?
julia
This problem was found using the following semantic match:
(http://www.emn.fr/x-info/coccinelle/)
@r expression@
identifier C;
expression E;
position p;
@@
(
E & C@p && ...
|
E & C@p || ...
)
@s@
identifier r.C;
position p1;
@@
#define C 0
@t@
identifier r.C;
expression E != 0;
@@
#define C E
@script:python depends on s && !t@
p << r.p;
C << r.C;
@@
cocci.print_main("and with 0", p)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists