From: SF Markus Elfring <elfring@users.sourceforge.net>
To: Antti Palosaari <crope@iki.fi>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Mauro Carvalho Chehab <mchehab@osg.samsung.com>,
devel@driverdev.osuosl.org, linux-media@vger.kernel.org
Cc: LKML <linux-kernel@vger.kernel.org>,
kernel-janitors@vger.kernel.org,
Julia Lawall <julia.lawall@lip6.fr>
Subject: [PATCH 2/2] [media] mn88473: One function call less in mn88473_init() after error detection
Date: Mon, 01 Dec 2014 23:35:54 +0100 [thread overview]
Message-ID: <547CED4A.9000207@users.sourceforge.net> (raw)
In-Reply-To: <547CEBF5.4040004@users.sourceforge.net>
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 1 Dec 2014 23:15:20 +0100
The release_firmware() function was called by the mn88473_init() function even
if a previous function call "request_firmware" failed.
This implementation detail could be improved by the introduction of another
jump label.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/staging/media/mn88473/mn88473.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/media/mn88473/mn88473.c b/drivers/staging/media/mn88473/mn88473.c
index 52180bb..a333744 100644
--- a/drivers/staging/media/mn88473/mn88473.c
+++ b/drivers/staging/media/mn88473/mn88473.c
@@ -225,7 +225,7 @@ static int mn88473_init(struct dvb_frontend *fe)
ret = request_firmware(&fw, fw_file, &client->dev);
if (ret) {
dev_err(&client->dev, "firmare file '%s' not found\n", fw_file);
- goto err;
+ goto err_request_firmware;
}
dev_info(&client->dev, "downloading firmware from file '%s'\n",
@@ -261,9 +261,10 @@ static int mn88473_init(struct dvb_frontend *fe)
dev->warm = true;
return 0;
+
err:
release_firmware(fw);
-
+err_request_firmware:
dev_dbg(&client->dev, "failed=%d\n", ret);
return ret;
}
--
2.1.3
next prev parent reply other threads:[~2014-12-01 22:36 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <5307CAA2.8060406@users.sourceforge.net>
[not found] ` <alpine.DEB.2.02.1402212321410.2043@localhost6.localdomain6>
[not found] ` <530A086E.8010901@users.sourceforge.net>
[not found] ` <alpine.DEB.2.02.1402231635510.1985@localhost6.localdomain6>
[not found] ` <530A72AA.3000601@users.sourceforge.net>
[not found] ` <alpine.DEB.2.02.1402240658210.2090@localhost6.localdomain6>
[not found] ` <530B5FB6.6010207@users.sourceforge.net>
[not found] ` <alpine.DEB.2.10.1402241710370.2074@hadrien>
[not found] ` <530C5E18.1020800@users.sourceforge.net>
[not found] ` <alpine.DEB.2.10.1402251014170.2080@hadrien>
[not found] ` <530CD2C4.4050903@users.sourceforge.net>
[not found] ` <alpine.DEB.2.10.1402251840450.7035@hadrien>
[not found] ` <530CF8FF.8080600@users.sourceforge.net>
[not found] ` <alpine.DEB.2.02.1402252117150.2047@localhost6.localdomain6>
[not found] ` <530DD06F.4090703@users.sourceforge.net>
[not found] ` <alpine.DEB.2.02.1402262129250.2221@localhost6.localdomain6>
[not found] ` <5317A59D.4@users.sourceforge.net>
2014-11-20 8:19 ` [PATCH 0/3] [media] DVB-frontends: Deletion of a few unnecessary checks SF Markus Elfring
2014-11-20 8:29 ` [PATCH 2/3] [media] m88ds3103: One function call less in m88ds3103_init() after error detection SF Markus Elfring
2014-11-20 8:33 ` [PATCH 1/3] [media] DVB-frontends: Deletion of unnecessary checks before the function call "release_firmware" SF Markus Elfring
2014-11-20 8:39 ` [PATCH 3/3] [media] si2168: One function call less in si2168_init() after error detection SF Markus Elfring
2014-11-20 9:55 ` [PATCH 1/1] [media] firewire: Deletion of an unnecessary check before the function call "dvb_unregister_device" SF Markus Elfring
2014-11-20 14:41 ` Stefan Richter
2014-11-20 10:20 ` [PATCH 1/1] [media] i2c: Deletion of an unnecessary check before the function call "rc_unregister_device" SF Markus Elfring
2014-11-20 10:50 ` [PATCH 1/1] [media] platform: Deletion of unnecessary checks before two function calls SF Markus Elfring
2014-11-20 12:08 ` [PATCH 1/1] [media] rc: " SF Markus Elfring
2014-11-20 12:33 ` [PATCH 1/1] [media] USB: Deletion of unnecessary checks before three " SF Markus Elfring
2014-11-24 21:40 ` [PATCH 1/1] [media] Siano: Deletion of an unnecessary check before the function call "rc_unregister_device" SF Markus Elfring
2014-11-30 20:21 ` [PATCH 0/2] [media] tuners: Deletion of two unnecessary checks SF Markus Elfring
2014-11-30 20:25 ` [PATCH 1/2] [media] tuners: Deletion of unnecessary checks before the function call "release_firmware" SF Markus Elfring
2014-11-30 20:28 ` [PATCH 2/2] [media] tuners-si2157: One function call less in si2157_init() after error detection SF Markus Elfring
2014-11-30 21:55 ` [PATCH 1/1] [media] ddbridge: Deletion of an unnecessary check before the function call "dvb_unregister_device" SF Markus Elfring
2014-11-30 22:23 ` [PATCH 1/1] [media] V4L2: Deletion of an unnecessary check before the function call "vb2_put_vma" SF Markus Elfring
2014-12-01 9:46 ` Marek Szyprowski
2014-12-01 18:55 ` [PATCH 1/1] [media] lirc_zilog: Deletion of unnecessary checks before the function call "vfree" SF Markus Elfring
2014-12-01 22:30 ` [PATCH 0/2] [media] mn88473: Delete an unnecessary check SF Markus Elfring
2014-12-01 22:33 ` [PATCH 1/2] [media] mn88473: Deletion of an unnecessary check before the function call "release_firmware" SF Markus Elfring
2014-12-01 22:35 ` SF Markus Elfring [this message]
2015-02-01 19:11 ` [PATCH 0/2] [media] mn88472: Delete an unnecessary check SF Markus Elfring
2015-02-01 19:16 ` [PATCH 1/2] [media] mn88472: Deletion of an unnecessary check before the function call "release_firmware" SF Markus Elfring
2015-02-01 19:18 ` [PATCH 2/2] [media] mn88472: One function call less in mn88472_init() after error detection SF Markus Elfring
2015-02-02 12:44 ` [media] staging: bcm2048: Delete an unnecessary check before the function call "video_unregister_device" SF Markus Elfring
2015-02-03 14:10 ` [PATCH] [media] sp2: Delete an unnecessary check before the function call "kfree" SF Markus Elfring
2015-02-03 14:31 ` [PATCH] [media] V4L2: Delete an unnecessary check before the function call "media_entity_put" SF Markus Elfring
2015-02-03 16:18 ` [PATCH 0/2] DVB: Deletion of a few unnecessary checks SF Markus Elfring
2015-02-03 16:22 ` [PATCH 1/2] [media] DVB: Delete an unnecessary check before the function call "dvb_unregister_device" SF Markus Elfring
2015-02-03 16:23 ` [PATCH 2/2] [media] DVB: Less function calls in dvb_ca_en50221_init() after error detection SF Markus Elfring
2015-02-03 17:45 ` [PATCH] [media] stk-webcam: Delete an unnecessary check before the function call "vfree" SF Markus Elfring
2015-02-03 18:03 ` [PATCH] [media] au0828: Delete unnecessary checks before the function call "video_unregister_device" SF Markus Elfring
2015-11-05 18:45 ` [PATCH 0/2] [media] c8sectpfe: Deletion of a few unnecessary checks SF Markus Elfring
2015-11-05 18:49 ` [PATCH 1/2] [media] c8sectpfe: Delete unnecessary checks before two function calls SF Markus Elfring
2015-11-05 18:50 ` [PATCH 2/2] [media] c8sectpfe: Combine three checks into a single if block SF Markus Elfring
2015-11-06 10:09 ` walter harms
2015-11-06 7:50 ` [PATCH 0/2] [media] c8sectpfe: Deletion of a few unnecessary checks Maxime Coquelin
2016-07-17 20:16 ` [PATCH] [media] tw686x-kh: Delete an unnecessary check before the function call "video_unregister_device" SF Markus Elfring
2016-07-22 10:16 ` Krzysztof Hałasa
2016-07-17 21:00 ` [PATCH] [media] cec: Delete an unnecessary check before the function call "rc_free_device" SF Markus Elfring
2016-07-19 18:02 ` [PATCH] [media] v4l2-common: Delete an unnecessary check before the function call "spi_unregister_device" SF Markus Elfring
2016-07-19 18:36 ` walter harms
2016-07-19 19:35 ` [PATCH] [media] tw686x: Delete an unnecessary check before the function call "video_unregister_device" SF Markus Elfring
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=547CED4A.9000207@users.sourceforge.net \
--to=elfring@users.sourceforge.net \
--cc=crope@iki.fi \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=julia.lawall@lip6.fr \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@osg.samsung.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).