File super-intel-undefined-operation.patch of Package mdadm

super-intel.c:284: warning: operation on 'p' may be undefined
super-intel.c:284: warning: operation on 'p' may be undefined
super-intel.c:284: warning: operation on 'p' may be undefined

The swap macros can evaluate their argument multiple times.
---
 super-intel.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Index: super-intel.c
===================================================================
--- super-intel.c.orig
+++ super-intel.c
@@ -271,8 +271,10 @@ static __u32 __gen_imsm_checksum(struct 
 	__u32 *p = (__u32 *) mpb;
 	__u32 sum = 0;
 
-        while (end--)
-                sum += __le32_to_cpu(*p++);
+        while (end--) {
+                sum += __le32_to_cpu(*p);
+		p++;
+	}
 
         return sum - __le32_to_cpu(mpb->check_sum);
 }
openSUSE Build Service is sponsored by