From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailout3.samsung.com (mailout3.samsung.com [203.254.224.33]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 94F654C626 for ; Tue, 26 Dec 2023 06:34:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=samsung.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="kbZuLVhK" Received: from epcas5p2.samsung.com (unknown [182.195.41.40]) by mailout3.samsung.com (KnoxPortal) with ESMTP id 20231226063431epoutp034eef4927c03802a45ac78aeae47e8915~kTiMhI3M61051210512epoutp03i for ; Tue, 26 Dec 2023 06:34:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout3.samsung.com 20231226063431epoutp034eef4927c03802a45ac78aeae47e8915~kTiMhI3M61051210512epoutp03i DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1703572471; bh=QTB84M50WFYIDe/+9MiAYey4svYfPT1DbPQhlDkmeEg=; h=From:To:Cc:In-Reply-To:Subject:Date:References:From; b=kbZuLVhKqJwYE/hpR5vnjGHPphn4VbfDxaEsQKATm7D8KKFDh34UWA/9rQ4Cht1AT ochOcunOOALMlw55dzxNmYJYCa9XW1ER6WSHCAbo1VBnNo+y8HFXbCQF5Qtwvb4saP wRkjBS/cSpEeF893Ii14p0bYbBEgl9VJJiJnakoc= Received: from epsnrtp3.localdomain (unknown [182.195.42.164]) by epcas5p2.samsung.com (KnoxPortal) with ESMTP id 20231226063431epcas5p2a1d9081c0516f4d5e4d0375bc170e60b~kTiL28fQj2204722047epcas5p20; Tue, 26 Dec 2023 06:34:31 +0000 (GMT) Received: from epsmgec5p1-new.samsung.com (unknown [182.195.38.181]) by epsnrtp3.localdomain (Postfix) with ESMTP id 4SzlP13BZBz4x9Pp; Tue, 26 Dec 2023 06:34:29 +0000 (GMT) Received: from epcas5p4.samsung.com ( [182.195.41.42]) by epsmgec5p1-new.samsung.com (Symantec Messaging Gateway) with SMTP id A8.F1.19369.5F37A856; Tue, 26 Dec 2023 15:34:29 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas5p2.samsung.com (KnoxPortal) with ESMTPA id 20231226062756epcas5p22bc39bd25d403a9bed16c220f82c4a83~kTccWazlP0679806798epcas5p21; Tue, 26 Dec 2023 06:27:56 +0000 (GMT) Received: from epsmgmcp1.samsung.com (unknown [182.195.42.82]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20231226062756epsmtrp1bf1ad9b6da87585b49f8d077f6cdf6ff~kTccVuCsa1947119471epsmtrp10; Tue, 26 Dec 2023 06:27:56 +0000 (GMT) X-AuditID: b6c32a50-9e1ff70000004ba9-de-658a73f55bd7 Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgmcp1.samsung.com (Symantec Messaging Gateway) with SMTP id A8.C7.18939.C627A856; Tue, 26 Dec 2023 15:27:56 +0900 (KST) Received: from FDSFTE308 (unknown [107.122.81.79]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20231226062754epsmtip29f5e872132462de8780110b3955da104~kTcasjk3e0864408644epsmtip2g; Tue, 26 Dec 2023 06:27:54 +0000 (GMT) From: "Aakarsh Jain" To: "'Krzysztof Kozlowski'" , "'Marek Szyprowski'" , "'Andrzej Hajda'" , "'Mauro Carvalho Chehab'" Cc: , , "'Smitha T Murthy'" , , , In-Reply-To: <20231224-n-s5p-mfc-const-v1-9-a3b246470fe4@linaro.org> Subject: RE: [PATCH 09/15] media: s5p-mfc: constify s5p_mfc_fmt structures Date: Tue, 26 Dec 2023 11:57:53 +0530 Message-ID: <15d401da37c4$a9dece80$fd9c6b80$@samsung.com> Precedence: bulk X-Mailing-List: linux-samsung-soc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQKOGlHY6WxiJqLoSx78067AznjgmAGjTMXtAfUJOwGvNpHr8A== Content-Language: en-in X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrBJsWRmVeSWpSXmKPExsWy7bCmlu7X4q5Ug7dPhC3uL/7MYrH39VZ2 i02Pr7FaLJsdZHF51xw2i54NW1ktZpzfx2Sx9shddotlm/4wWbQ0LmF14PLYOesuu8fiPS+Z PDat6mTzuHNtD5vH5iX1Hn1bVjF6/H39is3j8ya5AI6obJuM1MSU1CKF1Lzk/JTMvHRbJe/g eOd4UzMDQ11DSwtzJYW8xNxUWyUXnwBdt8wcoBOVFMoSc0qBQgGJxcVK+nY2RfmlJakKGfnF JbZKqQUpOQUmBXrFibnFpXnpenmpJVaGBgZGpkCFCdkZG884FezRqPh78Tx7A+N6pS5GTg4J AROJpjMzGLsYuTiEBPYwSsw7dZEVJCEk8IlRYm6bC0QCyP74vIcdpqNx01wmiMRORomObZOY IZznjBIP/i8Ea2cT0Je4f6qHFSQhInCOUWJb/xSwFmaBm4wSx97MZAap4hRwkfiz6iRYh7CA l8TD3xfYuhg5OFgEVCV23wwGCfMKWErM+zmBFcIWlDg58wkLiM0soC2xbOFrZoiTFCR+Pl0G ViMi4CSxcMltJogacYmjP3vArpMQOMAhcWLKYqgfXCT6Tt5jhLCFJV4d3wIVl5J42d8GZSdL PF70EmpBjsT6PVNYIGx7iQNX5rCA3MksoCmxfpc+RFhWYuqpdVB7+SR6fz9hgojzSuyYB2Or Scy584MVwpaROLx6KeMERqVZSF6bheS1WUhemIWwbQEjyypGqdSC4tz01GTTAkPdvNRyeIwn 5+duYgQnYa2AHYyrN/zVO8TIxMF4iFGCg1lJhFdWsSNViDclsbIqtSg/vqg0J7X4EKMpMLwn MkuJJucD80BeSbyhiaWBiZmZmYmlsZm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19ke9IXPQm6M/F76vYvzh/O9Llc69RflCX97e3hvc5zp+1uPPrgqCzv36gVdy/2dVhcX7NO 7+3HWS9XF57p3ZCXvOa4e1XbbMYV/6PWbQ/Jla+NsLpv1GS5zCTPRLTunkGO0x/t2LSC81oP n0pOueLxxbPqg3l0zffbxzfNXsJV5DzXb+cKwSZ7npcfHiUr1XT49JkZHjs8eZKys+HmoFli X9rjL21jOly55Nwky06l3+eW7VCwNft9cRLzC8FjpjK14fzi0XdV1hXebo16yq9wanK+ifbm p5eD5/8K0tNceXBdMPu9QzOn7y9RNLzHae8eekZ26ta/xeufHLr36yx7wwslluKMREMt5qLi RADyq//SMAMAAA== X-CMS-MailID: 20231226062756epcas5p22bc39bd25d403a9bed16c220f82c4a83 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-Sendblock-Type: REQ_APPROVE CMS-TYPE: 105P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20231224154446epcas5p2b08000b76b8a94063b164a55e5e8a999 References: <20231224-n-s5p-mfc-const-v1-0-a3b246470fe4@linaro.org> <20231224-n-s5p-mfc-const-v1-9-a3b246470fe4@linaro.org> > -----Original Message----- > From: Krzysztof Kozlowski > Sent: 24 December 2023 21:14 > To: Marek Szyprowski ; Andrzej Hajda > ; Mauro Carvalho Chehab > > Cc: Aakarsh Jain ; linux-fsd=40tesla.coma; li= nux- > samsung-soc=40vger.kernel.org; Smitha T Murthy > ; linux-arm-kernel=40lists.infradead.org; linu= x- > media=40vger.kernel.org; linux-kernel=40vger.kernel.org; Krzysztof Kozlow= ski > > Subject: =5BPATCH 09/15=5D media: s5p-mfc: constify s5p_mfc_fmt structure= s >=20 > Static =22s5p_mfc_fmt=22 structures are not modified by the driver, so th= ey can > be made const for code safety. >=20 > Signed-off-by: Krzysztof Kozlowski > --- > drivers/media/platform/samsung/s5p-mfc/s5p_mfc_common.h =7C 4 ++-- > drivers/media/platform/samsung/s5p-mfc/s5p_mfc_dec.c =7C 6 +++--- > drivers/media/platform/samsung/s5p-mfc/s5p_mfc_enc.c =7C 8 ++++---- > 3 files changed, 9 insertions(+), 9 deletions(-) >=20 > diff --git a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_common.h > b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_common.h > index fa556f27fa06..e9283020070e 100644 > --- a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_common.h > +++ b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_common.h > =40=40 -633,8 +633,8 =40=40 struct s5p_mfc_ctx =7B > unsigned int int_err; > wait_queue_head_t queue; >=20 > - struct s5p_mfc_fmt *src_fmt; > - struct s5p_mfc_fmt *dst_fmt; > + const struct s5p_mfc_fmt *src_fmt; > + const struct s5p_mfc_fmt *dst_fmt; >=20 > struct vb2_queue vq_src; > struct vb2_queue vq_dst; > diff --git a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_dec.c > b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_dec.c > index 4dbe8792ac3d..2f664c7e9e4c 100644 > --- a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_dec.c > +++ b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_dec.c > =40=40 -27,7 +27,7 =40=40 > =23include =22s5p_mfc_opr.h=22 > =23include =22s5p_mfc_pm.h=22 >=20 > -static struct s5p_mfc_fmt formats=5B=5D =3D =7B > +static const struct s5p_mfc_fmt formats=5B=5D =3D =7B > =7B > .fourcc =3D V4L2_PIX_FMT_NV12MT_16X16, > .codec_mode =3D S5P_MFC_CODEC_NONE, > =40=40 -163,7 +163,7 =40=40 static struct s5p_mfc_fmt formats=5B=5D =3D = =7B =23define > NUM_FORMATS ARRAY_SIZE(formats) >=20 > /* Find selected format description */ > -static struct s5p_mfc_fmt *find_format(struct v4l2_format *f, unsigned i= nt > t) > +static const struct s5p_mfc_fmt *find_format(struct v4l2_format *f, > +unsigned int t) > =7B > unsigned int i; >=20 > =40=40 -387,7 +387,7 =40=40 static int vidioc_g_fmt(struct file *file, vo= id *priv, > struct v4l2_format *f) static int vidioc_try_fmt(struct file *file, void= *priv, > struct v4l2_format *f) =7B > struct s5p_mfc_dev *dev =3D video_drvdata(file); > - struct s5p_mfc_fmt *fmt; > + const struct s5p_mfc_fmt *fmt; >=20 > mfc_debug(2, =22Type is %d=5Cn=22, f->type); > if (f->type =3D=3D V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) =7B diff --git > a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_enc.c > b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_enc.c > index 4b4c129c09e7..d6a4b9c701eb 100644 > --- a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_enc.c > +++ b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_enc.c > =40=40 -30,7 +30,7 =40=40 > =23define DEF_SRC_FMT_ENC V4L2_PIX_FMT_NV12M > =23define DEF_DST_FMT_ENC V4L2_PIX_FMT_H264 >=20 > -static struct s5p_mfc_fmt formats=5B=5D =3D =7B > +static const struct s5p_mfc_fmt formats=5B=5D =3D =7B > =7B > .fourcc =3D V4L2_PIX_FMT_NV12MT_16X16, > .codec_mode =3D S5P_MFC_CODEC_NONE, > =40=40 -97,7 +97,7 =40=40 static struct s5p_mfc_fmt formats=5B=5D =3D =7B= =7D; >=20 > =23define NUM_FORMATS ARRAY_SIZE(formats) -static struct s5p_mfc_fmt > *find_format(struct v4l2_format *f, unsigned int t) > +static const struct s5p_mfc_fmt *find_format(struct v4l2_format *f, > +unsigned int t) > =7B > unsigned int i; >=20 > =40=40 -1394,7 +1394,7 =40=40 static int vidioc_g_fmt(struct file *file, = void *priv, > struct v4l2_format *f) static int vidioc_try_fmt(struct file *file, void= *priv, > struct v4l2_format *f) =7B > struct s5p_mfc_dev *dev =3D video_drvdata(file); > - struct s5p_mfc_fmt *fmt; > + const struct s5p_mfc_fmt *fmt; > struct v4l2_pix_format_mplane *pix_fmt_mp =3D &f->fmt.pix_mp; >=20 > if (f->type =3D=3D V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) =7B =40=40 - > 2355,7 +2355,7 =40=40 static const struct v4l2_ioctl_ops s5p_mfc_enc_ioct= l_ops > =3D =7B > .vidioc_unsubscribe_event =3D v4l2_event_unsubscribe, =7D; >=20 > -static int check_vb_with_fmt(struct s5p_mfc_fmt *fmt, struct vb2_buffer > *vb) > +static int check_vb_with_fmt(const struct s5p_mfc_fmt *fmt, struct > +vb2_buffer *vb) > =7B > int i; >=20 >=20 > -- > 2.34.1 Reviewed-by: Aakarsh Jain Thanks=21 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7C363C46CD4 for ; Tue, 26 Dec 2023 06:35:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:References:MIME-Version:Message-ID:Date :Subject:In-Reply-To:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=wn0FiwCUK/yuUr4YzUn7j3uE0nHMeosdic3SVBxRWeg=; b=w1XHiGj/jSzh/S 4Z+lhFlxQ3KhhQkfpnKbmfylrunBmDdB8dWkPYx9gIWxc/6mN5dzlto+jmbpa7mogJwR+Rx1em40p 48ZHNJe4eBKwYV1DHvvvcoirMVEnHFv1OfR6RQHHWg5k7KpB0UvleWo2LNxoXSEYdPO9cE1BZjHQw D8w8pd9KTBySshfh8kVGu9kGOPrFJ4F14vRc+olKzrhj4z3groUas90lNRcIDbzZayKaT+XtVGxl1 93l64B0JB87s5gGsMeyeg+SJLMTXe8h34e5SocO8fC4PPvxVYgEHgUwHpbCoECSRsnKygkF6/UHkb Mr/RdmDw5pkRLLkbmKVQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rI11W-00BoOe-1R; Tue, 26 Dec 2023 06:34:42 +0000 Received: from mailout4.samsung.com ([203.254.224.34]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rI11R-00BoLd-0Q for linux-arm-kernel@lists.infradead.org; Tue, 26 Dec 2023 06:34:40 +0000 Received: from epcas5p2.samsung.com (unknown [182.195.41.40]) by mailout4.samsung.com (KnoxPortal) with ESMTP id 20231226063431epoutp04d5413cde5995f0b262b705fd6aa4ec9d~kTiMW4_981396713967epoutp04N for ; Tue, 26 Dec 2023 06:34:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout4.samsung.com 20231226063431epoutp04d5413cde5995f0b262b705fd6aa4ec9d~kTiMW4_981396713967epoutp04N DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1703572471; bh=QTB84M50WFYIDe/+9MiAYey4svYfPT1DbPQhlDkmeEg=; h=From:To:Cc:In-Reply-To:Subject:Date:References:From; b=kbZuLVhKqJwYE/hpR5vnjGHPphn4VbfDxaEsQKATm7D8KKFDh34UWA/9rQ4Cht1AT ochOcunOOALMlw55dzxNmYJYCa9XW1ER6WSHCAbo1VBnNo+y8HFXbCQF5Qtwvb4saP wRkjBS/cSpEeF893Ii14p0bYbBEgl9VJJiJnakoc= Received: from epsnrtp3.localdomain (unknown [182.195.42.164]) by epcas5p2.samsung.com (KnoxPortal) with ESMTP id 20231226063431epcas5p2a1d9081c0516f4d5e4d0375bc170e60b~kTiL28fQj2204722047epcas5p20; Tue, 26 Dec 2023 06:34:31 +0000 (GMT) Received: from epsmgec5p1-new.samsung.com (unknown [182.195.38.181]) by epsnrtp3.localdomain (Postfix) with ESMTP id 4SzlP13BZBz4x9Pp; Tue, 26 Dec 2023 06:34:29 +0000 (GMT) Received: from epcas5p4.samsung.com ( [182.195.41.42]) by epsmgec5p1-new.samsung.com (Symantec Messaging Gateway) with SMTP id A8.F1.19369.5F37A856; Tue, 26 Dec 2023 15:34:29 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas5p2.samsung.com (KnoxPortal) with ESMTPA id 20231226062756epcas5p22bc39bd25d403a9bed16c220f82c4a83~kTccWazlP0679806798epcas5p21; Tue, 26 Dec 2023 06:27:56 +0000 (GMT) Received: from epsmgmcp1.samsung.com (unknown [182.195.42.82]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20231226062756epsmtrp1bf1ad9b6da87585b49f8d077f6cdf6ff~kTccVuCsa1947119471epsmtrp10; Tue, 26 Dec 2023 06:27:56 +0000 (GMT) X-AuditID: b6c32a50-9e1ff70000004ba9-de-658a73f55bd7 Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgmcp1.samsung.com (Symantec Messaging Gateway) with SMTP id A8.C7.18939.C627A856; Tue, 26 Dec 2023 15:27:56 +0900 (KST) Received: from FDSFTE308 (unknown [107.122.81.79]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20231226062754epsmtip29f5e872132462de8780110b3955da104~kTcasjk3e0864408644epsmtip2g; Tue, 26 Dec 2023 06:27:54 +0000 (GMT) From: "Aakarsh Jain" To: "'Krzysztof Kozlowski'" , "'Marek Szyprowski'" , "'Andrzej Hajda'" , "'Mauro Carvalho Chehab'" Cc: , , "'Smitha T Murthy'" , , , In-Reply-To: <20231224-n-s5p-mfc-const-v1-9-a3b246470fe4@linaro.org> Subject: RE: [PATCH 09/15] media: s5p-mfc: constify s5p_mfc_fmt structures Date: Tue, 26 Dec 2023 11:57:53 +0530 Message-ID: <15d401da37c4$a9dece80$fd9c6b80$@samsung.com> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQKOGlHY6WxiJqLoSx78067AznjgmAGjTMXtAfUJOwGvNpHr8A== Content-Language: en-in X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrBJsWRmVeSWpSXmKPExsWy7bCmlu7X4q5Ug7dPhC3uL/7MYrH39VZ2 i02Pr7FaLJsdZHF51xw2i54NW1ktZpzfx2Sx9shddotlm/4wWbQ0LmF14PLYOesuu8fiPS+Z PDat6mTzuHNtD5vH5iX1Hn1bVjF6/H39is3j8ya5AI6obJuM1MSU1CKF1Lzk/JTMvHRbJe/g eOd4UzMDQ11DSwtzJYW8xNxUWyUXnwBdt8wcoBOVFMoSc0qBQgGJxcVK+nY2RfmlJakKGfnF JbZKqQUpOQUmBXrFibnFpXnpenmpJVaGBgZGpkCFCdkZG884FezRqPh78Tx7A+N6pS5GTg4J AROJpjMzGLsYuTiEBPYwSsw7dZEVJCEk8IlRYm6bC0QCyP74vIcdpqNx01wmiMRORomObZOY IZznjBIP/i8Ea2cT0Je4f6qHFSQhInCOUWJb/xSwFmaBm4wSx97MZAap4hRwkfiz6iRYh7CA l8TD3xfYuhg5OFgEVCV23wwGCfMKWErM+zmBFcIWlDg58wkLiM0soC2xbOFrZoiTFCR+Pl0G ViMi4CSxcMltJogacYmjP3vArpMQOMAhcWLKYqgfXCT6Tt5jhLCFJV4d3wIVl5J42d8GZSdL PF70EmpBjsT6PVNYIGx7iQNX5rCA3MksoCmxfpc+RFhWYuqpdVB7+SR6fz9hgojzSuyYB2Or Scy584MVwpaROLx6KeMERqVZSF6bheS1WUhemIWwbQEjyypGqdSC4tz01GTTAkPdvNRyeIwn 5+duYgQnYa2AHYyrN/zVO8TIxMF4iFGCg1lJhFdWsSNViDclsbIqtSg/vqg0J7X4EKMpMLwn MkuJJucD80BeSbyhiaWBiZmZmYmlsZmhkjjv69a5KUIC6YklqdmpqQWpRTB9TBycUg1MPmlp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p+1uPPrgqCzv36gVdy/2dVhcX7NO 7+3HWS9XF57p3ZCXvOa4e1XbbMYV/6PWbQ/Jla+NsLpv1GS5zCTPRLTunkGO0x/t2LSC81oP n0pOueLxxbPqg3l0zffbxzfNXsJV5DzXb+cKwSZ7npcfHiUr1XT49JkZHjs8eZKys+HmoFli X9rjL21jOly55Nwky06l3+eW7VCwNft9cRLzC8FjpjK14fzi0XdV1hXebo16yq9wanK+ifbm p5eD5/8K0tNceXBdMPu9QzOn7y9RNLzHae8eekZ26ta/xeufHLr36yx7wwslluKMREMt5qLi RADyq//SMAMAAA== X-CMS-MailID: 20231226062756epcas5p22bc39bd25d403a9bed16c220f82c4a83 X-Msg-Generator: CA X-Sendblock-Type: REQ_APPROVE CMS-TYPE: 105P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20231224154446epcas5p2b08000b76b8a94063b164a55e5e8a999 References: <20231224-n-s5p-mfc-const-v1-0-a3b246470fe4@linaro.org> <20231224-n-s5p-mfc-const-v1-9-a3b246470fe4@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231225_223437_483420_139FCFD0 X-CRM114-Status: GOOD ( 19.08 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org > -----Original Message----- > From: Krzysztof Kozlowski > Sent: 24 December 2023 21:14 > To: Marek Szyprowski ; Andrzej Hajda > ; Mauro Carvalho Chehab > > Cc: Aakarsh Jain ; linux-fsd@tesla.coma; linux- > samsung-soc@vger.kernel.org; Smitha T Murthy > ; linux-arm-kernel@lists.infradead.org; linux- > media@vger.kernel.org; linux-kernel@vger.kernel.org; Krzysztof Kozlowski > > Subject: [PATCH 09/15] media: s5p-mfc: constify s5p_mfc_fmt structures > > Static "s5p_mfc_fmt" structures are not modified by the driver, so they can > be made const for code safety. > > Signed-off-by: Krzysztof Kozlowski > --- > drivers/media/platform/samsung/s5p-mfc/s5p_mfc_common.h | 4 ++-- > drivers/media/platform/samsung/s5p-mfc/s5p_mfc_dec.c | 6 +++--- > drivers/media/platform/samsung/s5p-mfc/s5p_mfc_enc.c | 8 ++++---- > 3 files changed, 9 insertions(+), 9 deletions(-) > > diff --git a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_common.h > b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_common.h > index fa556f27fa06..e9283020070e 100644 > --- a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_common.h > +++ b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_common.h > @@ -633,8 +633,8 @@ struct s5p_mfc_ctx { > unsigned int int_err; > wait_queue_head_t queue; > > - struct s5p_mfc_fmt *src_fmt; > - struct s5p_mfc_fmt *dst_fmt; > + const struct s5p_mfc_fmt *src_fmt; > + const struct s5p_mfc_fmt *dst_fmt; > > struct vb2_queue vq_src; > struct vb2_queue vq_dst; > diff --git a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_dec.c > b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_dec.c > index 4dbe8792ac3d..2f664c7e9e4c 100644 > --- a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_dec.c > +++ b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_dec.c > @@ -27,7 +27,7 @@ > #include "s5p_mfc_opr.h" > #include "s5p_mfc_pm.h" > > -static struct s5p_mfc_fmt formats[] = { > +static const struct s5p_mfc_fmt formats[] = { > { > .fourcc = V4L2_PIX_FMT_NV12MT_16X16, > .codec_mode = S5P_MFC_CODEC_NONE, > @@ -163,7 +163,7 @@ static struct s5p_mfc_fmt formats[] = { #define > NUM_FORMATS ARRAY_SIZE(formats) > > /* Find selected format description */ > -static struct s5p_mfc_fmt *find_format(struct v4l2_format *f, unsigned int > t) > +static const struct s5p_mfc_fmt *find_format(struct v4l2_format *f, > +unsigned int t) > { > unsigned int i; > > @@ -387,7 +387,7 @@ static int vidioc_g_fmt(struct file *file, void *priv, > struct v4l2_format *f) static int vidioc_try_fmt(struct file *file, void *priv, > struct v4l2_format *f) { > struct s5p_mfc_dev *dev = video_drvdata(file); > - struct s5p_mfc_fmt *fmt; > + const struct s5p_mfc_fmt *fmt; > > mfc_debug(2, "Type is %d\n", f->type); > if (f->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) { diff --git > a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_enc.c > b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_enc.c > index 4b4c129c09e7..d6a4b9c701eb 100644 > --- a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_enc.c > +++ b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_enc.c > @@ -30,7 +30,7 @@ > #define DEF_SRC_FMT_ENC V4L2_PIX_FMT_NV12M > #define DEF_DST_FMT_ENC V4L2_PIX_FMT_H264 > > -static struct s5p_mfc_fmt formats[] = { > +static const struct s5p_mfc_fmt formats[] = { > { > .fourcc = V4L2_PIX_FMT_NV12MT_16X16, > .codec_mode = S5P_MFC_CODEC_NONE, > @@ -97,7 +97,7 @@ static struct s5p_mfc_fmt formats[] = { }; > > #define NUM_FORMATS ARRAY_SIZE(formats) -static struct s5p_mfc_fmt > *find_format(struct v4l2_format *f, unsigned int t) > +static const struct s5p_mfc_fmt *find_format(struct v4l2_format *f, > +unsigned int t) > { > unsigned int i; > > @@ -1394,7 +1394,7 @@ static int vidioc_g_fmt(struct file *file, void *priv, > struct v4l2_format *f) static int vidioc_try_fmt(struct file *file, void *priv, > struct v4l2_format *f) { > struct s5p_mfc_dev *dev = video_drvdata(file); > - struct s5p_mfc_fmt *fmt; > + const struct s5p_mfc_fmt *fmt; > struct v4l2_pix_format_mplane *pix_fmt_mp = &f->fmt.pix_mp; > > if (f->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) { @@ - > 2355,7 +2355,7 @@ static const struct v4l2_ioctl_ops s5p_mfc_enc_ioctl_ops > = { > .vidioc_unsubscribe_event = v4l2_event_unsubscribe, }; > > -static int check_vb_with_fmt(struct s5p_mfc_fmt *fmt, struct vb2_buffer > *vb) > +static int check_vb_with_fmt(const struct s5p_mfc_fmt *fmt, struct > +vb2_buffer *vb) > { > int i; > > > -- > 2.34.1 Reviewed-by: Aakarsh Jain Thanks! _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel