Re: [PATCH 6/6] smiapp: Avoid fall-through in switch

2019-09-12 Thread Sakari Ailus
On Thu, Sep 12, 2019 at 03:17:54PM +0200, Hans Verkuil wrote:
> On 8/19/19 2:47 PM, Sakari Ailus wrote:
> > Remove switch fall-through cases in the driver.
> > 
> > Signed-off-by: Sakari Ailus 
> > ---
> >  drivers/media/i2c/smiapp/smiapp-core.c | 11 +--
> >  1 file changed, 5 insertions(+), 6 deletions(-)
> > 
> > diff --git a/drivers/media/i2c/smiapp/smiapp-core.c 
> > b/drivers/media/i2c/smiapp/smiapp-core.c
> > index 76d7d204ec17..61de8cdccc4b 100644
> > --- a/drivers/media/i2c/smiapp/smiapp-core.c
> > +++ b/drivers/media/i2c/smiapp/smiapp-core.c
> > @@ -1674,13 +1674,12 @@ static void smiapp_propagate(struct v4l2_subdev 
> > *subdev,
> > sensor->binning_vertical = 1;
> > }
> > }
> > -   /* Fall through */
> > -   case V4L2_SEL_TGT_COMPOSE:
> 
> This doesn't look right: for this target you now enter the default case.
> 
> You probably want to do:
> 
>   break;
>   case V4L2_SEL_TGT_COMPOSE:
>   break;

Yes; thanks. I've just sent v2.

-- 
Sakari Ailus
sakari.ai...@linux.intel.com


Re: [PATCH 6/6] smiapp: Avoid fall-through in switch

2019-09-12 Thread Hans Verkuil
On 8/19/19 2:47 PM, Sakari Ailus wrote:
> Remove switch fall-through cases in the driver.
> 
> Signed-off-by: Sakari Ailus 
> ---
>  drivers/media/i2c/smiapp/smiapp-core.c | 11 +--
>  1 file changed, 5 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/media/i2c/smiapp/smiapp-core.c 
> b/drivers/media/i2c/smiapp/smiapp-core.c
> index 76d7d204ec17..61de8cdccc4b 100644
> --- a/drivers/media/i2c/smiapp/smiapp-core.c
> +++ b/drivers/media/i2c/smiapp/smiapp-core.c
> @@ -1674,13 +1674,12 @@ static void smiapp_propagate(struct v4l2_subdev 
> *subdev,
>   sensor->binning_vertical = 1;
>   }
>   }
> - /* Fall through */
> - case V4L2_SEL_TGT_COMPOSE:

This doesn't look right: for this target you now enter the default case.

You probably want to do:

break;
case V4L2_SEL_TGT_COMPOSE:
break;

Regards,

Hans

> - *crops[SMIAPP_PAD_SRC] = *comp;
>   break;
>   default:
> - BUG();
> + WARN_ON(1);
> + return;
>   }
> + *crops[SMIAPP_PAD_SRC] = *comp;
>  }
>  
>  static const struct smiapp_csi_data_format
> @@ -2062,7 +2061,7 @@ static int __smiapp_sel_supported(struct v4l2_subdev 
> *subdev,
>   && sensor->limits[SMIAPP_LIMIT_SCALING_CAPABILITY]
>   != SMIAPP_SCALING_CAPABILITY_NONE)
>   return 0;
> - /* Fall through */
> + return -EINVAL;
>   default:
>   return -EINVAL;
>   }
> @@ -2716,7 +2715,7 @@ static struct smiapp_hwconfig 
> *smiapp_get_hwconfig(struct device *dev)
>   case 180:
>   hwcfg->module_board_orient =
>   SMIAPP_MODULE_BOARD_ORIENT_180;
> - /* Fall through */
> + break;
>   case 0:
>   break;
>   default:
>