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] [day] [month] [year] [list]
Message-ID: <9ee7bdaaf71f7bcdd0ed0dc5a3e1127a12b6a68f.camel@perches.com>
Date:   Thu, 02 Dec 2021 09:49:00 -0800
From:   Joe Perches <joe@...ches.com>
To:     Tony Nguyen <anthony.l.nguyen@...el.com>, davem@...emloft.net,
        kuba@...nel.org
Cc:     Shiraz Saleem <shiraz.saleem@...el.com>, netdev@...r.kernel.org,
        linux-rdma@...r.kernel.org, mustafa.ismail@...el.com,
        jacob.e.keller@...el.com, parav@...dia.com, jiri@...dia.com
Subject: Re: [PATCH net-next 1/2] net/ice: Fix boolean assignment

On Tue, 2021-11-30 at 10:12 -0800, Tony Nguyen wrote:
> From: Shiraz Saleem <shiraz.saleem@...el.com>
> 
> vbool in ice_devlink_enable_roce_get can be assigned to a
> non-0/1 constant.
> 
> Fix this assignment of vbool to be 0/1.

This one seems fine, but another use of vbool in ice still exists

drivers/net/ethernet/intel/ice/ice_devlink.c:617:       value.vbool = test_bit(ICE_FLAG_RDMA_ENA, pf->flags) ? true : false;

Curiously, the vbool is defined in a union so it's possible
for the vbool value in the union to not just be 0 or 1.

> diff --git a/drivers/net/ethernet/intel/ice/ice_devlink.c b/drivers/net/ethernet/intel/ice/ice_devlink.c
[]
> @@ -436,7 +436,7 @@ ice_devlink_enable_roce_get(struct devlink *devlink, u32 id,
>  {
>  	struct ice_pf *pf = devlink_priv(devlink);
>  
> -	ctx->val.vbool = pf->rdma_mode & IIDC_RDMA_PROTOCOL_ROCEV2;
> +	ctx->val.vbool = pf->rdma_mode & IIDC_RDMA_PROTOCOL_ROCEV2 ? true : false;
>  
>  	return 0;
>  }


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ