what is difference between readl() and *

107 Views Asked by At

In linux kernel. I get a reg [phy_addr], and do ioremap(), get [vir_addr], when i want to get val of this reg, What's the difference between readl() and *?

u32 value;

phys_addr_t phy_addr = 0x12345678; // it is reg addr

void *vir_addr = ioremap(phy_addr, sizeof(u32));

val = readl(vir_addr);
val = *(u32 *)vir_addr;
0

There are 0 best solutions below