U-Boot Compilation Warnings

I’m receiving a bunch of warnings from compiling U-Boot (L4T 32.1). The latter set seems more serious so I put it in a pastebin link: https://pastebin.com/EkX4nsa5. The other warnings just seem to be simple C warnings:

drivers/net/e1000.c: In function ‘e1000_initialize_hardware_bits’:
drivers/net/e1000.c:1526:2: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
  if (hw->mac_type == e1000_igb)
drivers/net/e1000.c:1529:3: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
   switch (hw->mac_type) {
  CC      drivers/net/rtl8169.o
drivers/net/rtl8169.c:342:18: warning: ‘rtl8169_intr_mask’ defined but not used [-Wunused-const-variable=]
 static const u16 rtl8169_intr_mask =

I’m just making sure these aren’t important/bad. U-Boot flashes properly and everything looks fine on the TX2’s end, but I haven’t tested anything with pci/pcie yet (which many of the warnings are about).

Edit: at second thought the warnings I posted here are clearly harmless. So only pay attention to the pastebin ones I guess.

For the first part, this is just saying that indentation is misleading to humans reading the code. Actual code compilation and produced code will not care.

The rtl8169 warning is basically saying someone defined something, and then it wasn’t used…which is wasteful. Perhaps someone used this in the past and removed code, but forgot to remove the declaration. Or perhaps your current configuration does not use this, but some other configuration does, and the config for what you are doing now could remove this. This won’t cause a failure unless you end up two bytes over maximum memory (and this won’t be the case).

I was mostly worried about the warnings that are in the pastebin link

I couldn’t tell you about issues the other warnings. Like the Linux kernel, it is possible to compile U-Boot with features which are never used. It is also possible that there are features enabled which lack a dependency and the feature should not be enabled, but if you don’t use that feature, then it won’t be an issue (other than making the image larger than it needs to be). Someone knowing those specific warnings may be able to answer, but mostly knowing will require simply testing to see if it works or not.

Just to illustrate, look at this error:

arch/arm/dts/tegra20-harmony.dtb: Warning (unit_address_format): Failed prerequisite 'pci_bridge'
arch/arm/dts/tegra20-harmony.dtb: Warning (pci_device_reg): Failed prerequisite 'pci_bridge'
arch/arm/dts/tegra20-harmony.dtb: Warning (pci_device_bus_num): Failed prerequisite 'pci_bridge'

I do not know what “harmony” refers to, but it may be something internal to NVIDIA and unrelated to the TX2/dev kit carrier…and thus it wouldn’t matter if that is the case. If it is an issue, then perhaps there is a feature “pci_bridge” which the config needs to enable, but I wouldn’t advise doing so unless you know it is an issue. This is also a device tree warning, and not for the main code…so there is a possibility that something in CBoot will provide this prior to U-Boot ever seeing the tree, and then the missing prerequisite would exist (I don’t know, this is just an illustration of a possibility).

The question is, does this work? Or does it fail? If it fails, what was your starting config?