* [PATCH] Clarify expression which uses both multiplication and pointer dereference
@ 2015-05-17 17:18 Alex Dowad
2015-05-17 19:43 ` Laurent Pinchart
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Alex Dowad @ 2015-05-17 17:18 UTC (permalink / raw)
To: Mauro Carvalho Chehab, Greg Kroah-Hartman, Hans Verkuil, Lad,
Prabhakar, Laurent Pinchart, Ramakrishnan Muthukrishnan,
open list:MEDIA INPUT INFRA...,
open list:STAGING SUBSYSTEM, open list
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) {
--
2.0.0.GIT
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] Clarify expression which uses both multiplication and pointer dereference
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
2 siblings, 0 replies; 6+ messages in thread
From: Laurent Pinchart @ 2015-05-17 19:43 UTC (permalink / raw)
To: Alex Dowad
Cc: Mauro Carvalho Chehab, Greg Kroah-Hartman, Hans Verkuil, Lad,
Prabhakar, Ramakrishnan Muthukrishnan,
open list:MEDIA INPUT INFRA...,
open list:STAGING SUBSYSTEM, open list
Hi Alex,
Thank you for the patch.
On Sunday 17 May 2015 19:18:42 Alex Dowad wrote:
> This fixes a checkpatch style error in vpfe_buffer_queue_setup.
>
> Signed-off-by: Alex Dowad <alexinbeijing@gmail.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.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) {
--
Regards,
Laurent Pinchart
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] Clarify expression which uses both multiplication and pointer dereference
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
2 siblings, 0 replies; 6+ messages in thread
From: Joe Perches @ 2015-05-17 20:16 UTC (permalink / raw)
To: Alex Dowad
Cc: Mauro Carvalho Chehab, Greg Kroah-Hartman, Hans Verkuil, Lad,
Prabhakar, Laurent Pinchart, Ramakrishnan Muthukrishnan,
open list:MEDIA INPUT INFRA...,
open list:STAGING SUBSYSTEM, open list
On Sun, 2015-05-17 at 19:18 +0200, Alex Dowad wrote:
> This fixes a checkpatch style error in vpfe_buffer_queue_setup.
There is no checkpatch message for this style.
Nor should there be.
> diff --git 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,
> - while (size * *nbuffers > vpfe_dev->video_limit)
> + while (size * (*nbuffers) > vpfe_dev->video_limit)
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] Clarify expression which uses both multiplication and pointer dereference
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
2015-05-18 8:06 ` Lad, Prabhakar
2 siblings, 1 reply; 6+ messages in thread
From: Michal Kubecek @ 2015-05-18 6:51 UTC (permalink / raw)
To: Alex Dowad
Cc: Mauro Carvalho Chehab, Greg Kroah-Hartman, Hans Verkuil, Lad,
Prabhakar, Laurent Pinchart, Ramakrishnan Muthukrishnan,
open list:MEDIA INPUT INFRA...,
open list:STAGING SUBSYSTEM, open list
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
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] Clarify expression which uses both multiplication and pointer dereference
2015-05-18 6:51 ` Michal Kubecek
@ 2015-05-18 8:06 ` Lad, Prabhakar
[not found] ` <55599F8A.6030401@xs4all.nl>
0 siblings, 1 reply; 6+ messages in thread
From: Lad, Prabhakar @ 2015-05-18 8:06 UTC (permalink / raw)
To: Michal Kubecek
Cc: 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
On Mon, May 18, 2015 at 7:51 AM, Michal Kubecek <mkubecek@suse.cz> 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@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?
>
I would prefer this.
Cheers,
--Prabhakar Lad
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] Clarify expression which uses both multiplication and pointer dereference
[not found] ` <55599F8A.6030401@xs4all.nl>
@ 2015-05-18 10:06 ` Lad, Prabhakar
0 siblings, 0 replies; 6+ messages in thread
From: Lad, Prabhakar @ 2015-05-18 10:06 UTC (permalink / raw)
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 <devel@driverdev.osuosl.org>,
open list
Hi Hans,
On Mon, May 18, 2015 at 9:15 AM, Hans Verkuil <hverkuil@xs4all.nl> wrote:
>
>
> On 05/18/2015 10:06 AM, Lad, Prabhakar wrote:
>> On Mon, May 18, 2015 at 7:51 AM, Michal Kubecek <mkubecek@suse.cz> 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@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?
>>>
>> 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
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2015-05-18 10:07 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2015-05-18 8:06 ` Lad, Prabhakar
[not found] ` <55599F8A.6030401@xs4all.nl>
2015-05-18 10:06 ` Lad, Prabhakar
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).