From: Cornelia Huck <cohuck@redhat.com> To: Thomas Huth <thuth@redhat.com>, Christian Borntraeger <borntraeger@de.ibm.com> Cc: qemu-s390x@nongnu.org, qemu-devel@nongnu.org, "Jason J . Herne" <jjherne@linux.ibm.com>, Cornelia Huck <cohuck@redhat.com> Subject: [Qemu-devel] [PATCH] s390/ipl: cast to SCSIDevice directly Date: Thu, 2 May 2019 17:55:16 +0200 [thread overview] Message-ID: <20190502155516.12415-1-cohuck@redhat.com> (raw) 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); -- 2.17.2
WARNING: multiple messages have this Message-ID (diff)
From: Cornelia Huck <cohuck@redhat.com> To: Thomas Huth <thuth@redhat.com>, Christian Borntraeger <borntraeger@de.ibm.com> Cc: "Jason J . Herne" <jjherne@linux.ibm.com>, qemu-s390x@nongnu.org, Cornelia Huck <cohuck@redhat.com>, qemu-devel@nongnu.org Subject: [Qemu-devel] [PATCH] s390/ipl: cast to SCSIDevice directly Date: Thu, 2 May 2019 17:55:16 +0200 [thread overview] Message-ID: <20190502155516.12415-1-cohuck@redhat.com> (raw) Message-ID: <20190502155516.t5x_m4cng6KwCV9u66QXDdGYgOI3wU4bUAaxHhqrtvo@z> (raw) 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); -- 2.17.2
next reply other threads:[~2019-05-02 15:55 UTC|newest] Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top 2019-05-02 15:55 Cornelia Huck [this message] 2019-05-02 15:55 ` [Qemu-devel] [PATCH] s390/ipl: cast to SCSIDevice directly Cornelia Huck 2019-05-02 15:59 ` Thomas Huth 2019-05-02 15:59 ` Thomas Huth 2019-05-02 16:10 ` Philippe Mathieu-Daudé 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=20190502155516.12415-1-cohuck@redhat.com \ --to=cohuck@redhat.com \ --cc=borntraeger@de.ibm.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: linkBe 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).