2020-08-25 05:07:43

by Joe Perches

[permalink] [raw]
Subject: [PATCH 08/29] dma-buf: Avoid comma separated statements

Use semicolons and braces.

Signed-off-by: Joe Perches <[email protected]>
---
drivers/dma-buf/st-dma-fence.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/dma-buf/st-dma-fence.c b/drivers/dma-buf/st-dma-fence.c
index e593064341c8..c8a12d7ad71a 100644
--- a/drivers/dma-buf/st-dma-fence.c
+++ b/drivers/dma-buf/st-dma-fence.c
@@ -471,8 +471,11 @@ static int thread_signal_callback(void *arg)
dma_fence_signal(f1);

smp_store_mb(cb.seen, false);
- if (!f2 || dma_fence_add_callback(f2, &cb.cb, simple_callback))
- miss++, cb.seen = true;
+ if (!f2 ||
+ dma_fence_add_callback(f2, &cb.cb, simple_callback)) {
+ miss++;
+ cb.seen = true;
+ }

if (!t->before)
dma_fence_signal(f1);
--
2.26.0


2020-08-26 15:12:26

by Christian König

[permalink] [raw]
Subject: Re: [PATCH 08/29] dma-buf: Avoid comma separated statements

Am 25.08.20 um 06:56 schrieb Joe Perches:
> Use semicolons and braces.
>
> Signed-off-by: Joe Perches <[email protected]>

Acked-by: Christian König <[email protected]>

> ---
> drivers/dma-buf/st-dma-fence.c | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/dma-buf/st-dma-fence.c b/drivers/dma-buf/st-dma-fence.c
> index e593064341c8..c8a12d7ad71a 100644
> --- a/drivers/dma-buf/st-dma-fence.c
> +++ b/drivers/dma-buf/st-dma-fence.c
> @@ -471,8 +471,11 @@ static int thread_signal_callback(void *arg)
> dma_fence_signal(f1);
>
> smp_store_mb(cb.seen, false);
> - if (!f2 || dma_fence_add_callback(f2, &cb.cb, simple_callback))
> - miss++, cb.seen = true;
> + if (!f2 ||
> + dma_fence_add_callback(f2, &cb.cb, simple_callback)) {
> + miss++;
> + cb.seen = true;
> + }
>
> if (!t->before)
> dma_fence_signal(f1);

2020-09-03 15:13:21

by Sumit Semwal

[permalink] [raw]
Subject: Re: [PATCH 08/29] dma-buf: Avoid comma separated statements

Hello Joe,

On Wed, 26 Aug 2020 at 20:38, Christian König <[email protected]> wrote:
>
> Am 25.08.20 um 06:56 schrieb Joe Perches:
> > Use semicolons and braces.
> >
> > Signed-off-by: Joe Perches <[email protected]>
>
> Acked-by: Christian König <[email protected]>
FWIW,
Acked-by: Sumit Semwal <[email protected]>

>
> > ---
> > drivers/dma-buf/st-dma-fence.c | 7 +++++--
> > 1 file changed, 5 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/dma-buf/st-dma-fence.c b/drivers/dma-buf/st-dma-fence.c
> > index e593064341c8..c8a12d7ad71a 100644
> > --- a/drivers/dma-buf/st-dma-fence.c
> > +++ b/drivers/dma-buf/st-dma-fence.c
> > @@ -471,8 +471,11 @@ static int thread_signal_callback(void *arg)
> > dma_fence_signal(f1);
> >
> > smp_store_mb(cb.seen, false);
> > - if (!f2 || dma_fence_add_callback(f2, &cb.cb, simple_callback))
> > - miss++, cb.seen = true;
> > + if (!f2 ||
> > + dma_fence_add_callback(f2, &cb.cb, simple_callback)) {
> > + miss++;
> > + cb.seen = true;
> > + }
> >
> > if (!t->before)
> > dma_fence_signal(f1);
>

2020-09-04 11:46:03

by Kieran Bingham

[permalink] [raw]
Subject: Re: [PATCH 08/29] dma-buf: Avoid comma separated statements

Hi Joe,

Nice, I only see three of these on the linux-media list, so I'll only
look at those, but I'm pleased to see this is treewide ;-)

Definitely prefer this.

On 25/08/2020 05:56, Joe Perches wrote:
> Use semicolons and braces.
>
> Signed-off-by: Joe Perches <[email protected]>

Reviewed-by: Kieran Bingham <[email protected]>

> ---
> drivers/dma-buf/st-dma-fence.c | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/dma-buf/st-dma-fence.c b/drivers/dma-buf/st-dma-fence.c
> index e593064341c8..c8a12d7ad71a 100644
> --- a/drivers/dma-buf/st-dma-fence.c
> +++ b/drivers/dma-buf/st-dma-fence.c
> @@ -471,8 +471,11 @@ static int thread_signal_callback(void *arg)
> dma_fence_signal(f1);
>
> smp_store_mb(cb.seen, false);
> - if (!f2 || dma_fence_add_callback(f2, &cb.cb, simple_callback))
> - miss++, cb.seen = true;
> + if (!f2 ||
> + dma_fence_add_callback(f2, &cb.cb, simple_callback)) {
> + miss++;
> + cb.seen = true;
> + }
>
> if (!t->before)
> dma_fence_signal(f1);
>

2020-09-04 21:35:44

by Joe Perches

[permalink] [raw]
Subject: Re: [PATCH 08/29] dma-buf: Avoid comma separated statements

On Fri, 2020-09-04 at 12:42 +0100, Kieran Bingham wrote:
> I'm pleased to see this is treewide ;-)
> Definitely prefer this.

These are only the comma uses in if/do/while blocks that
would also need braces as separate statements.

There a multiple dozens more just with single statements
terminated by commas and not semicolons.

See: https://lore.kernel.org/patchwork/patch/1291033/


2021-01-30 18:50:41

by Joe Perches

[permalink] [raw]
Subject: Re: [PATCH 08/29] dma-buf: Avoid comma separated statements

On Mon, 2020-08-24 at 21:56 -0700, Joe Perches wrote:
> Use semicolons and braces.

Ping?

> Signed-off-by: Joe Perches <[email protected]>
> ---
> ?drivers/dma-buf/st-dma-fence.c | 7 +++++--
> ?1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/dma-buf/st-dma-fence.c b/drivers/dma-buf/st-dma-fence.c
> index e593064341c8..c8a12d7ad71a 100644
> --- a/drivers/dma-buf/st-dma-fence.c
> +++ b/drivers/dma-buf/st-dma-fence.c
> @@ -471,8 +471,11 @@ static int thread_signal_callback(void *arg)
> ? dma_fence_signal(f1);
> ?
>
> ? smp_store_mb(cb.seen, false);
> - if (!f2 || dma_fence_add_callback(f2, &cb.cb, simple_callback))
> - miss++, cb.seen = true;
> + if (!f2 ||
> + dma_fence_add_callback(f2, &cb.cb, simple_callback)) {
> + miss++;
> + cb.seen = true;
> + }
> ?
>
> ? if (!t->before)
> ? dma_fence_signal(f1);


2021-01-31 20:14:53

by Joe Perches

[permalink] [raw]
Subject: Re: [PATCH 08/29] dma-buf: Avoid comma separated statements

On Wed, 2021-02-03 at 14:26 +0100, Christian K?nig wrote:
> Am 30.01.21 um 19:47 schrieb Joe Perches:
> > On Mon, 2020-08-24 at 21:56 -0700, Joe Perches wrote:
> > > Use semicolons and braces.
> > Ping?
> > > Signed-off-by: Joe Perches <[email protected]>
> Reviewed-by: Christian K?nig <[email protected]>
>
> Do you have commit rights to drm-misc-next?

No.

> > > ---
> > > ??drivers/dma-buf/st-dma-fence.c | 7 +++++--
> > > ??1 file changed, 5 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/drivers/dma-buf/st-dma-fence.c b/drivers/dma-buf/st-dma-fence.c
> > > index e593064341c8..c8a12d7ad71a 100644
> > > --- a/drivers/dma-buf/st-dma-fence.c
> > > +++ b/drivers/dma-buf/st-dma-fence.c
> > > @@ -471,8 +471,11 @@ static int thread_signal_callback(void *arg)
> > > ?? dma_fence_signal(f1);
> > >
> > > ?? smp_store_mb(cb.seen, false);
> > > - if (!f2 || dma_fence_add_callback(f2, &cb.cb, simple_callback))
> > > - miss++, cb.seen = true;
> > > + if (!f2 ||
> > > + dma_fence_add_callback(f2, &cb.cb, simple_callback)) {
> > > + miss++;
> > > + cb.seen = true;
> > > + }
> > >
> > > ?? if (!t->before)
> > > ?? dma_fence_signal(f1);
> >
>


2021-01-31 21:34:50

by Christian König

[permalink] [raw]
Subject: Re: [PATCH 08/29] dma-buf: Avoid comma separated statements

Am 31.01.21 um 18:39 schrieb Joe Perches:
> On Wed, 2021-02-03 at 14:26 +0100, Christian König wrote:
>> Am 30.01.21 um 19:47 schrieb Joe Perches:
>>> On Mon, 2020-08-24 at 21:56 -0700, Joe Perches wrote:
>>>> Use semicolons and braces.
>>> Ping?
>>>> Signed-off-by: Joe Perches <[email protected]>
>> Reviewed-by: Christian König <[email protected]>
>>
>> Do you have commit rights to drm-misc-next?
> No.

Pushed.

Thanks for the help,
Christian.

>
>>>> ---
>>>>   drivers/dma-buf/st-dma-fence.c | 7 +++++--
>>>>   1 file changed, 5 insertions(+), 2 deletions(-)
>>>>
>>>> diff --git a/drivers/dma-buf/st-dma-fence.c b/drivers/dma-buf/st-dma-fence.c
>>>> index e593064341c8..c8a12d7ad71a 100644
>>>> --- a/drivers/dma-buf/st-dma-fence.c
>>>> +++ b/drivers/dma-buf/st-dma-fence.c
>>>> @@ -471,8 +471,11 @@ static int thread_signal_callback(void *arg)
>>>>    dma_fence_signal(f1);
>>>>
>>>>    smp_store_mb(cb.seen, false);
>>>> - if (!f2 || dma_fence_add_callback(f2, &cb.cb, simple_callback))
>>>> - miss++, cb.seen = true;
>>>> + if (!f2 ||
>>>> + dma_fence_add_callback(f2, &cb.cb, simple_callback)) {
>>>> + miss++;
>>>> + cb.seen = true;
>>>> + }
>>>>
>>>>    if (!t->before)
>>>>    dma_fence_signal(f1);
>

2021-01-31 21:36:29

by Christian König

[permalink] [raw]
Subject: Re: [PATCH 08/29] dma-buf: Avoid comma separated statements

Am 30.01.21 um 19:47 schrieb Joe Perches:
> On Mon, 2020-08-24 at 21:56 -0700, Joe Perches wrote:
>> Use semicolons and braces.
> Ping?
>
>> Signed-off-by: Joe Perches <[email protected]>

Reviewed-by: Christian König <[email protected]>

Do you have commit rights to drm-misc-next?

>> ---
>>  drivers/dma-buf/st-dma-fence.c | 7 +++++--
>>  1 file changed, 5 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/dma-buf/st-dma-fence.c b/drivers/dma-buf/st-dma-fence.c
>> index e593064341c8..c8a12d7ad71a 100644
>> --- a/drivers/dma-buf/st-dma-fence.c
>> +++ b/drivers/dma-buf/st-dma-fence.c
>> @@ -471,8 +471,11 @@ static int thread_signal_callback(void *arg)
>>   dma_fence_signal(f1);
>>
>>
>>   smp_store_mb(cb.seen, false);
>> - if (!f2 || dma_fence_add_callback(f2, &cb.cb, simple_callback))
>> - miss++, cb.seen = true;
>> + if (!f2 ||
>> + dma_fence_add_callback(f2, &cb.cb, simple_callback)) {
>> + miss++;
>> + cb.seen = true;
>> + }
>>
>>
>>   if (!t->before)
>>   dma_fence_signal(f1);
>

2021-02-01 21:56:55

by Lyude Paul

[permalink] [raw]
Subject: Re: [PATCH 08/29] dma-buf: Avoid comma separated statements

This is entirely unrelated to this thread, but I noticed when going through dri-
devel that this email is somehow dated two days in the future from now.

On Wed, 2021-02-03 at 14:26 +0100, Christian König wrote:
> Am 30.01.21 um 19:47 schrieb Joe Perches:
> > On Mon, 2020-08-24 at 21:56 -0700, Joe Perches wrote:
> > > Use semicolons and braces.
> > Ping?
> >  
> > > Signed-off-by: Joe Perches <[email protected]>
>
> Reviewed-by: Christian König <[email protected]>
>
> Do you have commit rights to drm-misc-next?
>
> > > ---
> > >   drivers/dma-buf/st-dma-fence.c | 7 +++++--
> > >   1 file changed, 5 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/drivers/dma-buf/st-dma-fence.c b/drivers/dma-buf/st-dma-
> > > fence.c
> > > index e593064341c8..c8a12d7ad71a 100644
> > > --- a/drivers/dma-buf/st-dma-fence.c
> > > +++ b/drivers/dma-buf/st-dma-fence.c
> > > @@ -471,8 +471,11 @@ static int thread_signal_callback(void *arg)
> > >                         dma_fence_signal(f1);
> > >  
> > >
> > >                 smp_store_mb(cb.seen, false);
> > > -               if (!f2 || dma_fence_add_callback(f2, &cb.cb,
> > > simple_callback))
> > > -                       miss++, cb.seen = true;
> > > +               if (!f2 ||
> > > +                   dma_fence_add_callback(f2, &cb.cb, simple_callback)) {
> > > +                       miss++;
> > > +                       cb.seen = true;
> > > +               }
> > >  
> > >
> > >                 if (!t->before)
> > >                         dma_fence_signal(f1);
> >
>
> _______________________________________________
> dri-devel mailing list
> [email protected]
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

--
Sincerely,
Lyude Paul (she/her)
Software Engineer at Red Hat

Note: I deal with a lot of emails and have a lot of bugs on my plate. If you've
asked me a question, are waiting for a review/merge on a patch, etc. and I
haven't responded in a while, please feel free to send me another email to check
on my status. I don't bite!

2021-02-02 08:37:07

by Christian König

[permalink] [raw]
Subject: Re: [Linaro-mm-sig] [PATCH 08/29] dma-buf: Avoid comma separated statements

Yeah, known issue.

An NTP server which I don't have access to has gone bananas and
sometimes spits out invalid time stamps.

Only thing I can do is wait for an admin to take care of this.

Christian.

Am 01.02.21 um 22:54 schrieb Lyude Paul:
> This is entirely unrelated to this thread, but I noticed when going through dri-
> devel that this email is somehow dated two days in the future from now.
>
> On Wed, 2021-02-03 at 14:26 +0100, Christian König wrote:
>> Am 30.01.21 um 19:47 schrieb Joe Perches:
>>> On Mon, 2020-08-24 at 21:56 -0700, Joe Perches wrote:
>>>> Use semicolons and braces.
>>> Ping?
>>>
>>>> Signed-off-by: Joe Perches <[email protected]>
>> Reviewed-by: Christian König <[email protected]>
>>
>> Do you have commit rights to drm-misc-next?
>>
>>>> ---
>>>>   drivers/dma-buf/st-dma-fence.c | 7 +++++--
>>>>   1 file changed, 5 insertions(+), 2 deletions(-)
>>>>
>>>> diff --git a/drivers/dma-buf/st-dma-fence.c b/drivers/dma-buf/st-dma-
>>>> fence.c
>>>> index e593064341c8..c8a12d7ad71a 100644
>>>> --- a/drivers/dma-buf/st-dma-fence.c
>>>> +++ b/drivers/dma-buf/st-dma-fence.c
>>>> @@ -471,8 +471,11 @@ static int thread_signal_callback(void *arg)
>>>>                         dma_fence_signal(f1);
>>>>
>>>>
>>>>                 smp_store_mb(cb.seen, false);
>>>> -               if (!f2 || dma_fence_add_callback(f2, &cb.cb,
>>>> simple_callback))
>>>> -                       miss++, cb.seen = true;
>>>> +               if (!f2 ||
>>>> +                   dma_fence_add_callback(f2, &cb.cb, simple_callback)) {
>>>> +                       miss++;
>>>> +                       cb.seen = true;
>>>> +               }
>>>>
>>>>
>>>>                 if (!t->before)
>>>>                         dma_fence_signal(f1);
>> _______________________________________________
>> dri-devel mailing list
>> [email protected]
>> https://lists.freedesktop.org/mailman/listinfo/dri-devel

2021-02-03 00:38:11

by Lyude Paul

[permalink] [raw]
Subject: Re: [Linaro-mm-sig] [PATCH 08/29] dma-buf: Avoid comma separated statements

On Tue, 2021-02-02 at 09:33 +0100, Christian König wrote:
> Yeah, known issue.
>
> An NTP server which I don't have access to has gone bananas and
> sometimes spits out invalid time stamps.
>
> Only thing I can do is wait for an admin to take care of this.

haha it's ok! I just thought it was mildly entertaining to see, as my email
client formatted the message timestamp "Next Wednesday" :)

>
> Christian.
>
> Am 01.02.21 um 22:54 schrieb Lyude Paul:
> > This is entirely unrelated to this thread, but I noticed when going through
> > dri-
> > devel that this email is somehow dated two days in the future from now.
> >
> > On Wed, 2021-02-03 at 14:26 +0100, Christian König wrote:
> > > Am 30.01.21 um 19:47 schrieb Joe Perches:
> > > > On Mon, 2020-08-24 at 21:56 -0700, Joe Perches wrote:
> > > > > Use semicolons and braces.
> > > > Ping?
> > > >   
> > > > > Signed-off-by: Joe Perches <[email protected]>
> > > Reviewed-by: Christian König <[email protected]>
> > >
> > > Do you have commit rights to drm-misc-next?
> > >
> > > > > ---
> > > > >    drivers/dma-buf/st-dma-fence.c | 7 +++++--
> > > > >    1 file changed, 5 insertions(+), 2 deletions(-)
> > > > >
> > > > > diff --git a/drivers/dma-buf/st-dma-fence.c b/drivers/dma-buf/st-dma-
> > > > > fence.c
> > > > > index e593064341c8..c8a12d7ad71a 100644
> > > > > --- a/drivers/dma-buf/st-dma-fence.c
> > > > > +++ b/drivers/dma-buf/st-dma-fence.c
> > > > > @@ -471,8 +471,11 @@ static int thread_signal_callback(void *arg)
> > > > >                          dma_fence_signal(f1);
> > > > >   
> > > > >
> > > > >                  smp_store_mb(cb.seen, false);
> > > > > -               if (!f2 || dma_fence_add_callback(f2, &cb.cb,
> > > > > simple_callback))
> > > > > -                       miss++, cb.seen = true;
> > > > > +               if (!f2 ||
> > > > > +                   dma_fence_add_callback(f2, &cb.cb,
> > > > > simple_callback)) {
> > > > > +                       miss++;
> > > > > +                       cb.seen = true;
> > > > > +               }
> > > > >   
> > > > >
> > > > >                  if (!t->before)
> > > > >                          dma_fence_signal(f1);
> > > _______________________________________________
> > > dri-devel mailing list
> > > [email protected]
> > > https://lists.freedesktop.org/mailman/listinfo/dri-devel
>

--
Sincerely,
Lyude Paul (she/her)
Software Engineer at Red Hat

Note: I deal with a lot of emails and have a lot of bugs on my plate. If you've
asked me a question, are waiting for a review/merge on a patch, etc. and I
haven't responded in a while, please feel free to send me another email to check
on my status. I don't bite!