I understand the difference between unsigned and unsigned int. But my question is a bit different.
I am ioremaping(linux) a particular memory and i want to read the memory. I did the following thig :
func()
{
unsigned int *p;
p = (unsigned int *)ioremap(ADDR,8*sizeof(unsigned int));
for (i = 0; i <= 7; i++)
pr_err("p[%d] = %d", i, p[i]);
}
This works perfectly. But I see a standard code doing the same and using (unsidned *) instead of (unsigned int *). That is p is of unsigned *p
.
func()
{
unsigned *p;
p = (unsigned *)ioremap(ADDR,8*sizeof(unsigned));
for (i = 0; i <= 7; i++)
pr_err("p[%d] = %d", i, p[i]);
}
I would like to know if it is a good programming practice(platform independent code??). If yes please sate the reason.