Compare the received size of the payload size, not the allocated size of the buffer that is page aligned. This way also images that aren't aligned to page size are not warned about. Also wrap a line over 80 characters. Suggested-by: Laurent Pinchart <laurent.pinchart@xxxxxxxxxxxxxxxx> Signed-off-by: Sakari Ailus <sakari.ailus@xxxxxxxxxxxxxxx> --- drivers/media/pci/intel/ipu3/ipu3-cio2.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/media/pci/intel/ipu3/ipu3-cio2.c b/drivers/media/pci/intel/ipu3/ipu3-cio2.c index 51c4dd6a8f9a..dffcc74acb7e 100644 --- a/drivers/media/pci/intel/ipu3/ipu3-cio2.c +++ b/drivers/media/pci/intel/ipu3/ipu3-cio2.c @@ -571,10 +571,11 @@ static void cio2_buffer_done(struct cio2_device *cio2, unsigned int dma_chan) b->vbb.vb2_buf.timestamp = ns; b->vbb.field = V4L2_FIELD_NONE; b->vbb.sequence = atomic_read(&q->frame_sequence); - if (b->vbb.vb2_buf.planes[0].length != bytes) - dev_warn(dev, "buffer length is %d received %d\n", - b->vbb.vb2_buf.planes[0].length, - bytes); + if (vb2_get_plane_payload(&b->vbb.vb2_buf, 0) != bytes) + dev_warn(dev, + "payload length is %lu received %u\n", + vb2_get_plane_payload(&b->vbb.vb2_buf, + 0), bytes); vb2_buffer_done(&b->vbb.vb2_buf, VB2_BUF_STATE_DONE); } atomic_inc(&q->frame_sequence); -- 2.27.0