I prefer it, too, but the indentation suggested that
adding braces would match the author's intent.
In case anyone is interested, I have been maintaining a patch
that removes *all* useless if-before-kfree tests. I have not
posted it because such changes have a reputation for provoking
flames on this list, but now you've provoked me ;-)
http://meyering.net/code/remove-useless-if-before-kfree.patch
74 files changed, 127 insertions(+), 250 deletions(-)
Here's the alternative patch:
drivers/net/wireless/ath9k/main.c | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/net/wireless/ath9k/main.c b/drivers/net/wireless/ath9k/main.c
index 2888778..6eb7ad7 100644
--- a/drivers/net/wireless/ath9k/main.c
+++ b/drivers/net/wireless/ath9k/main.c
@@ -1056,9 +1056,8 @@ void ath_tx_complete(struct ath_softc *sc, struct sk_buff *skb,
if (tx_info->flags & IEEE80211_TX_CTL_NO_ACK ||
tx_info->flags & IEEE80211_TX_STAT_TX_FILTERED) {
/* free driver's private data area of tx_info */
- if (tx_info->driver_data[0] != NULL)
- kfree(tx_info->driver_data[0]);
- tx_info->driver_data[0] = NULL;
+ kfree(tx_info->driver_data[0]);
+ tx_info->driver_data[0] = NULL;
}
if (tx_status->flags & ATH_TX_BAR) {
--
1.6.0.90.g436ed
--