From mboxrd@z Thu Jan 1 00:00:00 1970 From: Troy Kisky Date: Wed, 28 Nov 2012 11:36:29 -0700 Subject: [U-Boot] [PATCH V4 04/11] imximage: prepare to move static variables to struct data_src In-Reply-To: <20121128093819.55DD620104E@gemini.denx.de> References: <1349315254-21151-9-git-send-email-troy.kisky@boundarydevices.com> <1354066303-29762-1-git-send-email-troy.kisky@boundarydevices.com> <1354066303-29762-5-git-send-email-troy.kisky@boundarydevices.com> <20121128093819.55DD620104E@gemini.denx.de> Message-ID: <50B659AD.9090704@boundarydevices.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 11/28/2012 2:38 AM, Wolfgang Denk wrote: > Dear Troy Kisky, > > In message <1354066303-29762-5-git-send-email-troy.kisky@boundarydevices.com> you wrote: >> Need to move accesses to the static variables to >> a function where struct data_src is used. > Could you please elucidate why exactly this is _needed_? My goal was to reduce the number of static variables, but strictly speaking it has little benefit other than giving me a warm fuzzy feeling. I'm not that only one that dislikes static though. > >> + /* Be able to detect if the cfg file has no BOOT_FROM tag */ >> + g_flash_offset = FLASH_OFFSET_UNDEFINED; >> + memset(&ds, 0, sizeof(struct data_src)); > Is this initialization really needed? > > Best regards, > > Wolfgang Denk > ds is on the stack, and even if not needed now, I like to avoid future random bugs. Troy