Skip to contentSkip to conversation

of/fdt: move memreserve and dtb memory reservations into core

DISCUSSION Dan Carpenter 1 participant 1 message Mar 11, 2016

lore
Share & tools
lore
#0 lore raw

Hello Rob Herring,

The patch d1552ce449eb: "of/fdt: move memreserve and dtb memory reservations into core" from Apr 1, 2014, leads to the following static checker warning:

	drivers/of/fdt.c:594 early_init_fdt_scan_reserved_mem()
	error: potentially using uninitialized 'size'.

drivers/of/fdt.c
583 void __init early_init_fdt_scan_reserved_mem(void) 584 {
585 int n;

   586          u64 base, size;
                          ^^^^
   587  
   588          if (!initial_boot_params)
   589                  return;
   590  
   591          /* Process header /memreserve/ fields */
   592          for (n = 0; ; n++) {
   593                  fdt_get_mem_rsv(initial_boot_params, n, &base, &size);
                                                                        ^^^^

594 if (!size)

                             ^^^^

Presumably we don't care about errors during boot because it's doomed anyway, but we might want to silence the warning?

   595                          break;
   596                  early_init_dt_reserve_memory_arch(base, size, 0);
   597          }
   598  
   599          of_scan_flat_dt(__fdt_scan_reserved_mem, NULL);
   600          fdt_init_reserved_mem();
   601  }

regards,
dan carpenter
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html