media: pxa_camera: declare variable when DEBUG is defined
authorTom Rix <trix@redhat.com>
Mon, 18 Jan 2021 13:45:13 +0000 (14:45 +0100)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Wed, 27 Jan 2021 12:46:05 +0000 (13:46 +0100)
When DEBUG is defined this error occurs

drivers/media/platform/pxa_camera.c:1410:7: error:
  ā€˜i’ undeclared (first use in this function)
  for (i = 0; i < vb->num_planes; i++)
       ^
The variable 'i' is missing, so declare it.

Fixes: 6f28435d1c15 ("[media] media: platform: pxa_camera: trivial move of functions")
Signed-off-by: Tom Rix <trix@redhat.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/platform/pxa_camera.c

index b664ce7558a1a59d891494b9a4c20e3a4479ffaa..75fad9689c901bb11797362c9bc711f90663986f 100644 (file)
@@ -1386,6 +1386,9 @@ static int pxac_vb2_prepare(struct vb2_buffer *vb)
        struct pxa_camera_dev *pcdev = vb2_get_drv_priv(vb->vb2_queue);
        struct pxa_buffer *buf = vb2_to_pxa_buffer(vb);
        int ret = 0;
+#ifdef DEBUG
+       int i;
+#endif
 
        switch (pcdev->channels) {
        case 1: