lkml.org 
[lkml]   [2015]   [Jan]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] spi/xilinx: Cast ioread32/iowrite32 function pointers
Date
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


\
 
 \ /
  Last update: 2015-01-29 17:21    [W:0.067 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site