Need to remove the following warning:
warning: array subscript is above array bounds
Summary of changes:
Moved MXC_SENSOR_NUM definition to mxc_v4l2_capture.h.
all_sensors[] now uses MXC_SENSOR_NUM in definition.
MXC_SENSOR_NUM is now used for bounds checking the array.
Signed-off-by: Oliver Brown <oliver.brown@freescale.com>
#include "ipu_prp_sw.h"
#define init_MUTEX(sem) sema_init(sem, 1)
-#define MXC_SENSOR_NUM 2
static struct platform_device_id imx_v4l2_devtype[] = {
{
/* Move all the sensors behind this
* sensor one step forward
*/
- for (; i < cam->sensor_index - 1; i++)
+ for (; i <= MXC_SENSOR_NUM - 2; i++)
cam->all_sensors[i] = cam->all_sensors[i+1];
break;
}
#define FRAME_NUM 10
+#define MXC_SENSOR_NUM 2
enum imx_v4l2_devtype {
IMX5_V4L2,
/* camera sensor interface */
struct camera_sensor *cam_sensor; /* old version */
- struct v4l2_int_device *all_sensors[2];
+ struct v4l2_int_device *all_sensors[MXC_SENSOR_NUM];
struct v4l2_int_device *sensor;
struct v4l2_int_device *self;
int sensor_index;