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]
Date:	Sat, 10 Oct 2015 20:24:22 +0800
From:	kbuild test robot <lkp@...el.com>
To:	Michael Chan <mchan@...adcom.com>
Cc:	kbuild-all@...org, davem@...emloft.net, netdev@...r.kernel.org
Subject: [PATCH] bnxt_en: fix array_size.cocci warnings

drivers/net/ethernet/broadcom/bnxt/bnxt.c:2773:41-42: WARNING: Use ARRAY_SIZE

 Use ARRAY_SIZE instead of dividing sizeof array with sizeof an element

Semantic patch information:
 This makes an effort to find cases where ARRAY_SIZE can be used such as
 where there is a division of sizeof the array by the sizeof its first
 element or by any indexed element or the element type. It replaces the
 division of the two sizeofs by ARRAY_SIZE.

Generated by: scripts/coccinelle/misc/array_size.cocci

CC: Michael Chan <mchan@...adcom.com>
Signed-off-by: Fengguang Wu <fengguang.wu@...el.com>
---

 bnxt.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -2770,8 +2770,7 @@ static int bnxt_hwrm_func_drv_rgtr(struc
 		u32 *data = (u32 *)vf_req_snif_bmap;
 
 		memset(vf_req_snif_bmap, 0, 32);
-		for (i = 0; i < sizeof(bnxt_vf_req_snif) /
-				sizeof(bnxt_vf_req_snif[0]); i++)
+		for (i = 0; i < ARRAY_SIZE(bnxt_vf_req_snif); i++)
 			__set_bit(bnxt_vf_req_snif[i], vf_req_snif_bmap);
 
 		for (i = 0; i < 8; i++) {
--
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