aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilipp Zabel <p.zabel@pengutronix.de>2014-07-18 10:22:45 (GMT)
committerKamil Debski <k.debski@samsung.com>2014-08-05 15:18:38 (GMT)
commitd3a57dcd8c8693081e126ffb215a991b81cf8f08 (patch)
tree47f1f5b61a745de49c4ce84a8afb4481c85d572a
parentf45fadf88fc550b71fc2b072dc54abeeeb1d4938 (diff)
coda: mark constant structures as such
The format and codec lists and the ops structures are read-only. Mark them as const. Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Kamil Debski <k.debski@samsung.com>
-rw-r--r--drivers/media/platform/coda.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/drivers/media/platform/coda.c b/drivers/media/platform/coda.c
index b18814eb..594b0c7 100644
--- a/drivers/media/platform/coda.c
+++ b/drivers/media/platform/coda.c
@@ -102,7 +102,7 @@ struct coda_codec {
struct coda_devtype {
char *firmware;
enum coda_product product;
- struct coda_codec *codecs;
+ const struct coda_codec *codecs;
unsigned int num_codecs;
size_t workbuf_size;
size_t tempbuf_size;
@@ -225,7 +225,7 @@ struct coda_ctx {
u32 sequence_offset;
struct coda_q_data q_data[2];
enum coda_inst_type inst_type;
- struct coda_codec *codec;
+ const struct coda_codec *codec;
enum v4l2_colorspace colorspace;
struct coda_params params;
struct v4l2_ctrl_handler ctrls;
@@ -390,7 +390,7 @@ static struct coda_q_data *get_q_data(struct coda_ctx *ctx,
/*
* Array of all formats supported by any version of Coda:
*/
-static struct coda_fmt coda_formats[] = {
+static const struct coda_fmt coda_formats[] = {
{
.name = "YUV 4:2:0 Planar, YCbCr",
.fourcc = V4L2_PIX_FMT_YUV420,
@@ -419,19 +419,19 @@ static struct coda_fmt coda_formats[] = {
* i.MX6 -> coda960
* Use V4L2_PIX_FMT_YUV420 as placeholder for all supported YUV 4:2:0 variants
*/
-static struct coda_codec codadx6_codecs[] = {
+static const struct coda_codec codadx6_codecs[] = {
CODA_CODEC(CODADX6_MODE_ENCODE_H264, V4L2_PIX_FMT_YUV420, V4L2_PIX_FMT_H264, 720, 576),
CODA_CODEC(CODADX6_MODE_ENCODE_MP4, V4L2_PIX_FMT_YUV420, V4L2_PIX_FMT_MPEG4, 720, 576),
};
-static struct coda_codec coda7_codecs[] = {
+static const struct coda_codec coda7_codecs[] = {
CODA_CODEC(CODA7_MODE_ENCODE_H264, V4L2_PIX_FMT_YUV420, V4L2_PIX_FMT_H264, 1280, 720),
CODA_CODEC(CODA7_MODE_ENCODE_MP4, V4L2_PIX_FMT_YUV420, V4L2_PIX_FMT_MPEG4, 1280, 720),
CODA_CODEC(CODA7_MODE_DECODE_H264, V4L2_PIX_FMT_H264, V4L2_PIX_FMT_YUV420, 1920, 1080),
CODA_CODEC(CODA7_MODE_DECODE_MP4, V4L2_PIX_FMT_MPEG4, V4L2_PIX_FMT_YUV420, 1920, 1080),
};
-static struct coda_codec coda9_codecs[] = {
+static const struct coda_codec coda9_codecs[] = {
CODA_CODEC(CODA9_MODE_ENCODE_H264, V4L2_PIX_FMT_YUV420, V4L2_PIX_FMT_H264, 1920, 1080),
CODA_CODEC(CODA9_MODE_ENCODE_MP4, V4L2_PIX_FMT_YUV420, V4L2_PIX_FMT_MPEG4, 1920, 1080),
CODA_CODEC(CODA9_MODE_DECODE_H264, V4L2_PIX_FMT_H264, V4L2_PIX_FMT_YUV420, 1920, 1080),
@@ -458,10 +458,10 @@ static u32 coda_format_normalize_yuv(u32 fourcc)
return coda_format_is_yuv(fourcc) ? V4L2_PIX_FMT_YUV420 : fourcc;
}
-static struct coda_codec *coda_find_codec(struct coda_dev *dev, int src_fourcc,
- int dst_fourcc)
+static const struct coda_codec *coda_find_codec(struct coda_dev *dev,
+ int src_fourcc, int dst_fourcc)
{
- struct coda_codec *codecs = dev->devtype->codecs;
+ const struct coda_codec *codecs = dev->devtype->codecs;
int num_codecs = dev->devtype->num_codecs;
int k;
@@ -483,10 +483,10 @@ static struct coda_codec *coda_find_codec(struct coda_dev *dev, int src_fourcc,
}
static void coda_get_max_dimensions(struct coda_dev *dev,
- struct coda_codec *codec,
+ const struct coda_codec *codec,
int *max_w, int *max_h)
{
- struct coda_codec *codecs = dev->devtype->codecs;
+ const struct coda_codec *codecs = dev->devtype->codecs;
int num_codecs = dev->devtype->num_codecs;
unsigned int w, h;
int k;
@@ -546,9 +546,9 @@ static int coda_enum_fmt(struct file *file, void *priv,
struct v4l2_fmtdesc *f)
{
struct coda_ctx *ctx = fh_to_ctx(priv);
- struct coda_codec *codecs = ctx->dev->devtype->codecs;
- struct coda_fmt *formats = coda_formats;
- struct coda_fmt *fmt;
+ const struct coda_codec *codecs = ctx->dev->devtype->codecs;
+ const struct coda_fmt *formats = coda_formats;
+ const struct coda_fmt *fmt;
int num_codecs = ctx->dev->devtype->num_codecs;
int num_formats = ARRAY_SIZE(coda_formats);
int i, k, num = 0;
@@ -621,7 +621,7 @@ static int coda_g_fmt(struct file *file, void *priv,
return 0;
}
-static int coda_try_fmt(struct coda_ctx *ctx, struct coda_codec *codec,
+static int coda_try_fmt(struct coda_ctx *ctx, const struct coda_codec *codec,
struct v4l2_format *f)
{
struct coda_dev *dev = ctx->dev;
@@ -683,7 +683,7 @@ static int coda_try_fmt_vid_cap(struct file *file, void *priv,
struct v4l2_format *f)
{
struct coda_ctx *ctx = fh_to_ctx(priv);
- struct coda_codec *codec = NULL;
+ const struct coda_codec *codec = NULL;
struct vb2_queue *src_vq;
int ret;
@@ -731,7 +731,7 @@ static int coda_try_fmt_vid_out(struct file *file, void *priv,
struct v4l2_format *f)
{
struct coda_ctx *ctx = fh_to_ctx(priv);
- struct coda_codec *codec;
+ const struct coda_codec *codec;
/* Determine codec by encoded format, returns NULL if raw or invalid */
codec = coda_find_codec(ctx->dev, f->fmt.pix.pixelformat,
@@ -1529,7 +1529,7 @@ static void coda_unlock(void *m2m_priv)
mutex_unlock(&pcdev->dev_mutex);
}
-static struct v4l2_m2m_ops coda_m2m_ops = {
+static const struct v4l2_m2m_ops coda_m2m_ops = {
.device_run = coda_device_run,
.job_ready = coda_job_ready,
.job_abort = coda_job_abort,
@@ -2799,7 +2799,7 @@ static int coda_s_ctrl(struct v4l2_ctrl *ctrl)
return 0;
}
-static struct v4l2_ctrl_ops coda_ctrl_ops = {
+static const struct v4l2_ctrl_ops coda_ctrl_ops = {
.s_ctrl = coda_s_ctrl,
};

Privacy Policy