diff mbox

[libdrm] radeon: add fallthrough annotation

Message ID 20170730203416.4232-1-eric@engestrom.ch (mailing list archive)
State New, archived
Headers show

Commit Message

Eric Engestrom July 30, 2017, 8:34 p.m. UTC
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.

Signed-off-by: Eric Engestrom <eric@engestrom.ch>
---
 radeon/radeon_surface.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Michel Dänzer July 31, 2017, 3:05 a.m. UTC | #1
On 31/07/17 05:34 AM, Eric Engestrom wrote:
> 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.
> 
> Signed-off-by: Eric Engestrom <eric@engestrom.ch>
> ---
>  radeon/radeon_surface.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/radeon/radeon_surface.c b/radeon/radeon_surface.c
> index 965be24c..04df77d6 100644
> --- a/radeon/radeon_surface.c
> +++ b/radeon/radeon_surface.c
> @@ -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;
> 

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>


P.S. Patches touching the radeon (and amdgpu) directory should (also) be
sent to the amd-gfx mailing list for review.
Eric Engestrom Aug. 1, 2017, 7:55 a.m. UTC | #2
On Monday, 2017-07-31 03:05:47 +0000, Michel Dänzer wrote:
> On 31/07/17 05:34 AM, Eric Engestrom wrote:
> > 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.
> > 
> > Signed-off-by: Eric Engestrom <eric@engestrom.ch>
> > ---
> >  radeon/radeon_surface.c | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/radeon/radeon_surface.c b/radeon/radeon_surface.c
> > index 965be24c..04df77d6 100644
> > --- a/radeon/radeon_surface.c
> > +++ b/radeon/radeon_surface.c
> > @@ -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;
> > 
> 
> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>

Thanks!

> 
> 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?
diff mbox

Patch

diff --git a/radeon/radeon_surface.c b/radeon/radeon_surface.c
index 965be24c..04df77d6 100644
--- a/radeon/radeon_surface.c
+++ b/radeon/radeon_surface.c
@@ -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;