From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932307AbcGTW5F (ORCPT ); Wed, 20 Jul 2016 18:57:05 -0400 Received: from ec2-52-27-115-49.us-west-2.compute.amazonaws.com ([52.27.115.49]:47191 "EHLO s-opensource.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755296AbcGTW5D (ORCPT ); Wed, 20 Jul 2016 18:57:03 -0400 Subject: Re: [PATCH v2] [media] vb2: include lengths in dmabuf qbuf debug message To: Sakari Ailus References: <1469030875-2246-1-git-send-email-javier@osg.samsung.com> <20160720195228.GD7976@valkosipuli.retiisi.org.uk> From: Javier Martinez Canillas Cc: linux-kernel@vger.kernel.org, Marek Szyprowski , Mauro Carvalho Chehab , Kyungmin Park , Pawel Osciak , linux-media@vger.kernel.org Message-ID: <75cf608c-d5a5-420e-2a37-dfef9891dbdc@osg.samsung.com> Date: Wed, 20 Jul 2016 18:56:52 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <20160720195228.GD7976@valkosipuli.retiisi.org.uk> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello Sakari, On 07/20/2016 03:52 PM, Sakari Ailus wrote: > On Wed, Jul 20, 2016 at 12:07:55PM -0400, Javier Martinez Canillas wrote: >> If the VIDIOC_QBUF ioctl fails due a wrong dmabuf length, it's >> useful to get the invalid and minimum lengths as a debug info. >> >> Before this patch: >> >> vb2-core: __qbuf_dmabuf: invalid dmabuf length for plane 1 >> >> After this patch: >> >> vb2-core: __qbuf_dmabuf: invalid dmabuf length 221248 for plane 1, minimum length 410880 >> >> Signed-off-by: Javier Martinez Canillas >> >> --- >> >> Changes in v2: >> - Use %u instead of %d (Sakari Ailus) >> - Include min_length (Sakari Ailus) >> >> drivers/media/v4l2-core/videobuf2-core.c | 6 ++++-- >> 1 file changed, 4 insertions(+), 2 deletions(-) >> >> diff --git a/drivers/media/v4l2-core/videobuf2-core.c b/drivers/media/v4l2-core/videobuf2-core.c >> index b6fbc04f9699..bbba50d6e1ad 100644 >> --- a/drivers/media/v4l2-core/videobuf2-core.c >> +++ b/drivers/media/v4l2-core/videobuf2-core.c >> @@ -1227,8 +1227,10 @@ static int __qbuf_dmabuf(struct vb2_buffer *vb, const void *pb) >> planes[plane].length = dbuf->size; >> >> if (planes[plane].length < vb->planes[plane].min_length) { >> - dprintk(1, "invalid dmabuf length for plane %d\n", >> - plane); >> + dprintk(1, "invalid dmabuf length %u for plane %d, " >> + "minimum length %u\n", > > You shouldn't split strings. It breaks grep. > Yes I know but if I didn't split the line, it would had been longer than the max 80 character per line convention. On those situations I follow what's already done in the file for consistency and most strings in the videobuf2-core file, whose lines are over 80 characters, are being split. But if having a longer line is preferred, I'll happily re-spin the patch. > With that changed, > > Acked-by: Sakari Ailus > >> + planes[plane].length, plane, >> + vb->planes[plane].min_length); >> dma_buf_put(dbuf); >> ret = -EINVAL; >> goto err; > Best regards, -- Javier Martinez Canillas Open Source Group Samsung Research America