I am getting the following error messages, and I checked the file but can not figure out why or how to address the errors. Please help.
arch/arm/mach-msm/jtag-mm.o: In function `dbg_init_arch_data':
/home/sansari/WORKING_DIRECTORY/arch/arm/mach-msm/jtag-mm.c:279: multiple definition of `msm_jtag_save_cntr'
arch/arm/mach-msm/jtag.o:/home/sansari/WORKING_DIRECTORY/arch/arm/mach-msm/jtag.c:1085: first defined here
arch/arm/mach-msm/jtag-mm.o: In function `etm_init_arch_data':
/home/sansari/WORKING_DIRECTORY/arch/arm/mach-msm/jtag-mm.c:568: multiple definition of `msm_jtag_save_state'
arch/arm/mach-msm/jtag.o:/home/sansari/WORKING_DIRECTORY/arch/arm/mach-msm/jtag.c:1038: first defined here
arch/arm/mach-msm/jtag-mm.o: In function `msm_jtag_restore_state':
/home/sansari/WORKING_DIRECTORY/arch/arm/mach-msm/jtag-mm.c:585: multiple definition of `msm_jtag_restore_state'
arch/arm/mach-msm/jtag.o:/home/sansari/WORKING_DIRECTORY/arch/arm/mach-msm/jtag.c:1073: first defined here
arch/arm/mach-msm/jtag-mm.o: In function `dbg_init_arch_data':
/home/sansari/WORKING_DIRECTORY/arch/arm/mach-msm/jtag-mm.c:279: multiple definition of `msm_jtag_restore_cntr'
arch/arm/mach-msm/jtag.o:/home/sansari/WORKING_DIRECTORY/arch/arm/mach-msm/jtag.c:1085: first defined here
make[1]: *** [arch/arm/mach-msm/built-in.o] Error 1
I put a copy of jtag-mm.c at this link
Thanks. Here is jtag.c
After commenting out the jtag.h, and recompiling I get the following error message:
arch/arm/mach-msm/jtag-mm.c:790:2: error: implicit declaration of function 'msm_jtag_fuse_apps_access_disabled' [-Werror=implicit-function-declaration]
cc1: some warnings being treated as errors
make[1]: *** [arch/arm/mach-msm/jtag-mm.o] Error 1
make: *** [arch/arm/mach-msm] Error 2
@Peter - Thanks. I get what you are saying. Ok. let me try it. Never mind about the grep comment:-) I see it is not possible.
Update: Thanks. I can see what the issue is now. Now that I have posted the jtag.h, and jtag-mm.c, and jtag.c, you can perhaps validate what I think is the issue. As Peter mentioned, the variables are declared twice. Once by jtag.c and again by jtag-mm.c. For instance, I see the lines:
uint32_t msm_jtag_save_cntr[NR_CPUS];
uint32_t msm_jtag_restore_cntr[NR_CPUS];
in both files. But I tried to comment them out in one file, and I get an error since the variable is used in the same file in a function. What is the right way of handling this then? Can I declare it in the header file once, and just remove it from both source files? Or should I leave the deceleration in one source file, and include it in the other?
Here is a copy of jtag.h Thanks