MLK-17058 media: csi: fix spurious warning message
authorRobby Cai <robby.cai@nxp.com>
Thu, 7 Dec 2017 12:22:25 +0000 (20:22 +0800)
committerNitin Garg <nitin.garg@nxp.com>
Tue, 20 Mar 2018 19:50:57 +0000 (14:50 -0500)
When boot up with 4K HDMI display, and at same time do a capture with
720p (or above), meet following message.

[  241.572132] mx6s-csi 30a90000.csi1_bridge: 82300000 != 82300000
[  241.604974] mx6s-csi 30a90000.csi1_bridge: 82700000 != 82700000
[  241.638305] mx6s-csi 30a90000.csi1_bridge: 82b00000 != 82b00000
[  241.704969] mx6s-csi 30a90000.csi1_bridge: 82300000 != 82300000
...

cast the type of unsigned long to unsigned int before compare two variables
to fix it.

Signed-off-by: Robby Cai <robby.cai@nxp.com>
Reviewed-by: Sandor Yu <sandor.yu@nxp.com>
(cherry picked from commit 0972b05917dd5bd3d6aa28e57b7181d647da28b8)

drivers/media/platform/mxc/capture/mx6s_capture.c

index 4b89e04..262618c 100644 (file)
@@ -997,6 +997,8 @@ static void mx6s_csi_frame_done(struct mx6s_csi_dev *csi_dev,
        struct mx6s_buffer *buf;
        struct vb2_buffer *vb;
        unsigned long phys;
+       unsigned int phys_fb1;
+       unsigned int phys_fb2;
 
        ibuf = list_first_entry(&csi_dev->active_bufs, struct mx6s_buf_internal,
                               queue);
@@ -1013,14 +1015,16 @@ static void mx6s_csi_frame_done(struct mx6s_csi_dev *csi_dev,
                vb = &buf->vb.vb2_buf;
                phys = vb2_dma_contig_plane_dma_addr(vb, 0);
                if (bufnum == 1) {
-                       if (csi_read(csi_dev, CSI_CSIDMASA_FB2) != phys) {
+                       phys_fb2 = csi_read(csi_dev, CSI_CSIDMASA_FB2);
+                       if (phys_fb2 != (u32)phys) {
                                dev_err(csi_dev->dev, "%lx != %x\n", phys,
-                                       csi_read(csi_dev, CSI_CSIDMASA_FB2));
+                                       phys_fb2);
                        }
                } else {
-                       if (csi_read(csi_dev, CSI_CSIDMASA_FB1) != phys) {
+                       phys_fb1 = csi_read(csi_dev, CSI_CSIDMASA_FB1);
+                       if (phys_fb1 != (u32)phys) {
                                dev_err(csi_dev->dev, "%lx != %x\n", phys,
-                                       csi_read(csi_dev, CSI_CSIDMASA_FB1));
+                                       phys_fb1);
                        }
                }
                dev_dbg(csi_dev->dev, "%s (vb=0x%p) 0x%p %lu\n", __func__, vb,