linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: "Rui Miguel Silva" <rmfrfs@gmail.com>
To: <trix@redhat.com>, <laurent.pinchart@ideasonboard.com>,
	<slongerbeam@gmail.com>, <p.zabel@pengutronix.de>,
	<mchehab@kernel.org>, <gregkh@linuxfoundation.org>,
	<shawnguo@kernel.org>, <s.hauer@pengutronix.de>,
	<kernel@pengutronix.de>, <festevam@gmail.com>,
	<linux-imx@nxp.com>
Cc: <linux-media@vger.kernel.org>, <linux-staging@lists.linux.dev>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] media: imx: imx7_mipi_csis: convert some switch cases to the default
Date: Tue, 01 Jun 2021 12:03:59 +0100	[thread overview]
Message-ID: <CBS8CSIHJTXJ.1HWQ3AWYCC1V8@arch-thunder> (raw)
In-Reply-To: <20210531174300.2594109-1-trix@redhat.com>

Hi Tom,
Thanks for the patch.

On Mon May 31, 2021 at 6:43 PM WEST,  wrote:

> From: Tom Rix <trix@redhat.com>
>
> Static analysis reports this false positive
> imx7-mipi-csis.c:1027:2: warning: 4th function call argument is
>   an uninitialized value
>
> The variable 'align' is falsely reported as uninitialized.
> Even though all the cases are covered in the
> 	switch (csis_fmt->width % 8) {
>
> Because there is no default case, it is reported as uninialized.
>
> Improve the switch by converting the most numerous set of cases
> to the default and silence the false positive.
>
> Signed-off-by: Tom Rix <trix@redhat.com>

It solves that, looks good to me.

Reviewed-by: Rui Miguel Silva <rmfrfs@gmail.com>

------
Cheers,
     Rui

> ---
>  drivers/staging/media/imx/imx7-mipi-csis.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/staging/media/imx/imx7-mipi-csis.c b/drivers/staging/media/imx/imx7-mipi-csis.c
> index d573f3475d28..330f283030ec 100644
> --- a/drivers/staging/media/imx/imx7-mipi-csis.c
> +++ b/drivers/staging/media/imx/imx7-mipi-csis.c
> @@ -1016,10 +1016,8 @@ static int mipi_csis_set_fmt(struct v4l2_subdev *sd,
>  	case 6:
>  		align = 2;
>  		break;
> -	case 1:
> -	case 3:
> -	case 5:
> -	case 7:
> +	default:
> +		/* 1, 3, 5, 7 */
>  		align = 3;
>  		break;
>  	}
> -- 
> 2.26.3




_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2021-06-01 11:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-31 17:43 [PATCH] media: imx: imx7_mipi_csis: convert some switch cases to the default trix
2021-06-01 11:03 ` Rui Miguel Silva [this message]
2021-06-01 12:46 ` Laurent Pinchart

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=CBS8CSIHJTXJ.1HWQ3AWYCC1V8@arch-thunder \
    --to=rmfrfs@gmail.com \
    --cc=festevam@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=kernel@pengutronix.de \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=mchehab@kernel.org \
    --cc=p.zabel@pengutronix.de \
    --cc=s.hauer@pengutronix.de \
    --cc=shawnguo@kernel.org \
    --cc=slongerbeam@gmail.com \
    --cc=trix@redhat.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).