public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Corentin Labbe <clabbe@baylibre.com>
To: gregkh@linuxfoundation.org, mchehab@kernel.org,
	hverkuil@xs4all.nl, laurent.pinchart@ideasonboard.com
Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org,
	linux-media@vger.kernel.org, Corentin Labbe <clabbe@baylibre.com>
Subject: [PATCH RFT/RFC v2 33/47] staging: media: zoran: constify struct tvnorm
Date: Fri, 25 Sep 2020 18:30:43 +0000	[thread overview]
Message-ID: <1601058657-14042-34-git-send-email-clabbe@baylibre.com> (raw)
In-Reply-To: <1601058657-14042-1-git-send-email-clabbe@baylibre.com>

The structure tvnorm could be consified.

Signed-off-by: Corentin Labbe <clabbe@baylibre.com>
---
 drivers/staging/media/zoran/videocodec.h   |  2 +-
 drivers/staging/media/zoran/zoran.h        |  4 ++--
 drivers/staging/media/zoran/zoran_card.c   | 24 +++++++++++-----------
 drivers/staging/media/zoran/zoran_device.c |  4 ++--
 drivers/staging/media/zoran/zr36016.c      |  4 ++--
 drivers/staging/media/zoran/zr36050.c      |  4 ++--
 drivers/staging/media/zoran/zr36060.c      |  2 +-
 7 files changed, 22 insertions(+), 22 deletions(-)

diff --git a/drivers/staging/media/zoran/videocodec.h b/drivers/staging/media/zoran/videocodec.h
index 553af4ad431e..a049f3c2c68a 100644
--- a/drivers/staging/media/zoran/videocodec.h
+++ b/drivers/staging/media/zoran/videocodec.h
@@ -256,7 +256,7 @@ struct videocodec {
 	// set compression or decompression (or freeze, stop, standby, etc)
 	int (*set_mode)(struct videocodec *codec, int mode);
 	// setup picture size and norm (for the codec's video frontend)
-	int (*set_video)(struct videocodec *codec, struct tvnorm *norm,
+	int (*set_video)(struct videocodec *codec, const struct tvnorm *norm,
 			 struct vfe_settings *cap, struct vfe_polarity *pol);
 	// other control commands, also mmap setup etc.
 	int (*control)(struct videocodec *codec, int type, int size, void *data);
diff --git a/drivers/staging/media/zoran/zoran.h b/drivers/staging/media/zoran/zoran.h
index c73b7e7fd5e1..727ba67afd56 100644
--- a/drivers/staging/media/zoran/zoran.h
+++ b/drivers/staging/media/zoran/zoran.h
@@ -227,7 +227,7 @@ struct card_info {
 	} input[BUZ_MAX_INPUT];
 
 	v4l2_std_id norms;
-	struct tvnorm *tvn[3];	/* supported TV norms */
+	const struct tvnorm *tvn[3];	/* supported TV norms */
 
 	u32 jpeg_int;		/* JPEG interrupt */
 	u32 vsync_int;		/* VSYNC interrupt */
@@ -266,7 +266,7 @@ struct zoran {
 	u8 initialized;		/* flag if zoran has been correctly initialized */
 	int user;		/* number of current users */
 	struct card_info card;
-	struct tvnorm *timing;
+	const struct tvnorm *timing;
 
 	unsigned short id;	/* number of this device */
 	char name[32];		/* name of this device */
diff --git a/drivers/staging/media/zoran/zoran_card.c b/drivers/staging/media/zoran/zoran_card.c
index 756705a34e2b..79783cbb919a 100644
--- a/drivers/staging/media/zoran/zoran_card.c
+++ b/drivers/staging/media/zoran/zoran_card.c
@@ -277,24 +277,24 @@ static char *codecid_to_modulename(u16 codecid)
 //      u16 Wt, Wa, HStart, HSyncStart, Ht, Ha, VStart;
 // };
 
-static struct tvnorm f50sqpixel = { 944, 768, 83, 880, 625, 576, 16 };
-static struct tvnorm f60sqpixel = { 780, 640, 51, 716, 525, 480, 12 };
-static struct tvnorm f50ccir601 = { 864, 720, 75, 804, 625, 576, 18 };
-static struct tvnorm f60ccir601 = { 858, 720, 57, 788, 525, 480, 16 };
+static const struct tvnorm f50sqpixel = { 944, 768, 83, 880, 625, 576, 16 };
+static const struct tvnorm f60sqpixel = { 780, 640, 51, 716, 525, 480, 12 };
+static const struct tvnorm f50ccir601 = { 864, 720, 75, 804, 625, 576, 18 };
+static const struct tvnorm f60ccir601 = { 858, 720, 57, 788, 525, 480, 16 };
 
-static struct tvnorm f50ccir601_lml33 = { 864, 720, 75 + 34, 804, 625, 576, 18 };
-static struct tvnorm f60ccir601_lml33 = { 858, 720, 57 + 34, 788, 525, 480, 16 };
+static const struct tvnorm f50ccir601_lml33 = { 864, 720, 75 + 34, 804, 625, 576, 18 };
+static const struct tvnorm f60ccir601_lml33 = { 858, 720, 57 + 34, 788, 525, 480, 16 };
 
 /* The DC10 (57/16/50) uses VActive as HSync, so HStart must be 0 */
-static struct tvnorm f50sqpixel_dc10 = { 944, 768, 0, 880, 625, 576, 0 };
-static struct tvnorm f60sqpixel_dc10 = { 780, 640, 0, 716, 525, 480, 12 };
+static const struct tvnorm f50sqpixel_dc10 = { 944, 768, 0, 880, 625, 576, 0 };
+static const struct tvnorm f60sqpixel_dc10 = { 780, 640, 0, 716, 525, 480, 12 };
 
 /*
  * FIXME: I cannot swap U and V in saa7114, so i do one pixel left shift in zoran (75 -> 74)
  * (Maxim Yevtyushkin <max@linuxmedialabs.com>)
  */
-static struct tvnorm f50ccir601_lm33r10 = { 864, 720, 74 + 54, 804, 625, 576, 18 };
-static struct tvnorm f60ccir601_lm33r10 = { 858, 720, 56 + 54, 788, 525, 480, 16 };
+static const struct tvnorm f50ccir601_lm33r10 = { 864, 720, 74 + 54, 804, 625, 576, 18 };
+static const struct tvnorm f60ccir601_lm33r10 = { 858, 720, 56 + 54, 788, 525, 480, 16 };
 
 /*
  * FIXME: The ks0127 seem incapable of swapping U and V, too, which is why I copy Maxim's left
@@ -303,8 +303,8 @@ static struct tvnorm f60ccir601_lm33r10 = { 858, 720, 56 + 54, 788, 525, 480, 16
  * Christer's driver used the unshifted norms, though...
  * /Sam
  */
-static struct tvnorm f50ccir601_avs6eyes = { 864, 720, 74, 804, 625, 576, 18 };
-static struct tvnorm f60ccir601_avs6eyes = { 858, 720, 56, 788, 525, 480, 16 };
+static const struct tvnorm f50ccir601_avs6eyes = { 864, 720, 74, 804, 625, 576, 18 };
+static const struct tvnorm f60ccir601_avs6eyes = { 858, 720, 56, 788, 525, 480, 16 };
 
 static const unsigned short vpx3220_addrs[] = { 0x43, 0x47, I2C_CLIENT_END };
 static const unsigned short saa7110_addrs[] = { 0x4e, 0x4f, I2C_CLIENT_END };
diff --git a/drivers/staging/media/zoran/zoran_device.c b/drivers/staging/media/zoran/zoran_device.c
index 4c9f6eafd130..fb318449d784 100644
--- a/drivers/staging/media/zoran/zoran_device.c
+++ b/drivers/staging/media/zoran/zoran_device.c
@@ -292,7 +292,7 @@ static void zr36057_adjust_vfe(struct zoran *zr, enum zoran_codec_mode mode)
 static void zr36057_set_vfe(struct zoran *zr, int video_width, int video_height,
 			    const struct zoran_format *format)
 {
-	struct tvnorm *tvn;
+	const struct tvnorm *tvn;
 	unsigned int HStart, HEnd, VStart, VEnd;
 	unsigned int DispMode;
 	unsigned int VidWinWid, VidWinHt;
@@ -510,7 +510,7 @@ static void init_jpeg_queue(struct zoran *zr)
 
 static void zr36057_set_jpg(struct zoran *zr, enum zoran_codec_mode mode)
 {
-	struct tvnorm *tvn;
+	const struct tvnorm *tvn;
 	u32 reg;
 
 	tvn = zr->timing;
diff --git a/drivers/staging/media/zoran/zr36016.c b/drivers/staging/media/zoran/zr36016.c
index a8190005bc4d..046cffb92f5f 100644
--- a/drivers/staging/media/zoran/zr36016.c
+++ b/drivers/staging/media/zoran/zr36016.c
@@ -238,8 +238,8 @@ static int zr36016_set_mode(struct videocodec *codec, int mode)
 }
 
 /* set picture size */
-static int zr36016_set_video(struct videocodec *codec, struct tvnorm *norm,
-		   struct vfe_settings *cap, struct vfe_polarity *pol)
+static int zr36016_set_video(struct videocodec *codec, const struct tvnorm *norm,
+			     struct vfe_settings *cap, struct vfe_polarity *pol)
 {
 	struct zr36016 *ptr = (struct zr36016 *)codec->data;
 
diff --git a/drivers/staging/media/zoran/zr36050.c b/drivers/staging/media/zoran/zr36050.c
index f551631c18cd..348b9f0ab74c 100644
--- a/drivers/staging/media/zoran/zr36050.c
+++ b/drivers/staging/media/zoran/zr36050.c
@@ -554,8 +554,8 @@ static int zr36050_set_mode(struct videocodec *codec, int mode)
 }
 
 /* set picture size (norm is ignored as the codec doesn't know about it) */
-static int zr36050_set_video(struct videocodec *codec, struct tvnorm *norm,
-		   struct vfe_settings *cap, struct vfe_polarity *pol)
+static int zr36050_set_video(struct videocodec *codec, const struct tvnorm *norm,
+			     struct vfe_settings *cap, struct vfe_polarity *pol)
 {
 	struct zr36050 *ptr = (struct zr36050 *)codec->data;
 	int size;
diff --git a/drivers/staging/media/zoran/zr36060.c b/drivers/staging/media/zoran/zr36060.c
index 0a0916f5f8cd..773de0e64daf 100644
--- a/drivers/staging/media/zoran/zr36060.c
+++ b/drivers/staging/media/zoran/zr36060.c
@@ -477,7 +477,7 @@ static int zr36060_set_mode(struct videocodec *codec, int mode)
 }
 
 /* set picture size (norm is ignored as the codec doesn't know about it) */
-static int zr36060_set_video(struct videocodec *codec, struct tvnorm *norm,
+static int zr36060_set_video(struct videocodec *codec, const struct tvnorm *norm,
 			     struct vfe_settings *cap, struct vfe_polarity *pol)
 {
 	struct zr36060 *ptr = (struct zr36060 *)codec->data;
-- 
2.26.2


  parent reply	other threads:[~2020-09-25 18:34 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-25 18:30 [PATCH RFT/RFC v2 00/47] staging: media: bring back zoran driver Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 01/47] staging: media: Revert "media: zoran: remove deprecated driver" Corentin Labbe
     [not found]   ` <CA+QCeVRjnU6RwHkj3c54pzLq6yeaZ1Lz8eG4vDOkGT5RyKvJhA@mail.gmail.com>
2022-05-07 16:11     ` Laurent Pinchart
2020-09-25 18:30 ` [PATCH RFT/RFC v2 02/47] MAINTAINERS: change maintainer of the zoran driver Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 03/47] staging: media: zoran: datasheet is no longer available from zoran.com Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 04/47] staging: media: zoran: Documentation: fix typo Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 05/47] staging: media: zoran: fix checkpatch issue Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 06/47] staging: media: zoran: do not forward declare zr36057_init_vfe Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 07/47] staging: media: zoran: convert all error dprintk to pci_err/pr_err Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 08/47] staging: media: zoran: convert dprintk warn Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 09/47] staging: media: zoran: convert dprintk info to pci_info Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 10/47] staging: media: zoran: convert dprintk debug Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 11/47] staging: media: zoran: zoran_device.c: convert pr_x to pci_x Corentin Labbe
2020-09-25 18:36   ` Joe Perches
2020-09-25 18:30 ` [PATCH RFT/RFC v2 12/47] staging: media: zoran: remove proc_fs Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 13/47] staging: media: zoran: use VFL_TYPE_VIDEO Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 14/47] staging: media: zoran: use v4l2_buffer_set_timestamp Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 15/47] staging: media: zoran: do not print random guest 0 Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 16/47] staging: media: zoran: move buffer_size out of zoran_fh Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 17/47] staging: media: zoran: move v4l_settings " Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 18/47] staging: media: zoran: move jpg_settings " Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 19/47] staging: media: zoran: move overlay_settings " Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 20/47] staging: media: zoran: Use video_drvdata to get struct zoran Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 21/47] staging: media: zoran: Change zoran_v4l_set_format parameter from zoran_fh to zoran Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 22/47] staging: media: zoran: remove overlay Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 23/47] staging: media: zoran: Use DMA coherent for stat_com Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 24/47] staging: media: zoran: use ZR_NORM Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 25/47] staging: media: zoran: zoran does not support STD_ALL Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 26/47] staging: media: zoran: convert irq to pci irq Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 27/47] staging: media: zoran: convert zoran alloc to devm Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 28/47] staging: media: zoran: convert mdelay to udelay Corentin Labbe
2020-10-01  7:54   ` Mauro Carvalho Chehab
2020-09-25 18:30 ` [PATCH RFT/RFC v2 29/47] staging: media: zoran: use devm for videocodec_master alloc Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 30/47] staging: media: zoran: use pci_request_regions Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 31/47] staging: media: zoran: use devm_ioremap Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 32/47] staging: media: zoran: add stat_com buffer Corentin Labbe
2020-09-25 18:30 ` Corentin Labbe [this message]
2020-09-25 18:30 ` [PATCH RFT/RFC v2 34/47] staging: media: zoran: constify codec_name Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 35/47] staging: media: zoran: Add more check for compliance Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 36/47] staging: media: zoran: Add vb_queue Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 37/47] staging: media: zoran: disable output Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 38/47] staging: media: zoran: device support only 32bit DMA address Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 39/47] staging: media: zoran: enable makefile Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 40/47] staging: media: zoran: remove framebuffer support Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 41/47] staging: media: zoran: add vidioc_g_parm Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 42/47] staging: media: zoran: remove test_interrupts Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 43/47] staging: media: zoran: fix use of buffer_size and sizeimage Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 44/47] staging: media: zoran: fix some compliance test Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 45/47] staging: media: zoran: remove deprecated .vidioc_g_jpegcomp Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 46/47] staging: media: zoran: convert to vb2 Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 47/47] staging: media: zoran: update TODO Corentin Labbe
2020-09-28 13:45 ` [PATCH RFT/RFC v2 00/47] staging: media: bring back zoran driver Hans Verkuil
2020-09-28 13:53   ` Laurent Pinchart
2020-09-28 14:01     ` 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=1601058657-14042-34-git-send-email-clabbe@baylibre.com \
    --to=clabbe@baylibre.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=hverkuil@xs4all.nl \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    /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