* [PATCH] staging : osc : Remove braces from single-line body
@ 2016-12-15 1:33 Tabrez khan
2016-12-15 1:38 ` Greg KH
0 siblings, 1 reply; 4+ messages in thread
From: Tabrez khan @ 2016-12-15 1:33 UTC (permalink / raw)
To: andreas.dilger, jsimmons; +Cc: gregkh, lustre-devel, devel, linux-kernel
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;
- }
-
pga->flag &= ~OBD_BRW_FROM_GRANT;
atomic_long_dec(&obd_dirty_pages);
cli->cl_dirty_pages--;
--
2.7.4
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH] staging : osc : Remove braces from single-line body
2016-12-15 1:33 [PATCH] staging : osc : Remove braces from single-line body Tabrez khan
@ 2016-12-15 1:38 ` Greg KH
2016-12-15 14:39 ` Tabrez Khan
0 siblings, 1 reply; 4+ messages in thread
From: Greg KH @ 2016-12-15 1:38 UTC (permalink / raw)
To: Tabrez khan; +Cc: andreas.dilger, jsimmons, lustre-devel, devel, linux-kernel
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?
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] staging : osc : Remove braces from single-line body
2016-12-15 1:38 ` Greg KH
@ 2016-12-15 14:39 ` Tabrez Khan
2016-12-15 16:07 ` Greg KH
0 siblings, 1 reply; 4+ messages in thread
From: Tabrez Khan @ 2016-12-15 14:39 UTC (permalink / raw)
To: Greg KH; +Cc: andreas.dilger, jsimmons, lustre-devel, devel, linux-kernel
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.
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] staging : osc : Remove braces from single-line body
2016-12-15 14:39 ` Tabrez Khan
@ 2016-12-15 16:07 ` Greg KH
0 siblings, 0 replies; 4+ messages in thread
From: Greg KH @ 2016-12-15 16:07 UTC (permalink / raw)
To: Tabrez Khan; +Cc: devel, andreas.dilger, linux-kernel, lustre-devel
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?
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-12-15 16:07 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-15 1:33 [PATCH] staging : osc : Remove braces from single-line body Tabrez khan
2016-12-15 1:38 ` Greg KH
2016-12-15 14:39 ` Tabrez Khan
2016-12-15 16:07 ` Greg KH
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox