lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <551A80AE.7020506@monstr.eu>
Date:	Tue, 31 Mar 2015 13:10:38 +0200
From:	Michal Simek <monstr@...str.eu>
To:	Joe Perches <joe@...ches.com>, David Miller <davem@...emloft.net>
CC:	fengguang.wu@...el.com, varun@...lsio.com, kbuild-all@...org,
	hariprasad@...lsio.com, netdev@...r.kernel.org,
	linux-kernel@...r.kernel.org, Ariel Elior <ariel.elior@...gic.com>,
	Jeff Kirsher <jeffrey.t.kirsher@...el.com>,
	Jesse Brandeburg <jesse.brandeburg@...el.com>,
	Bruce Allan <bruce.w.allan@...el.com>,
	Carolyn Wyborny <carolyn.wyborny@...el.com>,
	Don Skidmore <donald.c.skidmore@...el.com>,
	Greg Rose <gregory.v.rose@...el.com>,
	Matthew Vick <matthew.vick@...el.com>,
	John Ronciak <john.ronciak@...el.com>,
	Mitch Williams <mitch.a.williams@...el.com>,
	Linux NICS <linux.nics@...el.com>,
	Michal Simek <michal.simek@...inx.com>,
	Sören Brinkmann <soren.brinkmann@...inx.com>,
	e1000-devel@...ts.sourceforge.net,
	linux-arm-kernel <linux-arm-kernel@...ts.infradead.org>
Subject: Re: [PATCH net-next] ethernet: Use bool function returns of true/false
 instead of 1/0

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@...ches.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



Download attachment "signature.asc" of type "application/pgp-signature" (199 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ