From patchwork Mon Mar 30 01:29:42 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joe Perches X-Patchwork-Id: 6118121 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 8B603BF4A6 for ; Mon, 30 Mar 2015 01:30:08 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8F7AE20259 for ; Mon, 30 Mar 2015 01:30:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6A1CB2021F for ; Mon, 30 Mar 2015 01:30:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752755AbbC3B3t (ORCPT ); Sun, 29 Mar 2015 21:29:49 -0400 Received: from smtprelay0035.hostedemail.com ([216.40.44.35]:47825 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752425AbbC3B3r (ORCPT ); Sun, 29 Mar 2015 21:29:47 -0400 Received: from filter.hostedemail.com (unknown [216.40.38.60]) by smtprelay04.hostedemail.com (Postfix) with ESMTP id 20CBA351B65; Mon, 30 Mar 2015 01:29:46 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2, 0, 0, , d41d8cd98f00b204, joe@perches.com, :::::::::::::::::::::::::::::::, RULES_HIT:2:41:355:379:541:800:960:973:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1535:1593:1594:1605:1606:1730:1747:1777:1792:1801:2194:2199:2393:2559:2562:2828:3138:3139:3140:3141:3142:3865:3866:3867:3868:3871:3872:3874:4118:4250:4321:4605:5007:6261:6742:10004:10848:11026:11232:11473:11657:11658:11914:12043:12050:12296:12438:12517:12519:12555:13161:13229:13255:13972:14096:14097:14394:21060:21080, 0, RBL:none, CacheIP:none, Bayesian:0.5, 0.5, 0.5, Netcheck:none, DomainCache:0, MSF:not bulk, SPF:fn, MSBL:0, DNSBL:none, Custom_rules:0:0:0 X-HE-Tag: crook22_8f1dfcc2b8a1d X-Filterd-Recvd-Size: 7210 Received: from joe-X200MA.home (pool-71-119-66-80.lsanca.fios.verizon.net [71.119.66.80]) (Authenticated sender: joe@perches.com) by omf08.hostedemail.com (Postfix) with ESMTPA; Mon, 30 Mar 2015 01:29:43 +0000 (UTC) Message-ID: <1427678982.2715.55.camel@perches.com> Subject: [PATCH net-next] wireless: Use bool function returns of true/false instead of 1/0 From: Joe Perches To: David Miller Cc: Stefano Brivio , Kalle Valo , Larry Finger , Brett Rudley , Arend van Spriel , "Franky (Zhenhui) Lin" , Hante Meuleman , Johannes Berg , Emmanuel Grumbach , Intel Linux Wireless , linux-wireless@vger.kernel.org, b43-dev@lists.infradead.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, brcm80211-dev-list Date: Sun, 29 Mar 2015 18:29:42 -0700 In-Reply-To: <1427678712.2715.52.camel@perches.com> References: <201503260524.AdqSbov9%fengguang.wu@intel.com> <20150325215525.GA26868@athens> <20150329.121655.2092434262655191613.davem@davemloft.net> <1427678712.2715.52.camel@perches.com> X-Mailer: Evolution 3.12.10-0ubuntu1~14.10.1 Mime-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Use bool constants as the return values instead of 1 and 0. Signed-off-by: Joe Perches --- > To be honest I'd might rather get bunches of these, there has to be a ton > of them, than a slow trickle of one every few weeks/days. There aren't too many here either... drivers/net/wireless/b43/dma.c | 12 ++++++------ drivers/net/wireless/b43legacy/dma.c | 6 +++--- drivers/net/wireless/b43legacy/rfkill.c | 8 ++++---- drivers/net/wireless/brcm80211/brcmsmac/phy/phy_cmn.c | 2 +- drivers/net/wireless/brcm80211/brcmsmac/phy/phy_lcn.c | 2 +- drivers/net/wireless/iwlwifi/iwl-config.h | 4 ++-- 6 files changed, 17 insertions(+), 17 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/net/wireless/b43/dma.c b/drivers/net/wireless/b43/dma.c index 1d7982a..6837064 100644 --- a/drivers/net/wireless/b43/dma.c +++ b/drivers/net/wireless/b43/dma.c @@ -553,7 +553,7 @@ static bool b43_dma_mapping_error(struct b43_dmaring *ring, size_t buffersize, bool dma_to_device) { if (unlikely(dma_mapping_error(ring->dev->dev->dma_dev, addr))) - return 1; + return true; switch (ring->type) { case B43_DMA_30BIT: @@ -571,13 +571,13 @@ static bool b43_dma_mapping_error(struct b43_dmaring *ring, } /* The address is OK. */ - return 0; + return false; address_error: /* We can't support this address. Unmap it again. */ unmap_descbuffer(ring, addr, buffersize, dma_to_device); - return 1; + return true; } static bool b43_rx_buffer_is_poisoned(struct b43_dmaring *ring, struct sk_buff *skb) @@ -1099,16 +1099,16 @@ static bool b43_dma_translation_in_low_word(struct b43_wldev *dev, enum b43_dmatype type) { if (type != B43_DMA_64BIT) - return 1; + return true; #ifdef CONFIG_B43_SSB if (dev->dev->bus_type == B43_BUS_SSB && dev->dev->sdev->bus->bustype == SSB_BUSTYPE_PCI && !(pci_is_pcie(dev->dev->sdev->bus->host_pci) && ssb_read32(dev->dev->sdev, SSB_TMSHIGH) & SSB_TMSHIGH_DMA64)) - return 1; + return true; #endif - return 0; + return false; } int b43_dma_init(struct b43_wldev *dev) diff --git a/drivers/net/wireless/b43legacy/dma.c b/drivers/net/wireless/b43legacy/dma.c index b2ed179..f9dd892 100644 --- a/drivers/net/wireless/b43legacy/dma.c +++ b/drivers/net/wireless/b43legacy/dma.c @@ -427,7 +427,7 @@ static bool b43legacy_dma_mapping_error(struct b43legacy_dmaring *ring, bool dma_to_device) { if (unlikely(dma_mapping_error(ring->dev->dev->dma_dev, addr))) - return 1; + return true; switch (ring->type) { case B43legacy_DMA_30BIT: @@ -441,13 +441,13 @@ static bool b43legacy_dma_mapping_error(struct b43legacy_dmaring *ring, } /* The address is OK. */ - return 0; + return false; address_error: /* We can't support this address. Unmap it again. */ unmap_descbuffer(ring, addr, buffersize, dma_to_device); - return 1; + return true; } static int setup_rx_descbuffer(struct b43legacy_dmaring *ring, diff --git a/drivers/net/wireless/b43legacy/rfkill.c b/drivers/net/wireless/b43legacy/rfkill.c index c4559bc..7c1bdbc 100644 --- a/drivers/net/wireless/b43legacy/rfkill.c +++ b/drivers/net/wireless/b43legacy/rfkill.c @@ -32,7 +32,7 @@ bool b43legacy_is_hw_radio_enabled(struct b43legacy_wldev *dev) if (dev->dev->id.revision >= 3) { if (!(b43legacy_read32(dev, B43legacy_MMIO_RADIO_HWENABLED_HI) & B43legacy_MMIO_RADIO_HWENABLED_HI_MASK)) - return 1; + return true; } else { /* To prevent CPU fault on PPC, do not read a register * unless the interface is started; however, on resume @@ -40,12 +40,12 @@ bool b43legacy_is_hw_radio_enabled(struct b43legacy_wldev *dev) * that happens, unconditionally return TRUE. */ if (b43legacy_status(dev) < B43legacy_STAT_STARTED) - return 1; + return true; if (b43legacy_read16(dev, B43legacy_MMIO_RADIO_HWENABLED_LO) & B43legacy_MMIO_RADIO_HWENABLED_LO_MASK) - return 1; + return true; } - return 0; + return false; } /* The poll callback for the hardware button. */ diff --git a/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_cmn.c b/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_cmn.c index 941b1e4..1c4e9dd 100644 --- a/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_cmn.c +++ b/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_cmn.c @@ -2949,5 +2949,5 @@ bool wlc_phy_txpower_ipa_ison(struct brcms_phy_pub *ppi) if (ISNPHY(pi)) return wlc_phy_n_txpower_ipa_ison(pi); else - return 0; + return false; } diff --git a/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_lcn.c b/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_lcn.c index 5f13662..93d4cde 100644 --- a/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_lcn.c +++ b/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_lcn.c @@ -4999,7 +4999,7 @@ void wlc_2064_vco_cal(struct brcms_phy *pi) bool wlc_phy_tpc_isenabled_lcnphy(struct brcms_phy *pi) { if (wlc_lcnphy_tempsense_based_pwr_ctrl_enabled(pi)) - return 0; + return false; else return (LCNPHY_TX_PWR_CTRL_HW == wlc_lcnphy_get_tx_pwr_ctrl((pi))); diff --git a/drivers/net/wireless/iwlwifi/iwl-config.h b/drivers/net/wireless/iwlwifi/iwl-config.h index 4b190d9..19f3be0 100644 --- a/drivers/net/wireless/iwlwifi/iwl-config.h +++ b/drivers/net/wireless/iwlwifi/iwl-config.h @@ -92,9 +92,9 @@ static inline bool iwl_has_secure_boot(u32 hw_rev, { /* return 1 only for family 8000 B0 */ if ((family == IWL_DEVICE_FAMILY_8000) && (hw_rev & 0xC)) - return 1; + return true; - return 0; + return false; } /*