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:   Tue, 17 Mar 2020 13:45:06 +0300
From:   Dan Carpenter <dan.carpenter@...cle.com>
To:     Oscar Carter <oscar.carter@....com>
Cc:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Forest Bond <forest@...ttletooquiet.net>,
        devel@...verdev.osuosl.org, Malcolm Priestley <tvboxspy@...il.com>,
        linux-kernel@...r.kernel.org,
        Gabriela Bittencourt <gabrielabittencourt00@...il.com>,
        Colin Ian King <colin.king@...onical.com>
Subject: Re: [PATCH] staging: vt6656: Use ARRAY_SIZE instead of hardcoded size

On Sat, Mar 14, 2020 at 05:47:54PM +0100, Oscar Carter wrote:
> Use ARRAY_SIZE to replace the hardcoded size so we will never have a
> mismatch.
> 
> Signed-off-by: Oscar Carter <oscar.carter@....com>
> ---
>  drivers/staging/vt6656/main_usb.c | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/staging/vt6656/main_usb.c b/drivers/staging/vt6656/main_usb.c
> index 5e48b3ddb94c..4370941ffc04 100644
> --- a/drivers/staging/vt6656/main_usb.c
> +++ b/drivers/staging/vt6656/main_usb.c
> @@ -23,6 +23,7 @@
> 
>  #include <linux/etherdevice.h>
>  #include <linux/file.h>
> +#include <linux/kernel.h>
>  #include "device.h"
>  #include "card.h"
>  #include "baseband.h"
> @@ -116,6 +117,7 @@ static int vnt_init_registers(struct vnt_private *priv)
>  	int ii;
>  	u8 tmp;
>  	u8 calib_tx_iq = 0, calib_tx_dc = 0, calib_rx_iq = 0;
> +	const int n_cck_pwr_tbl = ARRAY_SIZE(priv->cck_pwr_tbl);

Please use ARRAY_SIZE(priv->cck_pwr_tbl) everywhere instead of
introducing this new variable.

regards,
dan carpenter

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ