On Wed, 3 Oct 2018, Himanshu Jha wrote: > > > Hi, I choose the CONFIG_PCI option, it did solve the undefined symbols, > > but the file still does not compile starting with the error: > > > > drivers/staging/mt7621-pci/pci-mt7621.c:496:27: error: ‘port’ undeclared > > (first use in this function); did you mean ‘ror8’? > > list_for_each_entry_safe(port, tmp, &pcie->ports, list) { > > > > I saw that in other usages of list_for_each_entry_safe, the first parameter > > is a local variable. > > Correct! Both port & tmp should be a local variable of the same object > type. I don't think it is necessary for either of them to be local variables. It might be a bit strange for them to be global variables, but there isn't any intrinsic problem. Of course, it is necessary for the variable to be declared somewhere, which does not seem to be the case here. Actually, one could take a moment to think about why these variables have to already be declared. Indeed, if the loop exits in a normal way, then the first argument ends up pointing to the head of the list, which is a dummy value and not useful for much of anything. Referring to it is typically a bug. But sometimes it is useful to break out of such a loop, so then the variable has to be visible in the enclosing scope. I'm not sure if there is any practical use of having the temporary variable in the second argument of list_for_each_entry_safe have a lifetime outside of the loop. It is just a pointer to get from one element to the next one, in case the element that the first argument is pointing to is removed from the list. But it is necessary to be able to specify the name for this variable, to be sure that it doesn't conflict with anything else, and then it might be considered strange for a macro to be declaring new variables; it is safer to have the scope of the variable be apparent in the visible source code. julia > > > > > Then in run "make menuconfig" again and under "Device Drivers -> staging > > > > drivers" I chose "MediaTek MT7621 PCI Controller" > > > > Hoping it will solve it , but it didn't. > > > > > > > > The files I prepared the patchset for did compile ok , is it important > > > that > > > > all files will compile? > > > > > > I think for these changes just use that .config supplied by the distro > > > at /boot/config-* > > > > > > But IIRC `make allyesconfig` should be used(not sure though..) > > > > > > > But I compile on ubuntu on x86 and I want to compile to a specific mips SoC. > > I tried it anyway and it did not compile the file I prepared the patch for > > (drivers/staging/mt7621-mmc/sd.c) > > Cool! > You found a bug while cross-compiling for MIPS which would not > show up on x86. > > Btw, the Cc list should contain developers who might give you > a better feedback. Therefore, use `get_maintainer` to list all > those people. > > > -- > Himanshu Jha > Undergraduate Student > Department of Electronics & Communication > Guru Tegh Bahadur Institute of Technology > > -- > You received this message because you are subscribed to the Google Groups "outreachy-kernel" group. > To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com. > To post to this group, send email to outreachy-kernel@googlegroups.com. > To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20181002200507.GA26645%40himanshu-Vostro-3559. > For more options, visit https://groups.google.com/d/optout. >