[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [Patch v6 04/11] IOMMU: propagate IOMMU Device-TLB flush error up to IOMMU mapping (top level ones)
>>> On 07.06.16 at 10:40, <quan.xu@xxxxxxxxx> wrote: > Along with discussion of a local variable for _for()_ loop, I need to > define this local variable into _while()_ loop: > e.g., as above case: > > +while ( i-- ) > +{ > + int iommu_ret = iommu_unmap_page(p2m->domain, gfn + i); > + > + break; > +} > > , right? Something like this. As said, tricking Coverity into not reporting the unused value as a possible problem would additionally be needed. Andrew - do you know of any pre-existing pattern usable for this purpose? > But I really like this way: > > + int iommu_ret; > + > +while ( i-- ) > +{ > + iommu_ret = iommu_unmap_page(p2m->domain, gfn + i); > + > + break; > +} Rather not - iommu_ret isn't used outside of the while() scope. (Unless, of course, the Coverity related adjustment makes this desirable / necessary, but I would guess the tool would then still be able to figure that the assignment is pointless on all but the last iteration.) Jan _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |