From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: Cornelia Huck <cohuck@redhat.com>, Thomas Huth <thuth@redhat.com>,
Christian Borntraeger <borntraeger@de.ibm.com>
Cc: "Jason J . Herne" <jjherne@linux.ibm.com>,
qemu-s390x@nongnu.org, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] s390/ipl: cast to SCSIDevice directly
Date: Thu, 2 May 2019 18:10:00 +0200 [thread overview]
Message-ID: <40bc015c-710a-c731-74cb-ebf082fb8f57@redhat.com> (raw)
In-Reply-To: <20190502155516.12415-1-cohuck@redhat.com>
On 5/2/19 5:55 PM, Cornelia Huck wrote:
> Coverity notes that the result of object_dynamic_cast() to
> SCSIDevice is not checked in s390_gen_initial_iplp(); as
> we know that we always have a SCSIDevice in that branch,
> we can instead cast via SCSI_DEVICE directly.
>
> Coverity: CID 1401098
> Fixes: 44445d8668f4 ("s390 vfio-ccw: Add bootindex property and IPLB data")
> Signed-off-by: Cornelia Huck <cohuck@redhat.com>
> ---
> hw/s390x/ipl.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/hw/s390x/ipl.c b/hw/s390x/ipl.c
> index d0cc06a05fd0..b93750c14eac 100644
> --- a/hw/s390x/ipl.c
> +++ b/hw/s390x/ipl.c
> @@ -374,8 +374,7 @@ static bool s390_gen_initial_iplb(S390IPLState *ipl)
> if (ccw_dev) {
> switch (devtype) {
> case CCW_DEVTYPE_SCSI:
> - sd = (SCSIDevice *) object_dynamic_cast(OBJECT(dev_st),
> - TYPE_SCSI_DEVICE);
> + sd = SCSI_DEVICE(dev_st);
> ipl->iplb.len = cpu_to_be32(S390_IPLB_MIN_QEMU_SCSI_LEN);
> ipl->iplb.blk0_len =
> cpu_to_be32(S390_IPLB_MIN_QEMU_SCSI_LEN - S390_IPLB_HEADER_LEN);
>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
next prev parent reply other threads:[~2019-05-02 16:10 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-02 15:55 [Qemu-devel] [PATCH] s390/ipl: cast to SCSIDevice directly Cornelia Huck
2019-05-02 15:55 ` Cornelia Huck
2019-05-02 15:59 ` Thomas Huth
2019-05-02 15:59 ` Thomas Huth
2019-05-02 16:10 ` Philippe Mathieu-Daudé [this message]
2019-05-02 16:10 ` Philippe Mathieu-Daudé
2019-05-02 17:49 ` Christian Borntraeger
2019-05-02 17:49 ` Christian Borntraeger
2019-05-03 8:09 ` Cornelia Huck
2019-05-03 8:09 ` Cornelia Huck
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=40bc015c-710a-c731-74cb-ebf082fb8f57@redhat.com \
--to=philmd@redhat.com \
--cc=borntraeger@de.ibm.com \
--cc=cohuck@redhat.com \
--cc=jjherne@linux.ibm.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-s390x@nongnu.org \
--cc=thuth@redhat.com \
/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).