From: Dan Carpenter <dan.carpenter@oracle.com>
To: Oscar Carter <oscar.carter@gmx.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Forest Bond <forest@alittletooquiet.net>,
devel@driverdev.osuosl.org,
Malcolm Priestley <tvboxspy@gmail.com>,
linux-kernel@vger.kernel.org,
Gabriela Bittencourt <gabrielabittencourt00@gmail.com>,
Colin Ian King <colin.king@canonical.com>
Subject: Re: [PATCH] staging: vt6656: Use ARRAY_SIZE instead of hardcoded size
Date: Tue, 17 Mar 2020 13:45:06 +0300 [thread overview]
Message-ID: <20200317104506.GA4650@kadam> (raw)
In-Reply-To: <20200314164754.8531-1-oscar.carter@gmx.com>
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
next prev parent reply other threads:[~2020-03-17 10:45 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-14 16:47 [PATCH] staging: vt6656: Use ARRAY_SIZE instead of hardcoded size Oscar Carter
2020-03-17 10:45 ` Dan Carpenter [this message]
2020-03-18 16:55 ` Oscar Carter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200317104506.GA4650@kadam \
--to=dan.carpenter@oracle.com \
--cc=colin.king@canonical.com \
--cc=devel@driverdev.osuosl.org \
--cc=forest@alittletooquiet.net \
--cc=gabrielabittencourt00@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=oscar.carter@gmx.com \
--cc=tvboxspy@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox