Re: [RFC][PATCH v3]Add pm8001 SAS/SATA HBA driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux