• Paul Burton's avatar
    MIPS: dma-noncoherent: Remove bogus condition in dma_sync_phys() · d411da06
    Paul Burton authored
    Commit e36863a5 ("MIPS: HIGHMEM DMA on noncoherent MIPS32
    processors") introduced code which:
    
      1) Calculates an offset within a page, by ANDing an address
         with ~PAGE_MASK.
    
      2) Checks whether that offset is >= PAGE_SIZE.
    
    This check can never evaluate true, making the code it guards
    unreachable. smatch spots bogus arithmetic resulting from the
    impossible condition, resulting in the following warning:
    
      arch/mips/mm/dma-noncoherent.c:125
        dma_sync_phys() warn: mask and shift to zero
    
    Fix this by removing the impossible to satisfy condition & the
    unreachable code it guards.
    Signed-off-by: default avatarPaul Burton <paul.burton@mips.com>
    Cc: linux-mips@vger.kernel.org
    Cc: Christoph Hellwig <hch@lst.de>
    Cc: Marek Szyprowski <m.szyprowski@samsung.com>
    Cc: Robin Murphy <robin.murphy@arm.com>
    d411da06
dma-noncoherent.c 4.08 KB