From: Dan Carpenter <dan.carpenter@oracle.com>
To: Colin Ian King <colin.i.king@gmail.com>
Cc: Rick Chang <rick.chang@mediatek.com>,
Bin Liu <bin.liu@mediatek.com>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Matthias Brugger <matthias.bgg@gmail.com>,
linux-media@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-mediatek@lists.infradead.org,
kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] media: mtk-jpeg: remove redundant initialization of variable plane_fmt
Date: Wed, 2 Feb 2022 08:00:46 +0300 [thread overview]
Message-ID: <20220202050046.GR1951@kadam> (raw)
In-Reply-To: <20220130231111.8563-1-colin.i.king@gmail.com>
On Sun, Jan 30, 2022 at 11:11:11PM +0000, Colin Ian King wrote:
> The variable plane_fmt is being initialized with a value that is never
> read, it is being re-assigned a new value on each iteration of a for
> loop. The initialization is redundant and can be removed.
>
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
> ---
> drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c b/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c
> index f332beb06d51..b334bbb2e682 100644
> --- a/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c
> +++ b/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c
> @@ -681,7 +681,7 @@ static int mtk_jpeg_buf_prepare(struct vb2_buffer *vb)
> {
> struct mtk_jpeg_ctx *ctx = vb2_get_drv_priv(vb->vb2_queue);
> struct mtk_jpeg_q_data *q_data = NULL;
> - struct v4l2_plane_pix_format plane_fmt = {};
> + struct v4l2_plane_pix_format plane_fmt;
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
This one is fine, but keep in mind that the other reason people do = {}
assignments is to zero out struct holes. The assignment inside the loop
will not do that.
regards,
dan carpenter
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
prev parent reply other threads:[~2022-02-02 5:04 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-30 23:11 [PATCH] media: mtk-jpeg: remove redundant initialization of variable plane_fmt Colin Ian King
2022-02-02 5:00 ` Dan Carpenter [this message]
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=20220202050046.GR1951@kadam \
--to=dan.carpenter@oracle.com \
--cc=bin.liu@mediatek.com \
--cc=colin.i.king@gmail.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=matthias.bgg@gmail.com \
--cc=mchehab@kernel.org \
--cc=rick.chang@mediatek.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).