aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Pinchart <[email protected]>2020-07-06 20:35:30 +0200
committerMauro Carvalho Chehab <[email protected]>2020-07-19 08:32:00 +0200
commit37166b2ff964714efabefe4e6809d4af2d10a3e9 (patch)
tree708a5c635b3926ee12efb37b1e9088c546998d21
parent50797fb30b95b04332b9f3a35c9f7ec2a09692a1 (diff)
media: ti-vpe: cal: Make cal_formats array const
The static cal_formats array contains const data, make it const. This requires turning a few cal_fmt pointers into const pointers. Signed-off-by: Laurent Pinchart <[email protected]> Reviewed-by: Tomi Valkeinen <[email protected]> Reviewed-by: Benoit Parrot <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
-rw-r--r--drivers/media/platform/ti-vpe/cal.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/media/platform/ti-vpe/cal.c b/drivers/media/platform/ti-vpe/cal.c
index 278477cf0ae9..3668c4d445fe 100644
--- a/drivers/media/platform/ti-vpe/cal.c
+++ b/drivers/media/platform/ti-vpe/cal.c
@@ -89,7 +89,7 @@ struct cal_fmt {
u8 bpp;
};
-static struct cal_fmt cal_formats[] = {
+static const struct cal_fmt cal_formats[] = {
{
.fourcc = V4L2_PIX_FMT_YUYV,
.code = MEDIA_BUS_FMT_YUYV8_2X8,
@@ -392,7 +392,7 @@ struct cal_ctx {
struct v4l2_mbus_framefmt m_fmt;
/* Current subdev enumerated format */
- struct cal_fmt *active_fmt[ARRAY_SIZE(cal_formats)];
+ const struct cal_fmt *active_fmt[ARRAY_SIZE(cal_formats)];
int num_active_fmt;
struct v4l2_fract timeperframe;
@@ -1932,7 +1932,6 @@ static int cal_async_bound(struct v4l2_async_notifier *notifier,
/* Enumerate sub device formats and enable all matching local formats */
ctx->num_active_fmt = 0;
for (j = 0, i = 0; ret != -EINVAL; ++j) {
- struct cal_fmt *fmt;
memset(&mbus_code, 0, sizeof(mbus_code));
mbus_code.index = j;
@@ -1947,7 +1946,7 @@ static int cal_async_bound(struct v4l2_async_notifier *notifier,
subdev->name, mbus_code.code, j);
for (k = 0; k < ARRAY_SIZE(cal_formats); k++) {
- fmt = &cal_formats[k];
+ const struct cal_fmt *fmt = &cal_formats[k];
if (mbus_code.code == fmt->code) {
ctx->active_fmt[i] = fmt;