All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jesper Juhl <jj@chaosbits.net>
To: linux-kernel@vger.kernel.org
Cc: trivial@kernel.org, netdev@vger.kernel.org,
	linux-wireless@vger.kernel.org, Pavel Roskin <proski@gnu.org>,
	Paul Gortmaker <paul.gortmaker@windriver.com>,
	"John W. Linville" <linville@tuxdriver.com>
Subject: [PATCH 15/26] wireless, orinoco: release_firmware() tests for NULL, remove explicit tests before calls
Date: Mon, 9 Apr 2012 22:51:19 +0200 (CEST)	[thread overview]
Message-ID: <alpine.LNX.2.00.1204092225140.13925@swampdragon.chaosbits.net> (raw)
In-Reply-To: <alpine.LNX.2.00.1204092157340.13925@swampdragon.chaosbits.net>

It is redundant to test for NULL pointers before calling
release_firmware() since the function does its own NULL test.

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
---
 drivers/net/wireless/orinoco/fw.c |    7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/net/wireless/orinoco/fw.c b/drivers/net/wireless/orinoco/fw.c
index 4df8cf6..400a352 100644
--- a/drivers/net/wireless/orinoco/fw.c
+++ b/drivers/net/wireless/orinoco/fw.c
@@ -379,11 +379,8 @@ void orinoco_cache_fw(struct orinoco_private *priv, int ap)
 
 void orinoco_uncache_fw(struct orinoco_private *priv)
 {
-	if (priv->cached_pri_fw)
-		release_firmware(priv->cached_pri_fw);
-	if (priv->cached_fw)
-		release_firmware(priv->cached_fw);
-
+	release_firmware(priv->cached_pri_fw);
+	release_firmware(priv->cached_fw);
 	priv->cached_pri_fw = NULL;
 	priv->cached_fw = NULL;
 }
-- 
1.7.10


-- 
Jesper Juhl <jj@chaosbits.net>       http://www.chaosbits.net/
Don't top-post http://www.catb.org/jargon/html/T/top-post.html
Plain text mails only, please.


  parent reply	other threads:[~2012-04-09 20:51 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-09 20:49 [PATCH 00/26] Remove redundant tests for NULL before calling release_firmware() Jesper Juhl
2012-04-09 20:49 ` [PATCH 01/26] Bluetooth: btmrvl_sdio: remove pointless conditional before release_firmware() Jesper Juhl
2012-04-13 21:36   ` Gustavo Padovan
2012-04-09 20:49 ` [PATCH 02/26] radeon_cp: Remove unneeded tests for NULL before calling release_firmware() Jesper Juhl
2012-04-09 20:50 ` [PATCH 03/26] [media] s2255drv: Remove redundant NULL test before release_firmware() Jesper Juhl
2012-04-09 20:50 ` [PATCH 04/26] typhoon: get rid of redundant conditional before all to release_firmware() Jesper Juhl
2012-04-09 21:03   ` David Dillow
2012-04-09 20:50 ` [PATCH 05/26] tg3: remove redundant NULL test before release_firmware() call Jesper Juhl
2012-04-09 20:50 ` [PATCH 06/26] bna: remove redundant NULL test before release_firmware() Jesper Juhl
2012-04-09 21:14   ` Rasesh Mody
2012-04-09 20:50 ` [PATCH 07/26] qlogic, netxen: get rid of a redundant test for NULL before call to release_firmware() Jesper Juhl
2012-04-09 20:50 ` [PATCH 08/26] qlogic, qlcnic: get rid of redundant test for NULL before a " Jesper Juhl
2012-04-09 20:50 ` [PATCH 09/26] tehuti: delete redundant NULL check before release_firmware() Jesper Juhl
2012-04-11 13:31   ` Andy Gospodarek
2012-04-09 20:50 ` [PATCH 10/26] wireless, at76c50x:: Don't needlessly test for NULL before calling release_firmware() Jesper Juhl
2012-04-09 20:50 ` [PATCH 11/26] wireless, atmel: remove pointless test for NULL before release_firmware() call Jesper Juhl
2012-04-09 20:50   ` Jesper Juhl
2012-04-09 20:51 ` [PATCH 12/26] ipw2200: remove a redundant NULL check before calling release_firmware() Jesper Juhl
2012-04-09 20:51 ` [PATCH 13/26] wireless, libertas: remove redundant NULL tests " Jesper Juhl
2012-04-09 20:51 ` [PATCH 14/26] wireless, mwifiex: drop redundant NULL test before call to release_firmware() Jesper Juhl
2012-04-09 20:59   ` Bing Zhao
2012-04-09 20:51 ` Jesper Juhl [this message]
2012-04-09 20:51 ` [PATCH 16/26] remoteproc: remove redundant NULL check before release_firmware() Jesper Juhl
2012-04-09 20:51 ` [PATCH 17/26] [SCSI] aic94xx: Get rid of redundant NULL check before release_firmware() call Jesper Juhl
2012-04-09 20:51 ` [PATCH 18/26] [SCSI] qla1280: Remove " Jesper Juhl
2012-04-09 20:51 ` [PATCH 19/26] [SCSI] qla2xxx: " Jesper Juhl
2012-04-10 12:22   ` Chad Dupuis
2012-04-09 20:51 ` [PATCH 20/26] [media] staging: as102: Remove redundant NULL check before release_firmware() and pointless comments Jesper Juhl
2012-04-09 20:51 ` [PATCH 21/26] staging: vt6656: Don't needlessly test for NULL before release_firmware() Jesper Juhl
2012-04-09 20:52 ` [PATCH 22/26] usb/storage/ene_ub6250: Remove redundant NULL check before release_firmware() and pointless assignment Jesper Juhl
2012-04-09 20:52 ` [PATCH 23/26] ALSA: riptide: remove redundant NULL test before release_firmware() Jesper Juhl
2012-04-09 20:52   ` Jesper Juhl
2012-04-10  6:45   ` Takashi Iwai
2012-04-10  6:45     ` Takashi Iwai
2012-04-09 20:52 ` [PATCH 24/26] ASoC: wm8994: Don't test for NULL " Jesper Juhl
2012-04-09 20:52   ` Jesper Juhl
2012-04-10 10:08   ` Mark Brown
2012-04-10 10:08     ` Mark Brown
2012-04-09 20:52 ` [PATCH 25/26] usb/atm/ueagle-atm: Don't test for NULL ptr before calling release_firmware() Jesper Juhl
2012-04-09 20:52 ` [PATCH 26/26] ipw2100: remove a redundant NULL check " Jesper Juhl

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=alpine.LNX.2.00.1204092225140.13925@swampdragon.chaosbits.net \
    --to=jj@chaosbits.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=netdev@vger.kernel.org \
    --cc=paul.gortmaker@windriver.com \
    --cc=proski@gnu.org \
    --cc=trivial@kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.