On Saturday, 13 January 2018, Peter Maydell <peter.mayd...@linaro.org> wrote:
> On 13 January 2018 at 01:04, francisco iglesias > <frasse.igles...@gmail.com> wrote: > > CID 1383841 (#2 of 4): Uninitialized scalar variable (UNINIT)29. > > uninit_use_in_call: Using uninitialized value (uint32_t)tx_rx[0] when > > calling > > ssi_transfer. > > > > This is correct, tx_rx is used uninitialized but since we are > transmitting > > dummy cycles the transmitted value (tx_rx[0] in this case) is not used > (by > > the flashes), this the reason the code looks like that. Would you like > me to > > create a patch for quieting coverity here anyway? > > tx_rx[0] = ssi_transfer(s->spi[bus], (uint32_t)tx_rx[0]); > > is effectively using the value (since you don't know what the > thing on the other end of that function is going to do with the > value you pass it. You really don't want to make this code's > correctness depend on the called function never looking at > its argument. If you want to pass a dummy value why not > just use constant 0 or something rather than an uninitialized > variable ? > > I think quieting coverity is probably a good idea anyway for > the other false positives (it sounds like it hasn't been able > to determine that paths in the rest of the loop can only occur > if the top of the loop went through a path initializing the > variable. Code like that is also hard for humans to comprehend, > though...) > > thanks > -- PMM > Hi Peter, I'll create a patch attempting to correct the coverity complains and comeback! Bets regards, Francisco Iglesias