案例:
Linux内核中
arch/arm/plat-s3c/include/plat/regs-otg.h
arch/arm/plat-s3c/include/plat/regs-usb-otg-hs.h
这两个头文件定义了相同的宏:
#ifndef __ASM_ARCH_REGS_USB_OTG_HS_H
make编译出现错误:
drivers/usb/gadget/s3c_udc_otg_xfer_dma.c:65: error: implicit declaration of function 'S3C_UDC_OTG_DIEPDMA'
......
drivers/usb/gadget/s3c_udc_otg_xfer_dma.c:152: error: 'DEPCTL_NEXT_EP_BIT' undeclared (first use in this function)
原因是头文件宏定义重复了,到时后面的一堆不该错误的问题。
把arch/arm/plat-s3c/include/plat/regs-otg.h中的
#ifndef __ASM_ARCH_REGS_USB_OTG_HS_H
改成
#ifndef __ASM_ARCH_REGS_USB_OTG_H
编译,所有问题解决。