Re: [PATCHv2] dmaengine: fsl-edma: fixup reg offset and hw S/G support in big-endian model

From: Russell King - ARM Linux
Date: Wed Sep 24 2014 - 05:39:47 EST


On Wed, Sep 24, 2014 at 03:12:07PM +0800, Jingchang Lu wrote:
> static void edma_writeb(struct fsl_edma_engine *edma, u8 val, void __iomem *addr)
> {
> - iowrite8(val, addr);
> + /* swap the reg offset for these in big-endian mode */
> + if (edma->big_endian)
> + iowrite8(val, (void __iomem *)((u32)addr ^ 0x3));

NAK. /Not/ u32. unsigned long. Run this through sparse, and sparse
will complain with u32 here. Just because the driver is currently used
on a 32-bit arch is no reason to be sloppy about this.

In fact, running this through sparse (make ... C=1) or even C=2 might
well be a good idea to check whether there's any other silly mistakes.

Note that Documentation/SubmitChecklist calls for checks with sparse.

--
FTTC broadband for 0.8mile line: currently at 9.5Mbps down 400kbps up
according to speedtest.net.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/