Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753366AbbERKH3 (ORCPT ); Mon, 18 May 2015 06:07:29 -0400 Received: from mail-la0-f52.google.com ([209.85.215.52]:36696 "EHLO mail-la0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752778AbbERKHQ (ORCPT ); Mon, 18 May 2015 06:07:16 -0400 MIME-Version: 1.0 In-Reply-To: <55599F8A.6030401@xs4all.nl> References: <1431883124-4937-1-git-send-email-alexinbeijing@gmail.com> <20150518065158.GA17391@unicorn.suse.cz> <55599F8A.6030401@xs4all.nl> From: "Lad, Prabhakar" Date: Mon, 18 May 2015 11:06:43 +0100 Message-ID: Subject: Re: [PATCH] Clarify expression which uses both multiplication and pointer dereference To: Hans Verkuil Cc: Michal Kubecek , Alex Dowad , Mauro Carvalho Chehab , Greg Kroah-Hartman , Hans Verkuil , Laurent Pinchart , Ramakrishnan Muthukrishnan , "open list:MEDIA INPUT INFRA..." , "open list:STAGING SUBSYSTEM , open list" Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2017 Lines: 52 Hi Hans, On Mon, May 18, 2015 at 9:15 AM, Hans Verkuil wrote: > > > On 05/18/2015 10:06 AM, Lad, Prabhakar wrote: >> On Mon, May 18, 2015 at 7:51 AM, Michal Kubecek wrote: >>> On Sun, May 17, 2015 at 07:18:42PM +0200, Alex Dowad wrote: >>>> This fixes a checkpatch style error in vpfe_buffer_queue_setup. >>>> >>>> Signed-off-by: Alex Dowad >>>> --- >>>> drivers/staging/media/davinci_vpfe/vpfe_video.c | 2 +- >>>> 1 file changed, 1 insertion(+), 1 deletion(-) >>>> >>>> diff --git a/drivers/staging/media/davinci_vpfe/vpfe_video.c b/drivers/staging/media/davinci_vpfe/vpfe_video.c >>>> index 06d48d5..04a687c 100644 >>>> --- a/drivers/staging/media/davinci_vpfe/vpfe_video.c >>>> +++ b/drivers/staging/media/davinci_vpfe/vpfe_video.c >>>> @@ -1095,7 +1095,7 @@ vpfe_buffer_queue_setup(struct vb2_queue *vq, const struct v4l2_format *fmt, >>>> size = video->fmt.fmt.pix.sizeimage; >>>> >>>> if (vpfe_dev->video_limit) { >>>> - while (size * *nbuffers > vpfe_dev->video_limit) >>>> + while (size * (*nbuffers) > vpfe_dev->video_limit) >>>> (*nbuffers)--; >>>> } >>>> if (pipe->state == VPFE_PIPELINE_STREAM_CONTINUOUS) { >>> >>> Style issue aside, is there a reason not to use >>> >>> if (size * *nbuffers > vpfe_dev->video_limit) >>> *nbuffers = vpfe_dev->video_limit / size; >>> >>> instead? >>> >> I would prefer this. > > As far as I can see video_limit is never set at all, so this code (and the video_limit > field) can just be removed. > > I think this is a left-over from old code, long since removed. > Yes makes sense, I'll fix it up and post a patch for it. Cheers, --Prabhakar Lad -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/