LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] cxgb4: fix boolreturn.cocci warnings
       [not found] <201503260524.AdqSbov9%fengguang.wu@intel.com>
@ 2015-03-25 21:55 ` kbuild test robot
  2015-03-25 22:14   ` Joe Perches
  2015-03-29 19:16   ` David Miller
  0 siblings, 2 replies; 12+ messages in thread
From: kbuild test robot @ 2015-03-25 21:55 UTC (permalink / raw)
  To: Varun Prakash; +Cc: kbuild-all, Hariprasad S, netdev, linux-kernel

drivers/net/ethernet/chelsio/cxgb4/cxgb4_fcoe.c:49:9-10: WARNING: return of 0/1 in function 'cxgb_fcoe_sof_eof_supported' with return type bool

 Return statements in functions returning bool should use
 true/false instead of 1/0.
Generated by: scripts/coccinelle/misc/boolreturn.cocci

CC: Varun Prakash <varun@chelsio.com>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
---

 cxgb4_fcoe.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

--- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_fcoe.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_fcoe.c
@@ -46,17 +46,17 @@ bool cxgb_fcoe_sof_eof_supported(struct
 
 	if ((sof != FC_SOF_I3) && (sof != FC_SOF_N3)) {
 		dev_err(adap->pdev_dev, "Unsupported SOF 0x%x\n", sof);
-		return 0;
+		return false;
 	}
 
 	skb_copy_bits(skb, skb->len - 4, &eof, 1);
 
 	if ((eof != FC_EOF_N) && (eof != FC_EOF_T)) {
 		dev_err(adap->pdev_dev, "Unsupported EOF 0x%x\n", eof);
-		return 0;
+		return false;
 	}
 
-	return 1;
+	return true;
 }
 
 /**

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] cxgb4: fix boolreturn.cocci warnings
  2015-03-25 21:55 ` [PATCH] cxgb4: fix boolreturn.cocci warnings kbuild test robot
@ 2015-03-25 22:14   ` Joe Perches
  2015-03-29 19:16   ` David Miller
  1 sibling, 0 replies; 12+ messages in thread
From: Joe Perches @ 2015-03-25 22:14 UTC (permalink / raw)
  To: kbuild test robot
  Cc: Varun Prakash, kbuild-all, Hariprasad S, netdev, linux-kernel

On Thu, 2015-03-26 at 05:55 +0800, kbuild test robot wrote:
> drivers/net/ethernet/chelsio/cxgb4/cxgb4_fcoe.c:49:9-10: WARNING: return of 0/1 in function 'cxgb_fcoe_sof_eof_supported' with return type bool

Hey Fengguang.

There are so many of these that could be fixed.

Did you establish a queue to ration them out slowly
or do you just do them every once in awhile?

cheers, Joe


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] cxgb4: fix boolreturn.cocci warnings
  2015-03-25 21:55 ` [PATCH] cxgb4: fix boolreturn.cocci warnings kbuild test robot
  2015-03-25 22:14   ` Joe Perches
@ 2015-03-29 19:16   ` David Miller
  2015-03-30  1:25     ` [PATCH net-next] ethernet: Use bool function returns of true/false instead of 1/0 Joe Perches
  1 sibling, 1 reply; 12+ messages in thread
From: David Miller @ 2015-03-29 19:16 UTC (permalink / raw)
  To: fengguang.wu; +Cc: varun, kbuild-all, hariprasad, netdev, linux-kernel

From: kbuild test robot <fengguang.wu@intel.com>
Date: Thu, 26 Mar 2015 05:55:25 +0800

> drivers/net/ethernet/chelsio/cxgb4/cxgb4_fcoe.c:49:9-10: WARNING: return of 0/1 in function 'cxgb_fcoe_sof_eof_supported' with return type bool
> 
>  Return statements in functions returning bool should use
>  true/false instead of 1/0.
> Generated by: scripts/coccinelle/misc/boolreturn.cocci
> 
> CC: Varun Prakash <varun@chelsio.com>
> Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>

Applied.

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.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH net-next] ethernet: Use bool function returns of true/false instead of 1/0
  2015-03-29 19:16   ` David Miller
@ 2015-03-30  1:25     ` Joe Perches
  2015-03-30  1:29       ` [PATCH net-next] wireless: " Joe Perches
                         ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Joe Perches @ 2015-03-30  1:25 UTC (permalink / raw)
  To: David Miller
  Cc: fengguang.wu, varun, kbuild-all, hariprasad, netdev,
	linux-kernel, Ariel Elior, Jeff Kirsher, Jesse Brandeburg,
	Bruce Allan, Carolyn Wyborny, Don Skidmore, Greg Rose,
	Matthew Vick, John Ronciak, Mitch Williams, Linux NICS,
	Michal Simek, Sören Brinkmann, e1000-devel,
	linux-arm-kernel, netdev, LKML

Use bool constants as the return values instead of 1 and 0.

Signed-off-by: Joe Perches <joe@perches.com>
---
> 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...

 drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 2 +-
 drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c | 4 ++--
 drivers/net/ethernet/xilinx/xilinx_emaclite.c    | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
index 039b0c1..9980912 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
@@ -11610,7 +11610,7 @@ static bool bnx2x_get_dropless_info(struct bnx2x *bp)
 	u32 cfg;
 
 	if (IS_VF(bp))
-		return 0;
+		return false;
 
 	if (IS_MF(bp) && !CHIP_IS_E1x(bp)) {
 		/* Take function: tmp = func */
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
index 02ffb30..ccaecb1 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
@@ -1351,7 +1351,7 @@ static bool reg_pattern_test(struct ixgbe_adapter *adapter, u64 *data, int reg,
 
 	if (ixgbe_removed(adapter->hw.hw_addr)) {
 		*data = 1;
-		return 1;
+		return true;
 	}
 	for (pat = 0; pat < ARRAY_SIZE(test_pattern); pat++) {
 		before = ixgbe_read_reg(&adapter->hw, reg);
@@ -1376,7 +1376,7 @@ static bool reg_set_and_check(struct ixgbe_adapter *adapter, u64 *data, int reg,
 
 	if (ixgbe_removed(adapter->hw.hw_addr)) {
 		*data = 1;
-		return 1;
+		return true;
 	}
 	before = ixgbe_read_reg(&adapter->hw, reg);
 	ixgbe_write_reg(&adapter->hw, reg, write & mask);
diff --git a/drivers/net/ethernet/xilinx/xilinx_emaclite.c b/drivers/net/ethernet/xilinx/xilinx_emaclite.c
index 2111b91..6008eee 100644
--- a/drivers/net/ethernet/xilinx/xilinx_emaclite.c
+++ b/drivers/net/ethernet/xilinx/xilinx_emaclite.c
@@ -1062,7 +1062,7 @@ static bool get_bool(struct platform_device *ofdev, const char *s)
 	} else {
 		dev_warn(&ofdev->dev, "Parameter %s not found,"
 			"defaulting to false\n", s);
-		return 0;
+		return false;
 	}
 }
 




^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH net-next] wireless: Use bool function returns of true/false instead of 1/0
  2015-03-30  1:25     ` [PATCH net-next] ethernet: Use bool function returns of true/false instead of 1/0 Joe Perches
@ 2015-03-30  1:29       ` Joe Perches
  2015-03-30  1:46         ` Larry Finger
  2015-04-07 17:11         ` [net-next] wireless: Use bool function returns of true/false insteadof 1/0 Kalle Valo
  2015-03-30 20:28       ` [PATCH net-next] ethernet: Use bool function returns of true/false instead of 1/0 Jeff Kirsher
                         ` (2 subsequent siblings)
  3 siblings, 2 replies; 12+ messages in thread
From: Joe Perches @ 2015-03-30  1:29 UTC (permalink / raw)
  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, b43-dev, netdev, linux-kernel,
	brcm80211-dev-list

Use bool constants as the return values instead of 1 and 0.

Signed-off-by: Joe Perches <joe@perches.com>
---
> 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(-)

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;
 }
 
 /*



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH net-next] wireless: Use bool function returns of true/false instead of 1/0
  2015-03-30  1:29       ` [PATCH net-next] wireless: " Joe Perches
@ 2015-03-30  1:46         ` Larry Finger
  2015-03-30  1:49           ` Joe Perches
  2015-04-07 17:11         ` [net-next] wireless: Use bool function returns of true/false insteadof 1/0 Kalle Valo
  1 sibling, 1 reply; 12+ messages in thread
From: Larry Finger @ 2015-03-30  1:46 UTC (permalink / raw)
  To: Joe Perches, David Miller
  Cc: Stefano Brivio, Kalle Valo, Brett Rudley, Arend van Spriel,
	Franky (Zhenhui) Lin, Hante Meuleman, Johannes Berg,
	Emmanuel Grumbach, Intel Linux Wireless, linux-wireless, b43-dev,
	netdev, linux-kernel, brcm80211-dev-list

On 03/29/2015 08:29 PM, Joe Perches wrote:
> Use bool constants as the return values instead of 1 and 0.
>
> Signed-off-by: Joe Perches <joe@perches.com>
> ---
>> 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(-)

Please split these into separate patches for each driver. That way it will be 
possible to search 'git log' for the contributions to each driver. Otherwise, 
the patches are OK.

Thanks,

Larry

>
> 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;
>   }
>
>   /*
>
>
>


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH net-next] wireless: Use bool function returns of true/false instead of 1/0
  2015-03-30  1:46         ` Larry Finger
@ 2015-03-30  1:49           ` Joe Perches
  0 siblings, 0 replies; 12+ messages in thread
From: Joe Perches @ 2015-03-30  1:49 UTC (permalink / raw)
  To: Larry Finger
  Cc: David Miller, Stefano Brivio, Kalle Valo, Brett Rudley,
	Arend van Spriel, Franky (Zhenhui) Lin, Hante Meuleman,
	Johannes Berg, Emmanuel Grumbach, Intel Linux Wireless,
	linux-wireless, b43-dev, netdev, linux-kernel,
	brcm80211-dev-list

On Sun, 2015-03-29 at 20:46 -0500, Larry Finger wrote:
> On 03/29/2015 08:29 PM, Joe Perches wrote:
> > Use bool constants as the return values instead of 1 and 0.
> >
> > Signed-off-by: Joe Perches <joe@perches.com>
> > ---
> >> 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(-)
> 
> Please split these into separate patches for each driver. That way it will be 
> possible to search 'git log' for the contributions to each driver. Otherwise, 
> the patches are OK.

It's still possible.

git log <directory> shows the individual patches.



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH net-next] ethernet: Use bool function returns of true/false instead of 1/0
  2015-03-30  1:25     ` [PATCH net-next] ethernet: Use bool function returns of true/false instead of 1/0 Joe Perches
  2015-03-30  1:29       ` [PATCH net-next] wireless: " Joe Perches
@ 2015-03-30 20:28       ` Jeff Kirsher
  2015-03-31 11:10       ` Michal Simek
  2015-03-31 18:10       ` David Miller
  3 siblings, 0 replies; 12+ messages in thread
From: Jeff Kirsher @ 2015-03-30 20:28 UTC (permalink / raw)
  To: Joe Perches
  Cc: David Miller, fengguang.wu, varun, kbuild-all, hariprasad,
	netdev, linux-kernel, Ariel Elior, Jesse Brandeburg, Bruce Allan,
	Carolyn Wyborny, Don Skidmore, Greg Rose, Matthew Vick,
	John Ronciak, Mitch Williams, Linux NICS, Michal Simek,
	Sören Brinkmann, e1000-devel, linux-arm-kernel

[-- Attachment #1: Type: text/plain, Size: 681 bytes --]

On Sun, 2015-03-29 at 18:25 -0700, Joe Perches wrote:
> Use bool constants as the return values instead of 1 and 0.
> 
> Signed-off-by: Joe Perches <joe@perches.com>

Acked-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
For the ixgbe changes...

> ---
> > 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...
> 
>  drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 2 +-
>  drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c | 4 ++--
>  drivers/net/ethernet/xilinx/xilinx_emaclite.c    | 2 +-
>  3 files changed, 4 insertions(+), 4 deletions(-)



[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH net-next] ethernet: Use bool function returns of true/false instead of 1/0
  2015-03-30  1:25     ` [PATCH net-next] ethernet: Use bool function returns of true/false instead of 1/0 Joe Perches
  2015-03-30  1:29       ` [PATCH net-next] wireless: " Joe Perches
  2015-03-30 20:28       ` [PATCH net-next] ethernet: Use bool function returns of true/false instead of 1/0 Jeff Kirsher
@ 2015-03-31 11:10       ` Michal Simek
  2015-03-31 19:49         ` Joe Perches
  2015-03-31 18:10       ` David Miller
  3 siblings, 1 reply; 12+ messages in thread
From: Michal Simek @ 2015-03-31 11:10 UTC (permalink / raw)
  To: Joe Perches, David Miller
  Cc: fengguang.wu, varun, kbuild-all, hariprasad, netdev,
	linux-kernel, Ariel Elior, Jeff Kirsher, Jesse Brandeburg,
	Bruce Allan, Carolyn Wyborny, Don Skidmore, Greg Rose,
	Matthew Vick, John Ronciak, Mitch Williams, Linux NICS,
	Michal Simek, Sören Brinkmann, e1000-devel,
	linux-arm-kernel

[-- Attachment #1: Type: text/plain, Size: 2989 bytes --]

On 03/30/2015 03:25 AM, Joe Perches wrote:
> Use bool constants as the return values instead of 1 and 0.
> 
> Signed-off-by: Joe Perches <joe@perches.com>
> ---
>> 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...
> 
>  drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 2 +-
>  drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c | 4 ++--
>  drivers/net/ethernet/xilinx/xilinx_emaclite.c    | 2 +-
>  3 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
> index 039b0c1..9980912 100644
> --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
> +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
> @@ -11610,7 +11610,7 @@ static bool bnx2x_get_dropless_info(struct bnx2x *bp)
>  	u32 cfg;
>  
>  	if (IS_VF(bp))
> -		return 0;
> +		return false;
>  
>  	if (IS_MF(bp) && !CHIP_IS_E1x(bp)) {
>  		/* Take function: tmp = func */
> diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
> index 02ffb30..ccaecb1 100644
> --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
> +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
> @@ -1351,7 +1351,7 @@ static bool reg_pattern_test(struct ixgbe_adapter *adapter, u64 *data, int reg,
>  
>  	if (ixgbe_removed(adapter->hw.hw_addr)) {
>  		*data = 1;
> -		return 1;
> +		return true;
>  	}
>  	for (pat = 0; pat < ARRAY_SIZE(test_pattern); pat++) {
>  		before = ixgbe_read_reg(&adapter->hw, reg);
> @@ -1376,7 +1376,7 @@ static bool reg_set_and_check(struct ixgbe_adapter *adapter, u64 *data, int reg,
>  
>  	if (ixgbe_removed(adapter->hw.hw_addr)) {
>  		*data = 1;
> -		return 1;
> +		return true;
>  	}
>  	before = ixgbe_read_reg(&adapter->hw, reg);
>  	ixgbe_write_reg(&adapter->hw, reg, write & mask);
> diff --git a/drivers/net/ethernet/xilinx/xilinx_emaclite.c b/drivers/net/ethernet/xilinx/xilinx_emaclite.c
> index 2111b91..6008eee 100644
> --- a/drivers/net/ethernet/xilinx/xilinx_emaclite.c
> +++ b/drivers/net/ethernet/xilinx/xilinx_emaclite.c
> @@ -1062,7 +1062,7 @@ static bool get_bool(struct platform_device *ofdev, const char *s)
>  	} else {
>  		dev_warn(&ofdev->dev, "Parameter %s not found,"
>  			"defaulting to false\n", s);
> -		return 0;
> +		return false;
>  	}
>  }

Kernel-doc should be also fixed in spite of this whole function is just
broken and binding should be fixed to use of_property_read_bool for
these properties.

Thanks,
Michal

-- 
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel - Microblaze cpu - http://www.monstr.eu/fdt/
Maintainer of Linux kernel - Xilinx Zynq ARM architecture
Microblaze U-BOOT custodian and responsible for u-boot arm zynq platform



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH net-next] ethernet: Use bool function returns of true/false instead of 1/0
  2015-03-30  1:25     ` [PATCH net-next] ethernet: Use bool function returns of true/false instead of 1/0 Joe Perches
                         ` (2 preceding siblings ...)
  2015-03-31 11:10       ` Michal Simek
@ 2015-03-31 18:10       ` David Miller
  3 siblings, 0 replies; 12+ messages in thread
From: David Miller @ 2015-03-31 18:10 UTC (permalink / raw)
  To: joe
  Cc: fengguang.wu, varun, kbuild-all, hariprasad, netdev,
	linux-kernel, ariel.elior, jeffrey.t.kirsher, jesse.brandeburg,
	bruce.w.allan, carolyn.wyborny, donald.c.skidmore,
	gregory.v.rose, matthew.vick, john.ronciak, mitch.a.williams,
	linux.nics, michal.simek, soren.brinkmann, e1000-devel,
	linux-arm-kernel

From: Joe Perches <joe@perches.com>
Date: Sun, 29 Mar 2015 18:25:12 -0700

> Use bool constants as the return values instead of 1 and 0.
> 
> Signed-off-by: Joe Perches <joe@perches.com>

Applied, thanks Joe.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH net-next] ethernet: Use bool function returns of true/false instead of 1/0
  2015-03-31 11:10       ` Michal Simek
@ 2015-03-31 19:49         ` Joe Perches
  0 siblings, 0 replies; 12+ messages in thread
From: Joe Perches @ 2015-03-31 19:49 UTC (permalink / raw)
  To: monstr
  Cc: David Miller, netdev, linux-kernel, Michal Simek, Sören Brinkmann

(shortened cc list)

On Tue, 2015-03-31 at 13:10 +0200, Michal Simek wrote:
> On 03/30/2015 03:25 AM, Joe Perches wrote:
> > Use bool constants as the return values instead of 1 and 0.
[]
> > diff --git a/drivers/net/ethernet/xilinx/xilinx_emaclite.c b/drivers/net/ethernet/xilinx/xilinx_emaclite.c
> > index 2111b91..6008eee 100644
> > --- a/drivers/net/ethernet/xilinx/xilinx_emaclite.c
> > +++ b/drivers/net/ethernet/xilinx/xilinx_emaclite.c
> > @@ -1062,7 +1062,7 @@ static bool get_bool(struct platform_device *ofdev, const char *s)
> >  	} else {
> >  		dev_warn(&ofdev->dev, "Parameter %s not found,"
> >  			"defaulting to false\n", s);
> > -		return 0;
> > +		return false;
> >  	}
> >  }
> 
> Kernel-doc should be also fixed in spite of this whole function is just
> broken and binding should be fixed to use of_property_read_bool for
> these properties.

Hi Michal.

David's applied this so if you or Sören want to fix up
the function and kernel-doc to your taste, please do.

cheers, Joe


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [net-next] wireless: Use bool function returns of true/false insteadof 1/0
  2015-03-30  1:29       ` [PATCH net-next] wireless: " Joe Perches
  2015-03-30  1:46         ` Larry Finger
@ 2015-04-07 17:11         ` Kalle Valo
  1 sibling, 0 replies; 12+ messages in thread
From: Kalle Valo @ 2015-04-07 17:11 UTC (permalink / raw)
  To: Joe Perches
  Cc: David Miller, Stefano Brivio, Larry Finger, Brett Rudley,
	Arend van Spriel, Franky (Zhenhui) Lin, Hante Meuleman,
	Johannes Berg, Emmanuel Grumbach, Intel Linux Wireless,
	linux-wireless, b43-dev, netdev, linux-kernel,
	brcm80211-dev-list


> Use bool constants as the return values instead of 1 and 0.
> 
> Signed-off-by: Joe Perches <joe@perches.com>

Thanks, applied to wireless-drivers-next.git.

Kalle Valo

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2015-04-07 17:11 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <201503260524.AdqSbov9%fengguang.wu@intel.com>
2015-03-25 21:55 ` [PATCH] cxgb4: fix boolreturn.cocci warnings kbuild test robot
2015-03-25 22:14   ` Joe Perches
2015-03-29 19:16   ` David Miller
2015-03-30  1:25     ` [PATCH net-next] ethernet: Use bool function returns of true/false instead of 1/0 Joe Perches
2015-03-30  1:29       ` [PATCH net-next] wireless: " Joe Perches
2015-03-30  1:46         ` Larry Finger
2015-03-30  1:49           ` Joe Perches
2015-04-07 17:11         ` [net-next] wireless: Use bool function returns of true/false insteadof 1/0 Kalle Valo
2015-03-30 20:28       ` [PATCH net-next] ethernet: Use bool function returns of true/false instead of 1/0 Jeff Kirsher
2015-03-31 11:10       ` Michal Simek
2015-03-31 19:49         ` Joe Perches
2015-03-31 18:10       ` David Miller

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).