Skip to contentSkip to conversation

IMSM: do not use comma expression for simple assignments

PATCH In review Jürg Billeter 2 participants 2 messages Aug 6, 2014 – Dec 11, 2014 MD RAID

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 IMSM: do not use comma expression for simple assignments

Fixes build with gcc 4.9.

error: right-hand operand of comma expression has no effect
snprintf((char *) spare->sig, MAX_SIGNATURE_LENGTH, ^

---
 super-intel.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
super-intel.c +6 -6
index e28ac7d..f24d101 100644
@@ -5069,13 +5069,13 @@ static int write_super_imsm_spares(struct intel_super *super, int doclose)
 	__u32 sum;
 	struct dl *d;
 
-	spare->mpb_size = __cpu_to_le32(sizeof(struct imsm_super)),
-	spare->generation_num = __cpu_to_le32(1UL),
+	spare->mpb_size = __cpu_to_le32(sizeof(struct imsm_super));
+	spare->generation_num = __cpu_to_le32(1UL);
 	spare->attributes = MPB_ATTRIB_CHECKSUM_VERIFY;
-	spare->num_disks = 1,
-	spare->num_raid_devs = 0,
-	spare->cache_size = mpb->cache_size,
-	spare->pwr_cycle_count = __cpu_to_le32(1),
+	spare->num_disks = 1;
+	spare->num_raid_devs = 0;
+	spare->cache_size = mpb->cache_size;
+	spare->pwr_cycle_count = __cpu_to_le32(1);
 
 	snprintf((char *) spare->sig, MAX_SIGNATURE_LENGTH,
 		 MPB_SIGNATURE MPB_VERSION_RAID0);
Signature · 6 lines
2.0.4

--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#1 lore raw
Quoted 26 lines · Jürg Billeter

Fixes build with gcc 4.9.

error: right-hand operand of comma expression has no effect
snprintf((char *) spare->sig, MAX_SIGNATURE_LENGTH, ^

---
 super-intel.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
super-intel.c +2 -3
index e28ac7d..f24d101 100644
@@ -5069,13 +5069,13 @@ static int write_super_imsm_spares(struct intel_super *super, int doclose)
 	__u32 sum;
 	struct dl *d;
 
-	spare->mpb_size = __cpu_to_le32(sizeof(struct imsm_super)),
-	spare->generation_num = __cpu_to_le32(1UL),
+	spare->mpb_size = __cpu_to_le32(sizeof(struct imsm_super));
+	spare->generation_num = __cpu_to_le32(1UL);
 	spare->attributes = MPB_ATTRIB_CHECKSUM_VERIFY;
-	spare->num_disks = 1,

super-intel.c static int write_super_imsm_spares(struct intel_super *super, int doclose) · line 5081

Quoted 10 lines
super-intel.c +4 -3
-	spare->num_raid_devs = 0,
-	spare->cache_size = mpb->cache_size,
-	spare->pwr_cycle_count = __cpu_to_le32(1),
+	spare->num_disks = 1;
+	spare->num_raid_devs = 0;
+	spare->cache_size = mpb->cache_size;
+	spare->pwr_cycle_count = __cpu_to_le32(1);
 
 	snprintf((char *) spare->sig, MAX_SIGNATURE_LENGTH,
 		 MPB_SIGNATURE MPB_VERSION_RAID0);

Hi Neil,

We verified that this patch indeed is needed to build mdadm with gcc 4.9. Can you apply it?

Thanks,
Artur

--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html