public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Michal Kubecek <mkubecek@suse.cz>
To: Alex Dowad <alexinbeijing@gmail.com>
Cc: Mauro Carvalho Chehab <mchehab@osg.samsung.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Hans Verkuil <hans.verkuil@cisco.com>,
	"Lad, Prabhakar" <prabhakar.csengg@gmail.com>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Ramakrishnan Muthukrishnan <ramakrmu@cisco.com>,
	"open list:MEDIA INPUT INFRA..." <linux-media@vger.kernel.org>,
	"open list:STAGING SUBSYSTEM" <devel@driverdev.osuosl.org>,
	open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] Clarify expression which uses both multiplication and pointer dereference
Date: Mon, 18 May 2015 08:51:58 +0200	[thread overview]
Message-ID: <20150518065158.GA17391@unicorn.suse.cz> (raw)
In-Reply-To: <1431883124-4937-1-git-send-email-alexinbeijing@gmail.com>

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 <alexinbeijing@gmail.com>
> ---
>  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?

                                                          Michal Kubecek


  parent reply	other threads:[~2015-05-18  6:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-17 17:18 [PATCH] Clarify expression which uses both multiplication and pointer dereference Alex Dowad
2015-05-17 19:43 ` Laurent Pinchart
2015-05-17 20:16 ` Joe Perches
2015-05-18  6:51 ` Michal Kubecek [this message]
2015-05-18  8:06   ` Lad, Prabhakar
     [not found]     ` <55599F8A.6030401@xs4all.nl>
2015-05-18 10:06       ` Lad, Prabhakar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150518065158.GA17391@unicorn.suse.cz \
    --to=mkubecek@suse.cz \
    --cc=alexinbeijing@gmail.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=hans.verkuil@cisco.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@osg.samsung.com \
    --cc=prabhakar.csengg@gmail.com \
    --cc=ramakrmu@cisco.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox