From mboxrd@z Thu Jan 1 00:00:00 1970 From: SF Markus Elfring Date: Mon, 25 Jan 2016 18:15:08 +0000 Subject: Re: [PATCH 1/2] [media] m88rs6000t: Better exception handling in five functions Message-Id: <56A6662C.3000804@users.sourceforge.net> List-Id: References: <566ABCD9.1060404@users.sourceforge.net> <5680FDB3.7060305@users.sourceforge.net> <56810F56.4080306@users.sourceforge.net> <568148FD.7080209@users.sourceforge.net> <5681497E.7030702@users.sourceforge.net> <20160125150136.449f2593@recife.lan> In-Reply-To: <20160125150136.449f2593@recife.lan> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, LKML , kernel-janitors@vger.kernel.org, Julia Lawall >> This issue was detected by using the Coccinelle software. >> >> Move the jump label directly before the desired log statement >> so that the variable "ret" will not be checked once more >> after a function call. >> Use the identifier "report_failure" instead of "err". >> >> Suggested-by: Julia Lawall >> Signed-off-by: Markus Elfring >> --- >> drivers/media/tuners/m88rs6000t.c | 154 +++++++++++++++++++------------------- >> 1 file changed, 78 insertions(+), 76 deletions(-) >> >> diff --git a/drivers/media/tuners/m88rs6000t.c b/drivers/media/tuners/m88rs6000t.c >> index 504bfbc..7e59a9f 100644 >> --- a/drivers/media/tuners/m88rs6000t.c >> +++ b/drivers/media/tuners/m88rs6000t.c >> @@ -44,7 +44,7 @@ static int m88rs6000t_set_demod_mclk(struct dvb_frontend *fe) >> /* select demod main mclk */ >> ret = regmap_read(dev->regmap, 0x15, &utmp); >> if (ret) >> - goto err; >> + goto report_failure; > > Why to be so verbose? Does the document "CodingStyle" give an indication in the section "Chapter 7: Centralized exiting of functions"? > Calling it as "err" is enough, It seems that some short identifiers are popular during software development. > and it means less code to type if we need to add another goto. Would you like to increase the usage of jump labels which will contain only a single character? Regards, Markus