[RFC,v3,01/45] powerpc: dma-mapping: Don't hard-code the value of DMA_ATTR_WEAK_ORDERING

Submitted by Krzysztof Kozlowski on June 2, 2016, 3:39 p.m.

Details

Message ID 1464881987-13203-2-git-send-email-k.kozlowski@samsung.com
State New
Headers show
Series "dma-mapping: Use unsigned long for dma_attrs" ( rev: 1 ) in Nouveau

Not browsing as part of any series.

Commit Message

Krzysztof Kozlowski June 2, 2016, 3:39 p.m.
Hard-coded value of DMA_ATTR_WEAK_ORDERING is then compared with the
symbol.  This will stop matching if the value of symbol is changed (when
switching DMA attributes to unsigned long).

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
---
 arch/powerpc/platforms/cell/iommu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/arch/powerpc/platforms/cell/iommu.c b/arch/powerpc/platforms/cell/iommu.c
index 14a582b21274..0c2794d2b6c0 100644
--- a/arch/powerpc/platforms/cell/iommu.c
+++ b/arch/powerpc/platforms/cell/iommu.c
@@ -1162,7 +1162,7 @@  static int __init setup_iommu_fixed(char *str)
 	pciep = of_find_node_by_type(NULL, "pcie-endpoint");
 
 	if (strcmp(str, "weak") == 0 || (pciep && strcmp(str, "strong") != 0))
-		iommu_fixed_is_weak = 1;
+		iommu_fixed_is_weak = DMA_ATTR_WEAK_ORDERING;
 
 	of_node_put(pciep);
 

Comments

On 06/02/2016 05:39 PM, Krzysztof Kozlowski wrote:
> Hard-coded value of DMA_ATTR_WEAK_ORDERING is then compared with the
> symbol.  This will stop matching if the value of symbol is changed (when
> switching DMA attributes to unsigned long).
> 
> Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
> ---
>  arch/powerpc/platforms/cell/iommu.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/powerpc/platforms/cell/iommu.c b/arch/powerpc/platforms/cell/iommu.c
> index 14a582b21274..0c2794d2b6c0 100644
> --- a/arch/powerpc/platforms/cell/iommu.c
> +++ b/arch/powerpc/platforms/cell/iommu.c
> @@ -1162,7 +1162,7 @@ static int __init setup_iommu_fixed(char *str)
>  	pciep = of_find_node_by_type(NULL, "pcie-endpoint");
>  
>  	if (strcmp(str, "weak") == 0 || (pciep && strcmp(str, "strong") != 0))
> -		iommu_fixed_is_weak = 1;
> +		iommu_fixed_is_weak = DMA_ATTR_WEAK_ORDERING;

After some more thoughts given to this, I think my fix is not correct.
The 'iommu_fixed_is_weak' stores the bool and it is used to compare with
result of test_bit().

Please ignore this patch.

Best regards,
Krzysztof