]> xenbits.xensource.com Git - libvirt.git/commitdiff
xen: Add coverity[ptr_arith] and [sign_extension] tags
authorJohn Ferlan <jferlan@redhat.com>
Tue, 22 Jan 2013 14:40:59 +0000 (09:40 -0500)
committerMichal Privoznik <mprivozn@redhat.com>
Tue, 22 Jan 2013 15:59:45 +0000 (16:59 +0100)
The old cpu bitmap setting algorithm causes a couple of complaints which
have been tagged.

src/xen/xen_hypervisor.c

index a770f53f2407d8c6d6181bdc860a39389793ffdf..bfee56dabb4d3f4bd89aacfcdb572ad3e1a4221e 100644 (file)
@@ -1795,8 +1795,11 @@ virXen_setvcpumap(int handle, int id, unsigned int vcpu,
             return -1;
 
         memset(pm, 0, sizeof(cpumap_t));
-        for (j = 0; j < maplen; j++)
+        for (j = 0; j < maplen; j++) {
+            /* coverity[ptr_arith] */
+            /* coverity[sign_extension] */
             *(pm + (j / 8)) |= cpumap[j] << (8 * (j & 7));
+        }
 
         if (hv_versions.hypervisor == 1) {
             xen_op_v1 op;