Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1542431 > unrolled thread

Re: [PATCH] staging : osc : Remove braces from single-line body

Started byGreg KH <gregkh@linuxfoundation.org>
First post2016-12-15 02:40 +0100
Last post2016-12-15 17:10 +0100
Articles 3 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH] staging : osc : Remove braces from single-line body Greg KH <gregkh@linuxfoundation.org> - 2016-12-15 02:40 +0100
    Re: [PATCH] staging : osc : Remove braces from single-line body Tabrez Khan <khan.tabrez21@gmail.com> - 2016-12-15 15:40 +0100
      Re: [PATCH] staging : osc : Remove braces from single-line body Greg KH <gregkh@linuxfoundation.org> - 2016-12-15 17:10 +0100

#1542431 — Re: [PATCH] staging : osc : Remove braces from single-line body

FromGreg KH <gregkh@linuxfoundation.org>
Date2016-12-15 02:40 +0100
SubjectRe: [PATCH] staging : osc : Remove braces from single-line body
Message-ID<sOtbz-7Rw-3@gated-at.bofh.it>
On Thu, Dec 15, 2016 at 07:03:52AM +0530, Tabrez khan wrote:
> Remove unnecessary braces {} for single if statement block.
> This warning is found using checkpatch.pl.
> 
> Signed-off-by: Tabrez khan <khan.tabrez21@gmail.com>
> ---
>  drivers/staging/lustre/lustre/osc/osc_cache.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/staging/lustre/lustre/osc/osc_cache.c b/drivers/staging/lustre/lustre/osc/osc_cache.c
> index 4bbe219..5ded31a 100644
> --- a/drivers/staging/lustre/lustre/osc/osc_cache.c
> +++ b/drivers/staging/lustre/lustre/osc/osc_cache.c
> @@ -1420,10 +1420,8 @@ static void osc_release_write_grant(struct client_obd *cli,
>  				    struct brw_page *pga)
>  {
>  	assert_spin_locked(&cli->cl_loi_list_lock);
> -	if (!(pga->flag & OBD_BRW_FROM_GRANT)) {
> +	if (!(pga->flag & OBD_BRW_FROM_GRANT))
>  		return;
> -	}
> -

Why did you also delete the blank line?

[toc] | [next] | [standalone]


#1542780

FromTabrez Khan <khan.tabrez21@gmail.com>
Date2016-12-15 15:40 +0100
Message-ID<sOFmq-6RD-41@gated-at.bofh.it>
In reply to#1542431
On Thu, Dec 15, 2016 at 7:08 AM, Greg KH <gregkh@linuxfoundation.org> wrote:
> On Thu, Dec 15, 2016 at 07:03:52AM +0530, Tabrez khan wrote:
>> Remove unnecessary braces {} for single if statement block.
>> This warning is found using checkpatch.pl.
>>
>> Signed-off-by: Tabrez khan <khan.tabrez21@gmail.com>
>> ---
>>  drivers/staging/lustre/lustre/osc/osc_cache.c | 4 +---
>>  1 file changed, 1 insertion(+), 3 deletions(-)
>>
>> diff --git a/drivers/staging/lustre/lustre/osc/osc_cache.c b/drivers/staging/lustre/lustre/osc/osc_cache.c
>> index 4bbe219..5ded31a 100644
>> --- a/drivers/staging/lustre/lustre/osc/osc_cache.c
>> +++ b/drivers/staging/lustre/lustre/osc/osc_cache.c
>> @@ -1420,10 +1420,8 @@ static void osc_release_write_grant(struct client_obd *cli,
>>                                   struct brw_page *pga)
>>  {
>>       assert_spin_locked(&cli->cl_loi_list_lock);
>> -     if (!(pga->flag & OBD_BRW_FROM_GRANT)) {
>> +     if (!(pga->flag & OBD_BRW_FROM_GRANT))
>>               return;
>> -     }
>> -
>
> Why did you also delete the blank line?

Because to keep the kernel coding style as close as possible and after
deleting brace it leads to extra empty line so i delete it.
Please guide if done something wrong.

[toc] | [prev] | [next] | [standalone]


#1542858

FromGreg KH <gregkh@linuxfoundation.org>
Date2016-12-15 17:10 +0100
Message-ID<sOGLw-7Up-31@gated-at.bofh.it>
In reply to#1542780
On Thu, Dec 15, 2016 at 08:09:16PM +0530, Tabrez Khan wrote:
> On Thu, Dec 15, 2016 at 7:08 AM, Greg KH <gregkh@linuxfoundation.org> wrote:
> > On Thu, Dec 15, 2016 at 07:03:52AM +0530, Tabrez khan wrote:
> >> Remove unnecessary braces {} for single if statement block.
> >> This warning is found using checkpatch.pl.
> >>
> >> Signed-off-by: Tabrez khan <khan.tabrez21@gmail.com>
> >> ---
> >>  drivers/staging/lustre/lustre/osc/osc_cache.c | 4 +---
> >>  1 file changed, 1 insertion(+), 3 deletions(-)
> >>
> >> diff --git a/drivers/staging/lustre/lustre/osc/osc_cache.c b/drivers/staging/lustre/lustre/osc/osc_cache.c
> >> index 4bbe219..5ded31a 100644
> >> --- a/drivers/staging/lustre/lustre/osc/osc_cache.c
> >> +++ b/drivers/staging/lustre/lustre/osc/osc_cache.c
> >> @@ -1420,10 +1420,8 @@ static void osc_release_write_grant(struct client_obd *cli,
> >>                                   struct brw_page *pga)
> >>  {
> >>       assert_spin_locked(&cli->cl_loi_list_lock);
> >> -     if (!(pga->flag & OBD_BRW_FROM_GRANT)) {
> >> +     if (!(pga->flag & OBD_BRW_FROM_GRANT))
> >>               return;
> >> -     }
> >> -
> >
> > Why did you also delete the blank line?
> 
> Because to keep the kernel coding style as close as possible and after
> deleting brace it leads to extra empty line so i delete it.
> Please guide if done something wrong.

The extra blank line is fine, please leave it, it makes the code more
readable, don't you think?

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web