Search Linux Wireless

Re: [RFC] drivers: brcmaxi: provide amba axi functionality in separate module

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

 



On Mon, 21 Mar 2011 21:28:48 +0100, Randy Dunlap <rdunlap@xxxxxxxxxxxx> wrote:

---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***


Hi Randy,

One of the things I am facing in the code is the use of the volatile keyword so I browsed another file in the Documentation folder: volatile-considered-harmful.txt. As your name popped up I would like to ask some questions. The register access macros in the brcmaxi module make use of the accessor functions readb/w/l and writeb/w/l and the pointer parameter is cast with volatile keyword, which I assume to be unneccessary (reading the doc). Another instance uses it to avoid optimization. Here is how the function is coded currently:

void foobar(void *r, u32 val)
{
	volatile u32 dummy;

	WR_REG(r, val);
	dummy = RD_REG(r);
}

The register read is necessary to assure the register write is properly flushed out in hardware. Could removing the volatile for the dummy variable cause removal of the register read due to code optimization.

Gr. AvS
--
"The most merciful thing in the world, I think, is the inability of the human
mind to correlate all its contents." - "The Call of Cthulhu"

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux