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]
Date:	Wed, 10 Dec 2014 16:47:39 +0000
From:	David Laight <David.Laight@...LAB.COM>
To:	'Hariprasad Shenai' <hariprasad@...lsio.com>,
	"netdev@...r.kernel.org" <netdev@...r.kernel.org>
CC:	"davem@...emloft.net" <davem@...emloft.net>,
	"leedom@...lsio.com" <leedom@...lsio.com>,
	"anish@...lsio.com" <anish@...lsio.com>,
	"nirranjan@...lsio.com" <nirranjan@...lsio.com>,
	"kumaras@...lsio.com" <kumaras@...lsio.com>
Subject: RE: [PATCH net-next] cxgb4vf: Fix sparse warnings

From: Hariprasad Shenai
> Fixes sparse warnings introduced in commit e85c9a7abfa407ed ("cxgb4/cxgb4vf: Add
> code to calculate T5 BAR2 Offsets for SGE Queue Registers") and
> df64e4d38c904dd3 ("cxgb4/cxgb4vf: Use new interfaces to calculate BAR2 SGE Queue
> Register addresses") and few old ones
> 
...
> diff --git a/drivers/net/ethernet/chelsio/cxgb4vf/t4vf_hw.c
> b/drivers/net/ethernet/chelsio/cxgb4vf/t4vf_hw.c
> index 02e8833..62bd251 100644
> --- a/drivers/net/ethernet/chelsio/cxgb4vf/t4vf_hw.c
> +++ b/drivers/net/ethernet/chelsio/cxgb4vf/t4vf_hw.c
> @@ -209,10 +209,10 @@ int t4vf_wr_mbox_core(struct adapter *adapter, const void *cmd, int size,
> 
>  			if (rpl) {
>  				/* request bit in high-order BE word */
> -				WARN_ON((be32_to_cpu(*(const u32 *)cmd)
> +				WARN_ON((be32_to_cpu(*(const __be32 *)cmd)
>  					 & FW_CMD_REQUEST_F) == 0);
>  				get_mbox_rpl(adapter, rpl, size, mbox_data);
> -				WARN_ON((be32_to_cpu(*(u32 *)rpl)
> +				WARN_ON((be32_to_cpu(*(__be32 *)rpl)
>  					 & FW_CMD_REQUEST_F) != 0);

Better to byteswap the constant.
Also, it looks like the types of 'rpl' and 'cmd' should be fixed
so that the casts themselves aren't needed.

>  			}
>  			t4_write_reg(adapter, mbox_ctl,
> @@ -486,7 +486,7 @@ int t4_bar2_sge_qregs(struct adapter *adapter,
>  	 *  o The BAR2 Queue ID.
>  	 *  o The BAR2 Queue ID Offset into the BAR2 page.
>  	 */
> -	bar2_page_offset = ((qid >> qpp_shift) << page_shift);
> +	bar2_page_offset = (u64)((qid >> qpp_shift) << page_shift);

That doesn't look like the right place for a cast to u64.
Not that it is at all clear why you've added it.

	David

>  	bar2_qid = qid & qpp_mask;
>  	bar2_qid_offset = bar2_qid * SGE_UDB_SIZE;
> 
> --
> 1.7.1
> 
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ