Re: [PATCH] Clarify expression which uses both multiplication and pointer dereference

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, May 18, 2015 at 7:51 AM, Michal Kubecek <mkubecek@xxxxxxx> 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 <alexinbeijing@xxxxxxxxx>
>> ---
>>  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.

Cheers,
--Prabhakar Lad
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux