[Huawei Nova/Nova Plus Questions & Answers] Vinnom:
**As this is only for personal learning and not a real developing thread, I didn't create it as DevDB project. Maybe in the future, when I learn how to, at least, handle the basic**

Hi all!

I'm trying to compile the stock EMUI 5.0 kernel for Nova and I'm really new to this. First, I ended up with a bunch of path errors and I already fixed it. Now, I'm having c errors that I can't solve, beside of looking extensively how to.

To the code =)

compiling:

$ make -j8
CHK include/config/kernel.release
CHK include/generated/uapi/linux/version.h
CHK include/generated/utsrelease.h
CALL scripts/checksyscalls.sh
CHK include/generated/compile.h
CHK kernel/config_data.h
CC drivers/usb/gadget/u_f.o
CC drivers/usb/gadget/android.o
CC drivers/usb/gadget/function/f_fs.o
LD drivers/usb/gadget/libcomposite.o
LD drivers/usb/gadget/function/usb_f_fs.o
LD drivers/usb/gadget/function/built-in.o
LD drivers/usb/gadget/g_android.o
LD drivers/usb/gadget/built-in.o
drivers/usb/gadget/g_android.o: In function `alloc_ep_req':
$HOME/celular/Nova/CAZ_NG_EMUI5.0_opensource/Code_Opensource/kernel/drivers/usb/gadget/u_f.c:18: multiple definition of `alloc_ep_req'
drivers/usb/gadget/libcomposite.o:$HOME/celular/Nova/CAZ_NG_EMUI5.0_opensource/Code_Opensource/kernel/drivers/usb/gadget/u_f.c:18: first defined here
drivers/usb/gadget/g_android.o: In function `f_midi_disable':
$HOME/celular/Nova/CAZ_NG_EMUI5.0_opensource/Code_Opensource/kernel/./drivers/usb/gadget/function/f_midi.c:383: multiple definition of `__ksymtab_alloc_ep_req'
drivers/usb/gadget/libcomposite.o:$HOME/celular/Nova/CAZ_NG_EMUI5.0_opensource/Code_Opensource/kernel/drivers/usb/gadget/usbstring.c:41: first defined here
make[3]: *** [scripts/Makefile.build:336: drivers/usb/gadget/built-in.o] Error 1
make[2]: *** [scripts/Makefile.build:402: drivers/usb/gadget] Error 2
make[1]: *** [scripts/Makefile.build:402: drivers/usb] Error 2
make: *** [Makefile:955: drivers] Error 2

looking for multiple definitions of "alloc_ep_req":

$ grep --exclude=*.o -rnw '$HOME/celular/Nova/CAZ_NG_EMUI5.0_opensource/Code_Opensource/kernel' -e "alloc_ep_req"
$HOME/celular/Nova/CAZ_NG_EMUI5.0_opensource/Code_Opensource/kernel/drivers/usb/gadget/function/f_hid.c:342:	return alloc_ep_req(ep, length, length);
$HOME/celular/Nova/CAZ_NG_EMUI5.0_opensource/Code_Opensource/kernel/drivers/usb/gadget/function/f_midi.c:43:extern struct usb_request *alloc_ep_req(struct usb_ep *ep, int len, int default_len);
$HOME/celular/Nova/CAZ_NG_EMUI5.0_opensource/Code_Opensource/kernel/drivers/usb/gadget/function/f_midi.c:206:	return alloc_ep_req(ep, length, length);
$HOME/celular/Nova/CAZ_NG_EMUI5.0_opensource/Code_Opensource/kernel/drivers/usb/gadget/function/f_loopback.c:299:	return alloc_ep_req(ep, len, buflen);
$HOME/celular/Nova/CAZ_NG_EMUI5.0_opensource/Code_Opensource/kernel/drivers/usb/gadget/function/f_sourcesink.c:435:	return alloc_ep_req(ep, len, buflen);
$HOME/celular/Nova/CAZ_NG_EMUI5.0_opensource/Code_Opensource/kernel/drivers/usb/gadget/u_f.h:48:struct usb_request *alloc_ep_req(struct usb_ep *ep, int len, int default_len);
$HOME/celular/Nova/CAZ_NG_EMUI5.0_opensource/Code_Opensource/kernel/drivers/usb/gadget/u_f.c:17:struct usb_request *alloc_ep_req(struct usb_ep *ep, int len, int default_len)
$HOME/celular/Nova/CAZ_NG_EMUI5.0_opensource/Code_Opensource/kernel/drivers/usb/gadget/u_f.c:32:EXPORT_SYMBOL_GPL(alloc_ep_req);

looking for multiple definition of "ksymtab_alloc_ep_req" returns nothing.

looking for multiple definition of "f_midi_disabel":

$ grep --exclude=*.o -rnw '$HOME/celular/Nova/CAZ_NG_EMUI5.0_opensource/Code_Opensource/kernel' -e "f_midi_disable"
$HOME/celular/Nova/CAZ_NG_EMUI5.0_opensource/Code_Opensource/kernel/drivers/usb/gadget/function/f_midi.c:382:static void f_midi_disable(struct usb_function *f)
$HOME/celular/Nova/CAZ_NG_EMUI5.0_opensource/Code_Opensource/kernel/drivers/usb/gadget/function/f_midi.c:406:	f_midi_disable(f);
$HOME/celular/Nova/CAZ_NG_EMUI5.0_opensource/Code_Opensource/kernel/drivers/usb/gadget/function/f_midi.c:984:	midi->func.disable = f_midi_disable;

As I can see, there is only one definition of the first function as the only another occurrency rightly do it as "extern" and inside "u_f.h" is the prototype of the function.

Any ideas? Should I upload any file, just ask me =)