|
我使用如下方法操作一个地址为0x56000020的端口
unsigned long port_addr;
(void *)(port_addr) = ioremap(0x56000020,0x8);
操作端口使用如下代码:
*(volatile unsigned int*)(port_addr)|=0x00008000;
编译时出现warning,
(void *)(port_addr) = ioremap(0x56000020,0x8);
warning: use of cast expressions as lvalues is deprecated
左值为什么说有问题呢?
ioremap的定义明明是:
(void *)ioremap(unsigned long offset, unsigned long size) |
|