jack wang wrote: > Hi James > Here is an updated driver patch that incorporates all the latest review > inputs from Grant and Eike. > Best wishes, > Jack +static inline u32 pm8001_read_le_32(void *virt_addr) +{ + return *((u32 *)((u8 *)virt_addr)); +} The cast to u8* isn't needed. +static inline void pm8001_write_le_32(void *addr, u32 offset, u32 val) +{ + *((u32 *)(((u8 *)addr)+(offset))) = val; +} void* can be added, it's a gcc extension the Linux kernel uses just everywhere. So at the end this could boil down to: *((u32 *)(addr + offset)) = val; And if you have _le_32 the value passed in and returned from pm8001_read_le_32() should probably be le32 instead of u32 so you can get sparse checks for that. Greetings, Eike
Attachment:
signature.asc
Description: This is a digitally signed message part.