
2013/1/3 Wolfgang Denk wd@denx.de:
Dear Michal Simek,
In message CAHTX3d+shCmUjaXzS0oS5pT8a89cyA9UKemc+oRk5xk6qRNrdQ@mail.gmail.com you wrote:
You say, if one sets width to 8 bits, then the code fails when the bus is actually 16 bits wide?
...
Here is that function with my comment about missing "else". In ace_writew function we shouldn't write 16bit value when width is 8. (It probably doesn't break anything but it is not correct - I will check it on the HW)
I see. Well, I think the commit message is not really clear. I definitely misunderstood it. Maybe it can be improved?
Yep.
btw: is there any coding style rule about this second function
Current (simplified) case. static u16 ace_readw(unsigned off) { if (width == 8) return readb(base + off) | (readb(base + off + 1) << 8);
return readw(base + off); }
or (with else)
static u16 ace_readw(unsigned off) { if (width == 8) return readb(base + off) | (readb(base + off + 1) << 8); else return readw(base + off); }
Thanks, Michal