-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 西元2010年02月18日 12:07, Jon Povey wrote: > I am starting work on porting our drivers from MV kernel to the git > kernel, and getting a lot of warnings like: > > warning: passing argument 1 of '__typesafe_io' makes integer from > pointer without a cast > > Which comes from source like: > > u32 tmpreg; > tmpreg = inl(GPIO_DIR45); > > We have our own header with lots of lines like this (inspired by drivers > in the beta DM355 SDK): > > #define GPIO_DIR45 IO_ADDRESS( DAVINCI_GPIO_BASE + 0x60 ) > > Now, I'm pretty sure the we shouldn't be doing this for portability and > so on, and should be getting these addresses in some > platform-independent way, but for now It Works so I don't want to fix > it. > > I would however like a clue on the right way to fix these warnings and > do the kind of accesses I'm trying to do. There are many similar-looking > macros and functions available: inl(), insl(), __raw_readl() and I don't > know which I should be using, or if I should be passing around u32 > "addresses" or __iomem pointers (maybe the IO_ADDRESS() should go?). > Had a look around for documentation but not found anything too useful. > > Thanks, > do a cast then.
#define GPIO_DIR45 (void *)(IO_ADDRESS( DAVINCI_GPIO_BASE + 0x60 )) - -- Victor Tseng (a.k.a Palatis) iWorldCom Co., Ltd. Taipei World Trading Center Exhibition Hall Room 5C28, 5F, No. 5, Hsinyi Rd., Sec. 5, Taipei 110, Taiwan, ROC. 台北市界貿易中心第一展覽館 台北市 110 信義區信義路五段 5 號 5 樓 5C28 室 Tel: 886-02-8786-1579 Fax: 886-02-8786-1379 Mobile: 0938-642-978 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkt8+aUACgkQSJ4mt5b7FKdD1gCghR157BC6Vdrn0sgXV5n6xm5J KlEAn3v/HWNlvUz4XPFKgteEMDY0JfBQ =kv+Q -----END PGP SIGNATURE----- _______________________________________________ Davinci-linux-open-source mailing list [email protected] http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
