@@ -67,7 +67,7 @@ struct bcm2835_isp_q_data {
67
67
unsigned int width ;
68
68
unsigned int height ;
69
69
unsigned int sizeimage ;
70
- struct bcm2835_isp_fmt * fmt ;
70
+ const struct bcm2835_isp_fmt * fmt ;
71
71
};
72
72
73
73
/*
@@ -232,20 +232,21 @@ struct bcm2835_isp_fmt *find_format_by_fourcc(unsigned int fourcc,
232
232
struct bcm2835_isp_node * node )
233
233
{
234
234
struct bcm2835_isp_fmt_list * fmts = & node -> supported_fmts ;
235
- struct bcm2835_isp_fmt * fmt ;
235
+ const struct bcm2835_isp_fmt * fmt ;
236
236
unsigned int i ;
237
237
238
238
for (i = 0 ; i < fmts -> num_entries ; i ++ ) {
239
- fmt = & fmts -> list [i ];
239
+ fmt = fmts -> list [i ];
240
240
if (fmt -> fourcc == fourcc )
241
241
return fmt ;
242
242
}
243
243
244
244
return NULL ;
245
245
}
246
246
247
- static struct bcm2835_isp_fmt * find_format (struct v4l2_format * f ,
248
- struct bcm2835_isp_node * node )
247
+ static const
248
+ struct bcm2835_isp_fmt * find_format (struct v4l2_format * f ,
249
+ struct bcm2835_isp_node * node )
249
250
{
250
251
return find_format_by_fourcc (node_is_stats (node ) ?
251
252
f -> fmt .meta .dataformat :
@@ -666,19 +667,20 @@ static const struct vb2_ops bcm2835_isp_node_queue_ops = {
666
667
.stop_streaming = bcm2835_isp_node_stop_streaming ,
667
668
};
668
669
669
- static struct bcm2835_isp_fmt * get_default_format (struct bcm2835_isp_node * node )
670
+ static const
671
+ struct bcm2835_isp_fmt * get_default_format (struct bcm2835_isp_node * node )
670
672
{
671
- return & node -> supported_fmts .list [0 ];
673
+ return node -> supported_fmts .list [0 ];
672
674
}
673
675
674
676
static inline unsigned int get_bytesperline (int width ,
675
- struct bcm2835_isp_fmt * fmt )
677
+ const struct bcm2835_isp_fmt * fmt )
676
678
{
677
679
return ALIGN ((width * fmt -> depth ) >> 3 , fmt -> bytesperline_align );
678
680
}
679
681
680
682
static inline unsigned int get_sizeimage (int bpl , int width , int height ,
681
- struct bcm2835_isp_fmt * fmt )
683
+ const struct bcm2835_isp_fmt * fmt )
682
684
{
683
685
return (bpl * height * fmt -> size_multiplier_x2 ) >> 1 ;
684
686
}
@@ -892,8 +894,8 @@ static int bcm2835_isp_node_enum_fmt(struct file *file, void *priv,
892
894
893
895
if (f -> index < fmts -> num_entries ) {
894
896
/* Format found */
895
- f -> pixelformat = fmts -> list [f -> index ]. fourcc ;
896
- f -> flags = fmts -> list [f -> index ]. flags ;
897
+ f -> pixelformat = fmts -> list [f -> index ]-> fourcc ;
898
+ f -> flags = fmts -> list [f -> index ]-> flags ;
897
899
return 0 ;
898
900
}
899
901
@@ -905,7 +907,7 @@ static int bcm2835_isp_enum_framesizes(struct file *file, void *priv,
905
907
{
906
908
struct bcm2835_isp_node * node = video_drvdata (file );
907
909
struct bcm2835_isp_dev * dev = node_get_dev (node );
908
- struct bcm2835_isp_fmt * fmt ;
910
+ const struct bcm2835_isp_fmt * fmt ;
909
911
910
912
if (node_is_stats (node ) || fsize -> index )
911
913
return - EINVAL ;
@@ -933,7 +935,7 @@ static int bcm2835_isp_node_try_fmt(struct file *file, void *priv,
933
935
struct v4l2_format * f )
934
936
{
935
937
struct bcm2835_isp_node * node = video_drvdata (file );
936
- struct bcm2835_isp_fmt * fmt ;
938
+ const struct bcm2835_isp_fmt * fmt ;
937
939
938
940
if (f -> type != node -> queue .type )
939
941
return - EINVAL ;
@@ -1113,7 +1115,7 @@ static const struct v4l2_ioctl_ops bcm2835_isp_node_ioctl_ops = {
1113
1115
static int bcm2835_isp_get_supported_fmts (struct bcm2835_isp_node * node )
1114
1116
{
1115
1117
struct bcm2835_isp_dev * dev = node_get_dev (node );
1116
- struct bcm2835_isp_fmt * list ;
1118
+ struct bcm2835_isp_fmt const * * list ;
1117
1119
unsigned int i , j , num_encodings ;
1118
1120
u32 fourccs [MAX_SUPPORTED_ENCODINGS ];
1119
1121
u32 param_size = sizeof (fourccs );
@@ -1144,7 +1146,7 @@ static int bcm2835_isp_get_supported_fmts(struct bcm2835_isp_node *node)
1144
1146
* Any that aren't supported will waste a very small amount of memory.
1145
1147
*/
1146
1148
list = devm_kzalloc (dev -> dev ,
1147
- sizeof (struct bcm2835_isp_fmt ) * num_encodings ,
1149
+ sizeof (struct bcm2835_isp_fmt * ) * num_encodings ,
1148
1150
GFP_KERNEL );
1149
1151
if (!list )
1150
1152
return - ENOMEM ;
@@ -1154,7 +1156,7 @@ static int bcm2835_isp_get_supported_fmts(struct bcm2835_isp_node *node)
1154
1156
const struct bcm2835_isp_fmt * fmt = get_fmt (fourccs [i ]);
1155
1157
1156
1158
if (fmt ) {
1157
- list [j ] = * fmt ;
1159
+ list [j ] = fmt ;
1158
1160
j ++ ;
1159
1161
}
1160
1162
}
0 commit comments