Skip to contentSkip to conversation

radeon: add fallthrough annotation

PATCH In review Eric Engestrom 2 participants 3 messages Jul 30, 2017 – Aug 1, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 radeon: add fallthrough annotation

GCC 7 started warning when a switch case has neither a break nor a "fallthrough" comment.
Let's be explicit that we meant to fall through here.

---
 radeon/radeon_surface.c | 1 +
 1 file changed, 1 insertion(+)
radeon/radeon_surface.c +1 -0
index 965be24c..04df77d6 100644
@@ -2503,6 +2503,7 @@ static int radeon_surface_sanity(struct radeon_surface_manager *surf_man,
         if (surf->npix_y > 1) {
             return -EINVAL;
         }
+        /* fallthrough */
     case RADEON_SURF_TYPE_2D:
         if (surf->npix_z > 1) {
             return -EINVAL;
Signature · 7 lines
Cheers,
  Eric

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Reviewed-by on v1 1/1
#1 lore raw
Quoted 15 lines · Eric Engestrom

GCC 7 started warning when a switch case has neither a break nor a "fallthrough" comment.
Let's be explicit that we meant to fall through here.

---
 radeon/radeon_surface.c | 1 +
 1 file changed, 1 insertion(+)
radeon/radeon_surface.c +0 -0
index 965be24c..04df77d6 100644

radeon/radeon_surface.c static int radeon_surface_sanity(struct radeon_surface_manager *surf_man, · line 2509

Quoted 7 lines
radeon/radeon_surface.c +1 -0
@@ -2503,6 +2503,7 @@ static int radeon_surface_sanity(struct radeon_surface_manager *surf_man,
         if (surf->npix_y > 1) {
             return -EINVAL;
         }
+        /* fallthrough */
     case RADEON_SURF_TYPE_2D:
         if (surf->npix_z > 1) {
             return -EINVAL;

P.S. Patches touching the radeon (and amdgpu) directory should (also) be sent to the amd-gfx mailing list for review.

Signature · 6 lines
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#2 lore raw
Quoted 10 lines · Michel Dänzer
Quoted 9 lines · Eric Engestrom

GCC 7 started warning when a switch case has neither a break nor a "fallthrough" comment.
Let's be explicit that we meant to fall through here.

---
 radeon/radeon_surface.c | 1 +
 1 file changed, 1 insertion(+)
Quoted 15 lines

radeon/radeon_surface.c static int radeon_surface_sanity(struct radeon_surface_manager *surf_man, · line 2509

Quoted 13 lines
radeon/radeon_surface.c +1 -0
index 965be24c..04df77d6 100644
@@ -2503,6 +2503,7 @@ static int radeon_surface_sanity(struct radeon_surface_manager *surf_man,
         if (surf->npix_y > 1) {
             return -EINVAL;
         }
+        /* fallthrough */
     case RADEON_SURF_TYPE_2D:
         if (surf->npix_z > 1) {
             return -EINVAL;

Thanks!

Quoted 3 lines

P.S. Patches touching the radeon (and amdgpu) directory should (also) be sent to the amd-gfx mailing list for review.

Sure, making a note.

Do we want a scripts/get_(maintainer|reviewer).pl for libdrm?
_______________________________________________
dri-devel mailing list [email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel