lkml.org 
[lkml]   [2020]   [Mar]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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@gmx.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

\
 
 \ /
  Last update: 2020-03-17 11:47    [W:0.283 / U:0.144 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site