qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: francisco iglesias <frasse.iglesias@gmail.com>
Cc: "QEMU Developers" <qemu-devel@nongnu.org>,
	"Edgar Iglesias" <edgari@xilinx.com>,
	"Alistair Francis" <alistai@xilinx.com>,
	"Francisco Iglesias" <francisco.iglesias@feimtech.se>,
	"Marcin Krzemiński" <mar.krzeminski@gmail.com>,
	"Philippe Mathieu-Daudé" <f4bug@amsat.org>
Subject: Re: [Qemu-devel] [PATCH v9 07/13] xilinx_spips: Add support for RX discard and RX drain
Date: Sat, 13 Jan 2018 12:39:31 +0000	[thread overview]
Message-ID: <CAFEAcA8F7VJ2Gp3AJuhbu8iSuBPjyeK==dPEZB_fHSf_uAvang@mail.gmail.com> (raw)
In-Reply-To: <CAAYMZQvY=yp2xaGWPPW3gXrj_no3jWgtemJY3eDgo34WU2OVCQ@mail.gmail.com>

On 13 January 2018 at 01:04, francisco iglesias
<frasse.iglesias@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

  reply	other threads:[~2018-01-13 12:39 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-26 23:16 [Qemu-devel] [PATCH v9 00/13] Add support for the ZynqMP Generic QSPI Francisco Iglesias
2017-11-26 23:16 ` [Qemu-devel] [PATCH v9 01/13] m25p80: Add support for continuous read out of RDSR and READ_FSR Francisco Iglesias
2017-11-26 23:16 ` [Qemu-devel] [PATCH v9 02/13] m25p80: Add support for SST READ ID 0x90/0xAB commands Francisco Iglesias
2017-11-27  3:37   ` Philippe Mathieu-Daudé
2017-11-26 23:16 ` [Qemu-devel] [PATCH v9 03/13] m25p80: Add support for BRRD/BRWR and BULK_ERASE (0x60) Francisco Iglesias
2017-11-26 23:16 ` [Qemu-devel] [PATCH v9 04/13] m25p80: Add support for n25q512a11 and n25q512a13 Francisco Iglesias
2017-11-26 23:16 ` [Qemu-devel] [PATCH v9 05/13] xilinx_spips: Move FlashCMD, XilinxQSPIPS and XilinxSPIPSClass Francisco Iglesias
2017-11-26 23:16 ` [Qemu-devel] [PATCH v9 06/13] xilinx_spips: Update striping to be big-endian bit order Francisco Iglesias
2017-11-26 23:16 ` [Qemu-devel] [PATCH v9 07/13] xilinx_spips: Add support for RX discard and RX drain Francisco Iglesias
2018-01-11 13:16   ` Peter Maydell
2018-01-13  1:04     ` francisco iglesias
2018-01-13 12:39       ` Peter Maydell [this message]
2018-01-13 21:44         ` francisco iglesias
2017-11-26 23:16 ` [Qemu-devel] [PATCH v9 08/13] xilinx_spips: Make tx/rx_data_bytes more generic and reusable Francisco Iglesias
2017-11-27  3:52   ` Philippe Mathieu-Daudé
2017-11-27 22:57     ` francisco iglesias
2017-11-26 23:16 ` [Qemu-devel] [PATCH v9 09/13] xilinx_spips: Add support for zero pumping Francisco Iglesias
2017-11-26 23:16 ` [Qemu-devel] [PATCH v9 10/13] xilinx_spips: Add support for 4 byte addresses in the LQSPI Francisco Iglesias
2017-11-26 23:16 ` [Qemu-devel] [PATCH v9 11/13] xilinx_spips: Don't set TX FIFO UNDERFLOW at cmd done Francisco Iglesias
2017-11-26 23:16 ` [Qemu-devel] [PATCH v9 12/13] xilinx_spips: Add support for the ZynqMP Generic QSPI Francisco Iglesias
2017-11-26 23:16 ` [Qemu-devel] [PATCH v9 13/13] xlnx-zcu102: Add support for the ZynqMP QSPI Francisco Iglesias
2017-11-27  3:55   ` Philippe Mathieu-Daudé
2017-11-28 15:53 ` [Qemu-devel] [PATCH v9 00/13] Add support for the ZynqMP Generic QSPI Peter Maydell
2017-11-28 15:57   ` francisco iglesias

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAFEAcA8F7VJ2Gp3AJuhbu8iSuBPjyeK==dPEZB_fHSf_uAvang@mail.gmail.com' \
    --to=peter.maydell@linaro.org \
    --cc=alistai@xilinx.com \
    --cc=edgari@xilinx.com \
    --cc=f4bug@amsat.org \
    --cc=francisco.iglesias@feimtech.se \
    --cc=frasse.iglesias@gmail.com \
    --cc=mar.krzeminski@gmail.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).