staging : osc : Remove braces from single-line body
PATCH 1/1 staging : osc : Remove braces from single-line body
Remove unnecessary braces {} for single if statement block. This warning is found using checkpatch.pl.
--- drivers/staging/lustre/lustre/osc/osc_cache.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/staging/lustre/lustre/osc/osc_cache.c +1 -3
@@ -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--;
Signature · 1 line
2.7.4
Greg KH
maintainerQuoted 13 lines · Tabrez khan
Remove unnecessary braces {} for single if statement block. This warning is found using checkpatch.pl.
Signed-off-by Tabrez khan <[email protected]>--- drivers/staging/lustre/lustre/osc/osc_cache.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)drivers/staging/lustre/lustre/osc/osc_cache.c +0
-0
drivers/staging/lustre/lustre/osc/osc_cache.c static void osc_release_write_grant(struct client_obd *cli, · line 1426
Quoted 8 lines
drivers/staging/lustre/lustre/osc/osc_cache.c +1
-3@@ -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?
Quoted 9 lines · Greg KH
Quoted 8 lines · Tabrez khan
Remove unnecessary braces {} for single if statement block. This warning is found using checkpatch.pl.
Signed-off-by Tabrez khan <[email protected]>--- drivers/staging/lustre/lustre/osc/osc_cache.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
Quoted 15 lines
drivers/staging/lustre/lustre/osc/osc_cache.c static void osc_release_write_grant(struct client_obd *cli, · line 1426
Quoted 13 lines
drivers/staging/lustre/lustre/osc/osc_cache.c +1
-3@@ -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.
Greg KH
maintainerQuoted 26 lines · Tabrez Khan
Quoted 9 lines · Greg KH
Quoted 8 lines · Tabrez khan
Remove unnecessary braces {} for single if statement block. This warning is found using checkpatch.pl.
Signed-off-by Tabrez khan <[email protected]>--- drivers/staging/lustre/lustre/osc/osc_cache.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)Quoted 15 lines
drivers/staging/lustre/lustre/osc/osc_cache.c static void osc_release_write_grant(struct client_obd *cli, · line 1426
Quoted 13 lines
drivers/staging/lustre/lustre/osc/osc_cache.c +1
-3@@ -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?
Quoted 3 lines
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?