[PATCH V8 03/10] USB/ppc4xx: Add Synopsys DWC OTG Core Interface Layer

Alexander Gordeev lasaine at lvk.cs.msu.su
Tue Feb 8 11:19:25 EST 2011


В Mon, 7 Feb 2011 10:53:25 -0800
Tirumala Marri <tmarri at apm.com> пишет:

> dwc_read_reg32 is used nowhere throughout the code. One of dwc_read32 and
> dwc_read_reg32 should be removed IMO. There was once only dwc_read_reg32. In
> version 5 of your patchset I believe. Why did you add another function?
> AFAIK it is not correct to store pointers in u32 because they need 8 bytes
> on 64-bit archs. So it was ok with the old dwc_read_reg32.
> [Marri] If u32 is 8bytes isn't pointer type would be 8bytes as well.

Sorry, I don't understand that. I think u32 is always 32bit = 4byte on
all archs. Right?

> I had change the API to avoid type castings to register addresses.

IMO it's now much worse because you pass a u32 value and cast it
internally to a pointer. I think it's unsafe and counter-intuitive. BTW
what is the problem with type casting to register addresses that you
mention? I've checked version 5 of your patchset (which is the last
version where the old API is used) and there are no casts.

-- 
  Alexander
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <http://lists.ozlabs.org/pipermail/linuxppc-dev/attachments/20110208/5b4990d1/attachment.pgp>


More information about the Linuxppc-dev mailing list