linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hans Verkuil <hverkuil@xs4all.nl>
To: Sakari Ailus <sakari.ailus@linux.intel.com>, linux-media@vger.kernel.org
Subject: Re: [PATCH 6/6] smiapp: Avoid fall-through in switch
Date: Thu, 12 Sep 2019 15:17:54 +0200	[thread overview]
Message-ID: <74b049a8-9f03-c7c0-94db-0a1e5db4d07a@xs4all.nl> (raw)
In-Reply-To: <20190819124728.10511-7-sakari.ailus@linux.intel.com>

On 8/19/19 2:47 PM, Sakari Ailus wrote:
> Remove switch fall-through cases in the driver.
> 
> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
> ---
>  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:
> 


  reply	other threads:[~2019-09-12 13:18 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-19 12:47 [PATCH 0/6] Provide a serialisation mechanism for subdev ops Sakari Ailus
2019-08-19 12:47 ` [PATCH 1/6] v4l: subdev: Set sd->devnode before registering the subdev Sakari Ailus
2019-09-12 12:40   ` Hans Verkuil
2019-08-19 12:47 ` [PATCH 2/6] v4l: subdev: Provide a locking scheme for subdev operations Sakari Ailus
2019-09-12 13:11   ` Hans Verkuil
2019-09-12 13:24     ` Sakari Ailus
2019-08-19 12:47 ` [PATCH 3/6] smiapp: Error handling cleanups and fixes Sakari Ailus
2019-08-19 12:47 ` [PATCH 4/6] smiapp: Rely on V4L2 sub-device framework to do the locking Sakari Ailus
2019-08-19 12:47 ` [PATCH 5/6] smiapp: Remove the active field from sensor's struct Sakari Ailus
2019-08-19 12:47 ` [PATCH 6/6] smiapp: Avoid fall-through in switch Sakari Ailus
2019-09-12 13:17   ` Hans Verkuil [this message]
2019-09-13  6:50     ` Sakari Ailus
2019-09-13  6:47   ` [PATCH v2 " Sakari Ailus
2019-09-13  6:52     ` Hans Verkuil

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=74b049a8-9f03-c7c0-94db-0a1e5db4d07a@xs4all.nl \
    --to=hverkuil@xs4all.nl \
    --cc=linux-media@vger.kernel.org \
    --cc=sakari.ailus@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).