* [PATCH 04/26] typhoon: get rid of redundant conditional before all to release_firmware()
[not found] <alpine.LNX.2.00.1204092157340.13925@swampdragon.chaosbits.net>
@ 2012-04-09 20:50 ` 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
` (11 subsequent siblings)
12 siblings, 1 reply; 17+ messages in thread
From: Jesper Juhl @ 2012-04-09 20:50 UTC (permalink / raw)
To: linux-kernel; +Cc: trivial, netdev, David Dillow
There's no need to test for a NULL pointer before calling
release_firmware() since the function does that check itself, so
remove the redundant test.
Signed-off-by: Jesper Juhl <jj@chaosbits.net>
---
drivers/net/ethernet/3com/typhoon.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/3com/typhoon.c b/drivers/net/ethernet/3com/typhoon.c
index 1234a14..b153666 100644
--- a/drivers/net/ethernet/3com/typhoon.c
+++ b/drivers/net/ethernet/3com/typhoon.c
@@ -2549,8 +2549,7 @@ typhoon_init(void)
static void __exit
typhoon_cleanup(void)
{
- if (typhoon_fw)
- release_firmware(typhoon_fw);
+ release_firmware(typhoon_fw);
pci_unregister_driver(&typhoon_driver);
}
--
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.
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 05/26] tg3: remove redundant NULL test before release_firmware() call
[not found] <alpine.LNX.2.00.1204092157340.13925@swampdragon.chaosbits.net>
2012-04-09 20:50 ` [PATCH 04/26] typhoon: get rid of redundant conditional before all to release_firmware() Jesper Juhl
@ 2012-04-09 20:50 ` Jesper Juhl
2012-04-09 20:50 ` [PATCH 06/26] bna: remove redundant NULL test before release_firmware() Jesper Juhl
` (10 subsequent siblings)
12 siblings, 0 replies; 17+ messages in thread
From: Jesper Juhl @ 2012-04-09 20:50 UTC (permalink / raw)
To: linux-kernel; +Cc: trivial, netdev, Michael Chan, Matt Carlson
There is no need to test for a NULL pointer before calling
release_firmware - the function does that on its own.
Signed-off-by: Jesper Juhl <jj@chaosbits.net>
---
drivers/net/ethernet/broadcom/tg3.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
index 062ac33..9fbf73e 100644
--- a/drivers/net/ethernet/broadcom/tg3.c
+++ b/drivers/net/ethernet/broadcom/tg3.c
@@ -15842,8 +15842,7 @@ static void __devexit tg3_remove_one(struct pci_dev *pdev)
if (dev) {
struct tg3 *tp = netdev_priv(dev);
- if (tp->fw)
- release_firmware(tp->fw);
+ release_firmware(tp->fw);
tg3_reset_task_cancel(tp);
--
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.
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 06/26] bna: remove redundant NULL test before release_firmware()
[not found] <alpine.LNX.2.00.1204092157340.13925@swampdragon.chaosbits.net>
2012-04-09 20:50 ` [PATCH 04/26] typhoon: get rid of redundant conditional before all to release_firmware() Jesper Juhl
2012-04-09 20:50 ` [PATCH 05/26] tg3: remove redundant NULL test before release_firmware() call Jesper Juhl
@ 2012-04-09 20:50 ` 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
` (9 subsequent siblings)
12 siblings, 1 reply; 17+ messages in thread
From: Jesper Juhl @ 2012-04-09 20:50 UTC (permalink / raw)
To: linux-kernel; +Cc: trivial, netdev, Rasesh Mody
release_firmware() does its own NULL test so explicit test before call
is unneeded.
Signed-off-by: Jesper Juhl <jj@chaosbits.net>
---
drivers/net/ethernet/brocade/bna/bnad.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/brocade/bna/bnad.c b/drivers/net/ethernet/brocade/bna/bnad.c
index ff78f77..d86390c 100644
--- a/drivers/net/ethernet/brocade/bna/bnad.c
+++ b/drivers/net/ethernet/brocade/bna/bnad.c
@@ -3546,9 +3546,7 @@ static void __exit
bnad_module_exit(void)
{
pci_unregister_driver(&bnad_pci_driver);
-
- if (bfi_fw)
- release_firmware(bfi_fw);
+ release_firmware(bfi_fw);
}
module_init(bnad_module_init);
--
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.
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 07/26] qlogic, netxen: get rid of a redundant test for NULL before call to release_firmware()
[not found] <alpine.LNX.2.00.1204092157340.13925@swampdragon.chaosbits.net>
` (2 preceding siblings ...)
2012-04-09 20:50 ` [PATCH 06/26] bna: remove redundant NULL test before release_firmware() Jesper Juhl
@ 2012-04-09 20:50 ` Jesper Juhl
2012-04-09 20:50 ` [PATCH 08/26] qlogic, qlcnic: get rid of redundant test for NULL before a " Jesper Juhl
` (8 subsequent siblings)
12 siblings, 0 replies; 17+ messages in thread
From: Jesper Juhl @ 2012-04-09 20:50 UTC (permalink / raw)
To: linux-kernel; +Cc: trivial, netdev, Rajesh Borundia, Sony Chacko
Since release_firmware() deals gracefully with being passed a NULL
pointer there is no reason to test explicitly before calling the
function.
Signed-off-by: Jesper Juhl <jj@chaosbits.net>
---
drivers/net/ethernet/qlogic/netxen/netxen_nic_init.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/qlogic/netxen/netxen_nic_init.c b/drivers/net/ethernet/qlogic/netxen/netxen_nic_init.c
index 718b274..1fb149c 100644
--- a/drivers/net/ethernet/qlogic/netxen/netxen_nic_init.c
+++ b/drivers/net/ethernet/qlogic/netxen/netxen_nic_init.c
@@ -1261,8 +1261,7 @@ next:
void
netxen_release_firmware(struct netxen_adapter *adapter)
{
- if (adapter->fw)
- release_firmware(adapter->fw);
+ release_firmware(adapter->fw);
adapter->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.
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 08/26] qlogic, qlcnic: get rid of redundant test for NULL before a call to release_firmware()
[not found] <alpine.LNX.2.00.1204092157340.13925@swampdragon.chaosbits.net>
` (3 preceding siblings ...)
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 ` Jesper Juhl
2012-04-09 20:50 ` [PATCH 09/26] tehuti: delete redundant NULL check before release_firmware() Jesper Juhl
` (7 subsequent siblings)
12 siblings, 0 replies; 17+ messages in thread
From: Jesper Juhl @ 2012-04-09 20:50 UTC (permalink / raw)
To: linux-kernel
Cc: trivial, netdev, linux-driver, Sony Chacko, Anirban Chakraborty
Since release_firmware() deals gracefully with being passed a NULL
pointer there's no reason to test explicitly before calling the
function.
Signed-off-by: Jesper Juhl <jj@chaosbits.net>
---
drivers/net/ethernet/qlogic/qlcnic/qlcnic_init.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_init.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_init.c
index d32cf0d..799fd40 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_init.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_init.c
@@ -1321,8 +1321,7 @@ next:
void
qlcnic_release_firmware(struct qlcnic_adapter *adapter)
{
- if (adapter->fw)
- release_firmware(adapter->fw);
+ release_firmware(adapter->fw);
adapter->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.
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 09/26] tehuti: delete redundant NULL check before release_firmware()
[not found] <alpine.LNX.2.00.1204092157340.13925@swampdragon.chaosbits.net>
` (4 preceding siblings ...)
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 ` 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
` (6 subsequent siblings)
12 siblings, 1 reply; 17+ messages in thread
From: Jesper Juhl @ 2012-04-09 20:50 UTC (permalink / raw)
To: linux-kernel; +Cc: trivial, netdev, Andy Gospodarek
release_firmware() checks for NULL pointers - no need to test before
the call.
Signed-off-by: Jesper Juhl <jj@chaosbits.net>
---
drivers/net/ethernet/tehuti/tehuti.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/tehuti/tehuti.c b/drivers/net/ethernet/tehuti/tehuti.c
index ad973ff..a445e77 100644
--- a/drivers/net/ethernet/tehuti/tehuti.c
+++ b/drivers/net/ethernet/tehuti/tehuti.c
@@ -341,8 +341,8 @@ static int bdx_fw_load(struct bdx_priv *priv)
out:
if (master)
WRITE_REG(priv, regINIT_SEMAPHORE, 1);
- if (fw)
- release_firmware(fw);
+
+ release_firmware(fw);
if (rc) {
netdev_err(priv->ndev, "firmware loading failed\n");
--
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.
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 10/26] wireless, at76c50x:: Don't needlessly test for NULL before calling release_firmware()
[not found] <alpine.LNX.2.00.1204092157340.13925@swampdragon.chaosbits.net>
` (5 preceding siblings ...)
2012-04-09 20:50 ` [PATCH 09/26] tehuti: delete redundant NULL check before release_firmware() Jesper Juhl
@ 2012-04-09 20:50 ` Jesper Juhl
[not found] ` <alpine.LNX.2.00.1204092157340.13925-h2p7t3/P30RzeRGmFJ5qR7ZzlVVXadcDXqFh9Ls21Oc@public.gmane.org>
` (5 subsequent siblings)
12 siblings, 0 replies; 17+ messages in thread
From: Jesper Juhl @ 2012-04-09 20:50 UTC (permalink / raw)
To: linux-kernel; +Cc: trivial, netdev, linux-wireless, John W. Linville
The release_firmware() function deals gracefully with being passed a
NULL pointer, so explicit tests before the call are rather pointless.
Signed-off-by: Jesper Juhl <jj@chaosbits.net>
---
drivers/net/wireless/at76c50x-usb.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/net/wireless/at76c50x-usb.c b/drivers/net/wireless/at76c50x-usb.c
index 4045e5a..faa8bcb 100644
--- a/drivers/net/wireless/at76c50x-usb.c
+++ b/drivers/net/wireless/at76c50x-usb.c
@@ -2512,10 +2512,8 @@ static void __exit at76_mod_exit(void)
printk(KERN_INFO DRIVER_DESC " " DRIVER_VERSION " unloading\n");
usb_deregister(&at76_driver);
- for (i = 0; i < ARRAY_SIZE(firmwares); i++) {
- if (firmwares[i].fw)
- release_firmware(firmwares[i].fw);
- }
+ for (i = 0; i < ARRAY_SIZE(firmwares); i++)
+ release_firmware(firmwares[i].fw);
led_trigger_unregister_simple(ledtrig_tx);
}
--
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.
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 11/26] wireless, atmel: remove pointless test for NULL before release_firmware() call
[not found] ` <alpine.LNX.2.00.1204092157340.13925-h2p7t3/P30RzeRGmFJ5qR7ZzlVVXadcDXqFh9Ls21Oc@public.gmane.org>
@ 2012-04-09 20:50 ` Jesper Juhl
0 siblings, 0 replies; 17+ messages in thread
From: Jesper Juhl @ 2012-04-09 20:50 UTC (permalink / raw)
To: linux-kernel-u79uwXL29TY76Z2rM5mHXA
Cc: trivial-DgEjT+Ai2ygdnm+yROfE0A, netdev-u79uwXL29TY76Z2rM5mHXA,
linux-wireless-u79uwXL29TY76Z2rM5mHXA, John W. Linville,
Simon Kelley
release_firmware() does its own test. Explicitly checking before the
call is redundant.
Signed-off-by: Jesper Juhl <jj-IYz4IdjRLj0sV2N9l4h3zg@public.gmane.org>
---
drivers/net/wireless/atmel.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/net/wireless/atmel.c b/drivers/net/wireless/atmel.c
index 6c87a82..d07c030 100644
--- a/drivers/net/wireless/atmel.c
+++ b/drivers/net/wireless/atmel.c
@@ -3989,8 +3989,7 @@ static int reset_atmel_card(struct net_device *dev)
atmel_copy_to_card(priv->dev, 0x8000, &fw[0x6000], len - 0x6000);
}
- if (fw_entry)
- release_firmware(fw_entry);
+ release_firmware(fw_entry);
}
err = atmel_wakeup_firmware(priv);
--
1.7.10
--
Jesper Juhl <jj-IYz4IdjRLj0sV2N9l4h3zg@public.gmane.org> http://www.chaosbits.net/
Don't top-post http://www.catb.org/jargon/html/T/top-post.html
Plain text mails only, please.
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 12/26] ipw2200: remove a redundant NULL check before calling release_firmware()
[not found] <alpine.LNX.2.00.1204092157340.13925@swampdragon.chaosbits.net>
` (7 preceding siblings ...)
[not found] ` <alpine.LNX.2.00.1204092157340.13925-h2p7t3/P30RzeRGmFJ5qR7ZzlVVXadcDXqFh9Ls21Oc@public.gmane.org>
@ 2012-04-09 20:51 ` Jesper Juhl
2012-04-09 20:51 ` [PATCH 13/26] wireless, libertas: remove redundant NULL tests " Jesper Juhl
` (3 subsequent siblings)
12 siblings, 0 replies; 17+ messages in thread
From: Jesper Juhl @ 2012-04-09 20:51 UTC (permalink / raw)
To: linux-kernel
Cc: trivial, netdev, linux-wireless, John W. Linville,
Stanislav Yakovlev
The release_firmware() function does its own NULL test, so testing
before calling it is rather redundant.
Signed-off-by: Jesper Juhl <jj@chaosbits.net>
---
drivers/net/wireless/ipw2x00/ipw2200.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/net/wireless/ipw2x00/ipw2200.c b/drivers/net/wireless/ipw2x00/ipw2200.c
index 2b02257..77c5d2f 100644
--- a/drivers/net/wireless/ipw2x00/ipw2200.c
+++ b/drivers/net/wireless/ipw2x00/ipw2200.c
@@ -3657,8 +3657,7 @@ static int ipw_load(struct ipw_priv *priv)
priv->rxq = NULL;
}
ipw_tx_queue_free(priv);
- if (raw)
- release_firmware(raw);
+ release_firmware(raw);
#ifdef CONFIG_PM
fw_loaded = 0;
raw = 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.
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 13/26] wireless, libertas: remove redundant NULL tests before calling release_firmware()
[not found] <alpine.LNX.2.00.1204092157340.13925@swampdragon.chaosbits.net>
` (8 preceding siblings ...)
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 ` Jesper Juhl
2012-04-09 20:51 ` [PATCH 14/26] wireless, mwifiex: drop redundant NULL test before call to release_firmware() Jesper Juhl
` (2 subsequent siblings)
12 siblings, 0 replies; 17+ messages in thread
From: Jesper Juhl @ 2012-04-09 20:51 UTC (permalink / raw)
To: linux-kernel
Cc: trivial, netdev, linux-wireless, libertas-dev, John W. Linville,
Dan Williams
release_firmware() tests for, and deals gracefully with, NULL
pointers. Remove redundant explicit tests before calling the function.
Signed-off-by: Jesper Juhl <jj@chaosbits.net>
---
drivers/net/wireless/libertas/if_cs.c | 6 ++----
drivers/net/wireless/libertas/if_sdio.c | 6 ++----
drivers/net/wireless/libertas/if_spi.c | 6 ++----
drivers/net/wireless/libertas/main.c | 12 ++++--------
4 files changed, 10 insertions(+), 20 deletions(-)
diff --git a/drivers/net/wireless/libertas/if_cs.c b/drivers/net/wireless/libertas/if_cs.c
index 234ee88..171a06b 100644
--- a/drivers/net/wireless/libertas/if_cs.c
+++ b/drivers/net/wireless/libertas/if_cs.c
@@ -951,10 +951,8 @@ out2:
out1:
pcmcia_disable_device(p_dev);
out:
- if (helper)
- release_firmware(helper);
- if (mainfw)
- release_firmware(mainfw);
+ release_firmware(helper);
+ release_firmware(mainfw);
lbs_deb_leave_args(LBS_DEB_CS, "ret %d", ret);
return ret;
diff --git a/drivers/net/wireless/libertas/if_sdio.c b/drivers/net/wireless/libertas/if_sdio.c
index 9804ebc..15bfe2f 100644
--- a/drivers/net/wireless/libertas/if_sdio.c
+++ b/drivers/net/wireless/libertas/if_sdio.c
@@ -751,10 +751,8 @@ success:
ret = 0;
out:
- if (helper)
- release_firmware(helper);
- if (mainfw)
- release_firmware(mainfw);
+ release_firmware(helper);
+ release_firmware(mainfw);
lbs_deb_leave_args(LBS_DEB_SDIO, "ret %d", ret);
return ret;
diff --git a/drivers/net/wireless/libertas/if_spi.c b/drivers/net/wireless/libertas/if_spi.c
index 50b1ee7..7a5df4f 100644
--- a/drivers/net/wireless/libertas/if_spi.c
+++ b/drivers/net/wireless/libertas/if_spi.c
@@ -1095,10 +1095,8 @@ static int if_spi_init_card(struct if_spi_card *card)
goto out;
out:
- if (helper)
- release_firmware(helper);
- if (mainfw)
- release_firmware(mainfw);
+ release_firmware(helper);
+ release_firmware(mainfw);
lbs_deb_leave_args(LBS_DEB_SPI, "err %d\n", err);
diff --git a/drivers/net/wireless/libertas/main.c b/drivers/net/wireless/libertas/main.c
index 957681d..3b81b70 100644
--- a/drivers/net/wireless/libertas/main.c
+++ b/drivers/net/wireless/libertas/main.c
@@ -1269,14 +1269,10 @@ int lbs_get_firmware(struct device *dev, const char *user_helper,
fail:
/* Failed */
- if (*helper) {
- release_firmware(*helper);
- *helper = NULL;
- }
- if (*mainfw) {
- release_firmware(*mainfw);
- *mainfw = NULL;
- }
+ release_firmware(*helper);
+ *helper = NULL;
+ release_firmware(*mainfw);
+ *mainfw = NULL;
return -ENOENT;
}
--
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.
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 14/26] wireless, mwifiex: drop redundant NULL test before call to release_firmware()
[not found] <alpine.LNX.2.00.1204092157340.13925@swampdragon.chaosbits.net>
` (9 preceding siblings ...)
2012-04-09 20:51 ` [PATCH 13/26] wireless, libertas: remove redundant NULL tests " Jesper Juhl
@ 2012-04-09 20:51 ` Jesper Juhl
2012-04-09 20:59 ` Bing Zhao
2012-04-09 20:51 ` [PATCH 15/26] wireless, orinoco: release_firmware() tests for NULL, remove explicit tests before calls Jesper Juhl
2012-04-09 20:52 ` [PATCH 26/26] ipw2100: remove a redundant NULL check before calling release_firmware() Jesper Juhl
12 siblings, 1 reply; 17+ messages in thread
From: Jesper Juhl @ 2012-04-09 20:51 UTC (permalink / raw)
To: linux-kernel; +Cc: trivial, netdev, linux-wireless, John W. Linville, Bing Zhao
Since release_firmware() does its own test for NULL it is redundant to
do so before calling it.
Signed-off-by: Jesper Juhl <jj@chaosbits.net>
---
drivers/net/wireless/mwifiex/main.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/net/wireless/mwifiex/main.c b/drivers/net/wireless/mwifiex/main.c
index 9d1b3ca..2ee6162 100644
--- a/drivers/net/wireless/mwifiex/main.c
+++ b/drivers/net/wireless/mwifiex/main.c
@@ -342,8 +342,7 @@ static int mwifiex_init_hw_fw(struct mwifiex_adapter *adapter)
ret = 0;
done:
- if (adapter->firmware)
- release_firmware(adapter->firmware);
+ release_firmware(adapter->firmware);
if (ret)
ret = -1;
return ret;
--
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.
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 15/26] wireless, orinoco: release_firmware() tests for NULL, remove explicit tests before calls
[not found] <alpine.LNX.2.00.1204092157340.13925@swampdragon.chaosbits.net>
` (10 preceding siblings ...)
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:51 ` Jesper Juhl
2012-04-09 20:52 ` [PATCH 26/26] ipw2100: remove a redundant NULL check before calling release_firmware() Jesper Juhl
12 siblings, 0 replies; 17+ messages in thread
From: Jesper Juhl @ 2012-04-09 20:51 UTC (permalink / raw)
To: linux-kernel
Cc: trivial, netdev, linux-wireless, Pavel Roskin, Paul Gortmaker,
John W. Linville
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.
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 26/26] ipw2100: remove a redundant NULL check before calling release_firmware()
[not found] <alpine.LNX.2.00.1204092157340.13925@swampdragon.chaosbits.net>
` (11 preceding siblings ...)
2012-04-09 20:51 ` [PATCH 15/26] wireless, orinoco: release_firmware() tests for NULL, remove explicit tests before calls Jesper Juhl
@ 2012-04-09 20:52 ` Jesper Juhl
12 siblings, 0 replies; 17+ messages in thread
From: Jesper Juhl @ 2012-04-09 20:52 UTC (permalink / raw)
To: linux-kernel
Cc: trivial, netdev, linux-wireless, John W. Linville,
Stanislav Yakovlev
The release_firmware() function does its own NULL test so a test
before calling it is rather redundant.
Signed-off-by: Jesper Juhl <jj@chaosbits.net>
---
drivers/net/wireless/ipw2x00/ipw2100.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/net/wireless/ipw2x00/ipw2100.c b/drivers/net/wireless/ipw2x00/ipw2100.c
index f0551f8..d8d804e 100644
--- a/drivers/net/wireless/ipw2x00/ipw2100.c
+++ b/drivers/net/wireless/ipw2x00/ipw2100.c
@@ -8508,8 +8508,7 @@ static void ipw2100_release_firmware(struct ipw2100_priv *priv,
struct ipw2100_fw *fw)
{
fw->version = 0;
- if (fw->fw_entry)
- release_firmware(fw->fw_entry);
+ release_firmware(fw->fw_entry);
fw->fw_entry = 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.
^ permalink raw reply related [flat|nested] 17+ messages in thread
* RE: [PATCH 14/26] wireless, mwifiex: drop redundant NULL test before call to release_firmware()
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
0 siblings, 0 replies; 17+ messages in thread
From: Bing Zhao @ 2012-04-09 20:59 UTC (permalink / raw)
To: Jesper Juhl, linux-kernel@vger.kernel.org
Cc: trivial@kernel.org, netdev@vger.kernel.org,
linux-wireless@vger.kernel.org, John W. Linville
Hi Jesper,
Thanks for the patch.
> Since release_firmware() does its own test for NULL it is redundant to
> do so before calling it.
>
> Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Acked-by: Bing Zhao <bzhao@marvell.com>
Thanks,
Bing
> ---
> drivers/net/wireless/mwifiex/main.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/net/wireless/mwifiex/main.c b/drivers/net/wireless/mwifiex/main.c
> index 9d1b3ca..2ee6162 100644
> --- a/drivers/net/wireless/mwifiex/main.c
> +++ b/drivers/net/wireless/mwifiex/main.c
> @@ -342,8 +342,7 @@ static int mwifiex_init_hw_fw(struct mwifiex_adapter *adapter)
> ret = 0;
>
> done:
> - if (adapter->firmware)
> - release_firmware(adapter->firmware);
> + release_firmware(adapter->firmware);
> if (ret)
> ret = -1;
> return ret;
> --
> 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.
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 04/26] typhoon: get rid of redundant conditional before all to release_firmware()
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
0 siblings, 0 replies; 17+ messages in thread
From: David Dillow @ 2012-04-09 21:03 UTC (permalink / raw)
To: Jesper Juhl; +Cc: linux-kernel, trivial, netdev
On Mon, 2012-04-09 at 22:50 +0200, Jesper Juhl wrote:
> There's no need to test for a NULL pointer before calling
> release_firmware() since the function does that check itself, so
> remove the redundant test.
>
> Signed-off-by: Jesper Juhl <jj@chaosbits.net>
FWIW on a trivial patch,
Acked-by: David Dillow <dave@thedillows.org>
^ permalink raw reply [flat|nested] 17+ messages in thread
* RE: [PATCH 06/26] bna: remove redundant NULL test before release_firmware()
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
0 siblings, 0 replies; 17+ messages in thread
From: Rasesh Mody @ 2012-04-09 21:14 UTC (permalink / raw)
To: Jesper Juhl, linux-kernel@vger.kernel.org
Cc: trivial@kernel.org, netdev@vger.kernel.org
>From: Jesper Juhl [mailto:jj@chaosbits.net]
>Sent: Monday, April 09, 2012 1:50 PM
>To: linux-kernel@vger.kernel.org
>
>release_firmware() does its own NULL test so explicit test before call
>is unneeded.
>
>Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Thanks Jesper!
Acked-by: Rasesh Mody <rmody@brocade.com>
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 09/26] tehuti: delete redundant NULL check before release_firmware()
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
0 siblings, 0 replies; 17+ messages in thread
From: Andy Gospodarek @ 2012-04-11 13:31 UTC (permalink / raw)
To: Jesper Juhl; +Cc: linux-kernel, trivial, netdev, Andy Gospodarek
On Mon, Apr 09, 2012 at 10:50:42PM +0200, Jesper Juhl wrote:
> release_firmware() checks for NULL pointers - no need to test before
> the call.
>
> Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Signed-off-by: Andy Gospodarek <andy@greyhouse.net>
> ---
> drivers/net/ethernet/tehuti/tehuti.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/ethernet/tehuti/tehuti.c b/drivers/net/ethernet/tehuti/tehuti.c
> index ad973ff..a445e77 100644
> --- a/drivers/net/ethernet/tehuti/tehuti.c
> +++ b/drivers/net/ethernet/tehuti/tehuti.c
> @@ -341,8 +341,8 @@ static int bdx_fw_load(struct bdx_priv *priv)
> out:
> if (master)
> WRITE_REG(priv, regINIT_SEMAPHORE, 1);
> - if (fw)
> - release_firmware(fw);
> +
> + release_firmware(fw);
>
> if (rc) {
> netdev_err(priv->ndev, "firmware loading failed\n");
> --
> 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.
>
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 17+ messages in thread
end of thread, other threads:[~2012-04-11 13:31 UTC | newest]
Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <alpine.LNX.2.00.1204092157340.13925@swampdragon.chaosbits.net>
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
[not found] ` <alpine.LNX.2.00.1204092157340.13925-h2p7t3/P30RzeRGmFJ5qR7ZzlVVXadcDXqFh9Ls21Oc@public.gmane.org>
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: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 ` [PATCH 15/26] wireless, orinoco: release_firmware() tests for NULL, remove explicit tests before calls Jesper Juhl
2012-04-09 20:52 ` [PATCH 26/26] ipw2100: remove a redundant NULL check before calling release_firmware() Jesper Juhl
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).