Remove NULL assignments to fields in spl_load_info when .load doesn't
reference these fields. This can result in more efficient code. filename
must stay even if it is unused, since load_simple_fit uses it.
Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
struct spl_load_info load;
debug("Found FIT image\n");
- load.dev = NULL;
- load.priv = NULL;
load.filename = NULL;
load.bl_len = 1;
load.read = spi_load_read;
load.read = spl_fit_read;
load.bl_len = 1;
load.filename = (void *)filename;
- load.priv = NULL;
return spl_load_simple_fit(spl_image, &load, 0, header);
} else {
debug("Found FIT\n");
load.dev = mmc;
- load.priv = NULL;
load.filename = NULL;
load.bl_len = mmc->read_bl_len;
load.read = h_spl_load_read;
struct spl_load_info load;
load.dev = mmc;
- load.priv = NULL;
load.filename = NULL;
load.bl_len = mmc->read_bl_len;
load.read = h_spl_load_read;
struct spl_load_info load;
debug("Found FIT\n");
- load.dev = NULL;
load.priv = &offset;
load.filename = NULL;
load.bl_len = bl_len;
valid_container_hdr((void *)header)) {
struct spl_load_info load;
- load.dev = NULL;
load.priv = &offset;
load.filename = NULL;
load.bl_len = bl_len;
struct spl_load_info load;
debug("Found legacy image\n");
- load.dev = NULL;
- load.priv = NULL;
load.filename = NULL;
load.bl_len = IS_ENABLED(CONFIG_SPL_LZMA) ? bl_len : 1;
load.read = spl_nand_legacy_read;
debug("Found FIT\n");
load.dev = flash;
- load.priv = NULL;
load.filename = NULL;
load.bl_len = 1;
load.read = spl_spi_fit_read;
struct spl_load_info load;
load.dev = flash;
- load.priv = NULL;
load.filename = NULL;
load.bl_len = 1;
load.read = spl_spi_fit_read;
struct ymodem_fit_info info;
debug("Found FIT\n");
- load.dev = NULL;
load.priv = (void *)&info;
load.filename = NULL;
load.bl_len = 1;