Skip to contentSkip to conversation

KVM: s390: fix fallthrough annotation

PATCH David Hildenbrand 1 participant 1 message Mar 5, 2018 1 message not in the archive s390

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

David Hildenbrand

author Reviewed-by
#1 lore raw
Quoted 43 lines · Christian Borntraeger

From: Sebastian Ott <[email protected]>

A case statement in kvm_s390_shadow_tables uses fallthrough annotations which are not recognized by gcc because they are hidden within a block. Move these annotations out of the block to fix (W=1) warnings like below:

arch/s390/kvm/gaccess.c: In function 'kvm_s390_shadow_tables':
arch/s390/kvm/gaccess.c:1029:26: warning: this statement may fall through [-Wimplicit-fallthrough=]

  case ASCE_TYPE_REGION1: {
                          ^
---
 arch/s390/kvm/gaccess.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)
arch/s390/kvm/gaccess.c +2 -4
index c24bfa72baf7..8e2b8647ee12 100644
@@ -1050,8 +1050,7 @@ static int kvm_s390_shadow_tables(struct gmap *sg, unsigned long saddr,
 		rc = gmap_shadow_r2t(sg, saddr, rfte.val, *fake);
 		if (rc)
 			return rc;
-		/* fallthrough */
-	}
+	} /* fallthrough */
 	case ASCE_TYPE_REGION2: {
 		union region2_table_entry rste;
 
@@ -1077,8 +1076,7 @@ static int kvm_s390_shadow_tables(struct gmap *sg, unsigned long saddr,
 		rc = gmap_shadow_r3t(sg, saddr, rste.val, *fake);
 		if (rc)
 			return rc;
-		/* fallthrough */
-	}
+	} /* fallthrough */
 	case ASCE_TYPE_REGION3: {
 		union region3_table_entry rtte;
 

arch/s390/kvm/gaccess.c static int kvm_s390_shadow_tables(struct gmap *sg, unsigned long saddr, · line 1117

Quoted 9 lines
arch/s390/kvm/gaccess.c +1 -2
@@ -1113,8 +1111,7 @@ static int kvm_s390_shadow_tables(struct gmap *sg, unsigned long saddr,
 		rc = gmap_shadow_sgt(sg, saddr, rtte.val, *fake);
 		if (rc)
 			return rc;
-		/* fallthrough */
-	}
+	} /* fallthrough */
 	case ASCE_TYPE_SEGMENT: {
 		union segment_table_entry ste;
 
Signature · 3 lines
Thanks,

David / dhildenb