1. 23 8月, 2013 1 次提交
  2. 05 7月, 2013 1 次提交
  3. 13 1月, 2013 1 次提交
  4. 08 1月, 2013 1 次提交
  5. 22 8月, 2012 1 次提交
    • J
      drivers/dma/amba-pl08x.c: fix error return code · 983d7beb
      Julia Lawall 提交于
      Convert a 0 error return code to a negative one, as returned elsewhere in the
      function.
      
      A simplified version of the semantic match that finds this problem is as
      follows: (http://coccinelle.lip6.fr/)
      
      // <smpl>
      @@
      identifier ret;
      expression e,e1,e2,e3,e4,x;
      @@
      
      (
      if (\(ret != 0\|ret < 0\) || ...) { ... return ...; }
      |
      ret = 0
      )
      ... when != ret = e1
      *x = \(kmalloc\|kzalloc\|kcalloc\|devm_kzalloc\|ioremap\|ioremap_nocache\|devm_ioremap\|devm_ioremap_nocache\)(...);
      ... when != x = e2
          when != ret = e3
      *if (x == NULL || ...)
      {
        ... when != ret = e4
      *  return ret;
      }
      // </smpl>
      Signed-off-by: NJulia Lawall <Julia.Lawall@lip6.fr>
      Signed-off-by: NVinod Koul <vinod.koul@linux.intel.com>
      983d7beb
  6. 01 7月, 2012 31 次提交
  7. 11 5月, 2012 2 次提交
    • L
      dmaengine: Use dma_sg_len(sg) instead of sg->length · fdaf9c4b
      Lars-Peter Clausen 提交于
      sg->length may or may not contain the length of the dma region to transfer,
      depending on the architecture - dma_sg_len(sg) always will though. For the
      architectures which use the drivers modified by this patch it probably is the
      case that sg->length contains the dma transfer length. But to be consistent and
      future proof change them to use dma_sg_len.
      
      To quote Russel King:
      	sg->length is meaningless to something performing DMA.
      
      	In cases where sg_dma_len(sg) and sg->length are the same storage, then
      	there's no problem. But scatterlists _can_ (and one some architectures) do
      	split them - especially when you have an IOMMU which can allow you to
      	combine a scatterlist into fewer entries.
      
      	So, anything using sg->length for the size of a scatterlist's DMA transfer
      	_after_ a call to dma_map_sg() is almost certainly buggy.
      
      The patch has been generated using the following coccinelle patch:
      <smpl>
      @@
      struct scatterlist *sg;
      expression X;
      @@
      -sg[X].length
      +sg_dma_len(&sg[X])
      @@
      struct scatterlist *sg;
      @@
      -sg->length
      +sg_dma_len(sg)
      </smpl>
      Signed-off-by: NLars-Peter Clausen <lars@metafoo.de>
      Acked-by: NLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: NVinod Koul <vinod.koul@linux.intel.com>
      fdaf9c4b
    • L
      dmaengine: Use sg_dma_address instead of sg_phys · cbb796cc
      Lars-Peter Clausen 提交于
      dmaengine drivers should always use sg_dma_address instead of sg_phys to get the
      addresses for the transfer from a sg element.
      
      To quote Russel King:
      	sg_phys(sg) of course has nothing to do with DMA addresses. It's the
      	physical address _to the CPU_ of the memory associated with the scatterlist
      	entry. That may, or may not have the same value for the DMA engine,
      	particularly if IOMMUs are involved.
      
      	And if these drivers are used on ARM, they must be fixed, sooner rather
      	than later.  There's patches in the works which will mean we will end up
      	with IOMMU support in the DMA mapping later, which means everything I've
      	said above will become reality.
      
      The patch has been generated using the following coccinelle patch:
      <smpl>
      @@
      struct scatterlist *sg;
      @@
      -sg_phys(sg)
      +sg_dma_address(sg)
      </smpl>
      Signed-off-by: NLars-Peter Clausen <lars@metafoo.de>
      Acked-by: NLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: NVinod Koul <vinod.koul@linux.intel.com>
      cbb796cc
  8. 25 4月, 2012 2 次提交