drivers/isdn/divert: beautify code, delete useless 'break'
Subsystems (2)
PATCH 1/1 drivers/isdn/divert: beautify code, delete useless 'break'
delete useless break statements.
--- drivers/isdn/divert/isdn_divert.c | 2 -- 1 files changed, 0 insertions(+), 2 deletions(-)
drivers/isdn/divert/isdn_divert.c +0 -2
@@ -442,7 +442,6 @@ static int isdn_divert_icall(isdn_ctrl *ic)switch (dv->rule.action) {case DEFLECT_IGNORE :return (0 ); -break ;case DEFLECT_ALERT :case DEFLECT_PROCEED :
@@ -511,7 +510,6 @@ static int isdn_divert_icall(isdn_ctrl *ic)default :return (0 );/* ignore call */ -break ; }/* switch action */ break ; }/* scan_table */
Signature · 1 line
1.7.7.6
Hello.
Quoted 20 lines · Chen Gang
delete useless break statements.
Signed-off-by Chen Gang <[email protected]>--- drivers/isdn/divert/isdn_divert.c | 2 -- 1 files changed, 0 insertions(+), 2 deletions(-)drivers/isdn/divert/isdn_divert.c +0
-1@@ -442,7 +442,6 @@ static int isdn_divert_icall(isdn_ctrl *ic)switch (dv->rule.action) {case DEFLECT_IGNORE :return (0 ); -break ;case DEFLECT_ALERT :case DEFLECT_PROCEED :
drivers/isdn/divert/isdn_divert.c static int isdn_divert_icall(isdn_ctrl *ic) · line 514
Quoted 4 lines
drivers/isdn/divert/isdn_divert.c +0
-1@@ -511,7 +510,6 @@ static int isdn_divert_icall(isdn_ctrl *ic)default :return (0 );/* ignore call */ -break ;
You could have removed stupid () around 0, while at it.
WBR, Sergei
Quoted 16 lines · Sergei Shtylyov
Quoted 16 lines
drivers/isdn/divert/isdn_divert.c +0
-1@@ -442,7 +442,6 @@ static int isdn_divert_icall(isdn_ctrl *ic)switch (dv->rule.action) {case DEFLECT_IGNORE :return (0 ); -break ;case DEFLECT_ALERT :case DEFLECT_PROCEED :@@ -511,7 +510,6 @@ static int isdn_divert_icall(isdn_ctrl *ic)
Quoted 5 lines
drivers/isdn/divert/isdn_divert.c static int isdn_divert_icall(isdn_ctrl *ic) · line 514
Quoted 3 lines
drivers/isdn/divert/isdn_divert.c +0
-1default :return (0 );/* ignore call */ -break ;You could have removed stupid () around 0, while at it.
oh, really, I should do it.
I will send patch v2 for it
thanks.
:-)
Signature · 3 lines
Chen Gang Asianux Corporation
PATCH 1/1 ISDN:divert: beautify code: useless 'break', 'return (0)', additional comments.
In reply to Sergei Shtylyov delete useless 'break' after 'return'.
let 'return 0' instead of 'return (0)'
also give a comment for 'break' to let readers notice it.
--- drivers/isdn/divert/isdn_divert.c | 8 +++----- 1 files changed, 3 insertions(+), 5 deletions(-)
drivers/isdn/divert/isdn_divert.c +3 -5
@@ -441,8 +441,7 @@ static int isdn_divert_icall(isdn_ctrl *ic)switch (dv->rule.action) {case DEFLECT_IGNORE : -return (0 ); -break ; +return 0 ;case DEFLECT_ALERT :case DEFLECT_PROCEED :
@@ -510,10 +509,9 @@ static int isdn_divert_icall(isdn_ctrl *ic)break ;default : -return (0 );/* ignore call */ -break ; +return 0 ;/* ignore call */ }/* switch action */ -break ; +break ;/* will break the 'for' looping */ }/* scan_table */ if (cs) {
Signature · 1 line
1.7.7.6
Re: [PATCH] ISDN:divert: beautify code: useless 'break', 'return (0)', additional comments.
From: Chen Gang <[email protected]>
Date: Tue, 02 Apr 2013 09:37:56 +0800
Quoted 7 lines
delete useless 'break' after 'return'.
let 'return 0' instead of 'return (0)'
also give a comment for 'break' to let readers notice it.Signed-off-by Chen Gang <[email protected]>Signed-off-by Sergei Shtylyov <[email protected]>
Applied.