From: Christian Borntraeger <borntraeger@de.ibm.com> To: Cornelia Huck <cohuck@redhat.com>, Thomas Huth <thuth@redhat.com> Cc: qemu-s390x@nongnu.org, qemu-devel@nongnu.org, "Jason J . Herne" <jjherne@linux.ibm.com> Subject: Re: [Qemu-devel] [PATCH] s390/ipl: cast to SCSIDevice directly Date: Thu, 2 May 2019 19:49:39 +0200 [thread overview] Message-ID: <ec7ac4a9-b818-9869-7f56-dbc0e9d6d558@de.ibm.com> (raw) In-Reply-To: <20190502155516.12415-1-cohuck@redhat.com> On 02.05.19 17:55, 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. > And it even does look nicer. Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com> > 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); >
WARNING: multiple messages have this Message-ID (diff)
From: Christian Borntraeger <borntraeger@de.ibm.com> To: Cornelia Huck <cohuck@redhat.com>, Thomas Huth <thuth@redhat.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 19:49:39 +0200 [thread overview] Message-ID: <ec7ac4a9-b818-9869-7f56-dbc0e9d6d558@de.ibm.com> (raw) Message-ID: <20190502174939._cxHd1Np6vIu1iMyjztPNk7c4ZavUGDMDT9hcTyibKE@z> (raw) In-Reply-To: <20190502155516.12415-1-cohuck@redhat.com> On 02.05.19 17:55, 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. > And it even does look nicer. Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com> > 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); >
next prev parent reply other threads:[~2019-05-02 17:49 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é 2019-05-02 16:10 ` Philippe Mathieu-Daudé 2019-05-02 17:49 ` Christian Borntraeger [this message] 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=ec7ac4a9-b818-9869-7f56-dbc0e9d6d558@de.ibm.com \ --to=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: 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).