[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1597235.QjzCE74z4V@wuerfel>
Date: Thu, 29 Jan 2015 17:04:03 +0100
From: Arnd Bergmann <arnd@...db.de>
To: linux-arm-kernel@...ts.infradead.org
Cc: Ricardo Ribalda Delgado <ricardo.ribalda@...il.com>,
Mark Brown <broonie@...nel.org>,
Michal Simek <michal.simek@...inx.com>,
Sören Brinkmann <soren.brinkmann@...inx.com>,
linux-spi@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] spi/xilinx: Cast ioread32/iowrite32 function pointers
On Thursday 29 January 2015 15:51:13 Ricardo Ribalda Delgado wrote:
> * Setup little endian helper functions first and try to use them
> * and check if bit was correctly setup or not.
> */
> - xspi->read_fn = ioread32;
> - xspi->write_fn = iowrite32;
> + xspi->read_fn = (u32 (*)(void __iomem *)) ioread32;
> + xspi->write_fn = (void (*)(u32, void __iomem *)) iowrite32;
>
> xspi->write_fn(XSPI_CR_LOOP, xspi->regs + XSPI_CR_OFFSET);
>
Casting the type of a function you call seems rather dangerous. Why not
add an inline function in this driver as a wrapper?
Arnd
--
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