Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp3630057ybh; Tue, 17 Mar 2020 03:46:09 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvWsmYRd3FkYFJs9clPUn9E5yyoxP8nA3eLwC1gJbF8mWO0WQMudofR7GEUo439cmlts8Lk X-Received: by 2002:a05:6830:1193:: with SMTP id u19mr3299226otq.190.1584441969223; Tue, 17 Mar 2020 03:46:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584441969; cv=none; d=google.com; s=arc-20160816; b=fTDOi6FTjFMVoKp8fEw7FAP+gIKt5IRteBMWE2Oh162ch/Z5jKwyYqnakTei378Fe8 gJkrvQPkYbRAcBDKDSyRLjYbgWrGATSBCq8UkqlzDSrJOeDSVWL+fg2qxM6exo4UjGGO tJK44tqr21dx69rVF6BaHbeHs1Le2jgjZ/0VXresD3EZ5mHJDTUZ+20hPJgORJA9SFRA 2vVtdiDN2ATaLksXpSJf1w3Qj0J/KzREZf4RkBL/h6kZC1PnPVOwCc5EEYnsrz2DUQYx DaTW+iqDo+qrQ5VNBKxQScgH2YKuQA6VQPqkNBcLTTT1SwxNznrj3I/vpSEvcD8Sk5SN d4kw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=mSkMnLoVfT9tvOtdqIFWw9gr53HIM+8g9ieWNpJlYG8=; b=UU3hg3klEmGBOF8++5xtmxU5JKTb7zRp5+7QdydCsRig6zh2+55tEN0HrzhP8I+JqN Sy8LENdxdhrgCzQDoGVZk0OdSX0RFSFXscOb2QKe2WG6mZUFQvRUdU8QGqv0TRQCfHp8 VeTkUElpEaGSfra5t2zzxuXJ6sa16tILTXHx4Jd0E7jDkIZ5s/edrzH6WK4EyZ9v1IFB xJvY3mrtIrKNB1tgXYclgEfsa5f2tptvI22zhXJeiOwUJ7AAXtBBvpIoUcvJEX3hOAFl +XDiJ8Hls+zcJE5VTkt8qk8rXVDutmz43MMqNO4tUv+J4JdqY1jTgfYzOGa/jQ0KjWY0 BAwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2020-01-29 header.b=djH9ocTo; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w21si1617608oia.257.2020.03.17.03.45.56; Tue, 17 Mar 2020 03:46:09 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2020-01-29 header.b=djH9ocTo; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725995AbgCQKpd (ORCPT + 99 others); Tue, 17 Mar 2020 06:45:33 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:57464 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725794AbgCQKpc (ORCPT ); Tue, 17 Mar 2020 06:45:32 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 02HAdjxc152500; Tue, 17 Mar 2020 10:45:19 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=corp-2020-01-29; bh=mSkMnLoVfT9tvOtdqIFWw9gr53HIM+8g9ieWNpJlYG8=; b=djH9ocToi04r4JjL/b8oIy9U34xHc3CnrGVoZ4qBtAOdBp7j2i7QjlSow7wAYnXy3SzI G4lHYzA8YaGYz+hZqaQVwX7Cl9fPsv0BaMcSrSyoV7gfLeORdAcb3CBVA+A/wH9GREWj M7k2Sc1vaVVYiEsrpZBbrnVGOLs6jpkAjaKVwS12Q936tXm/mjVX1mY504negNi9plCy Gy0sBZqDFkww4mzIqwcwaKEzaNbjEPLJV37jwah6ZIDGMOZmWHVsIYeztQYhEcjq8PXU jG4za59IFFmd7W0KW1C1MVskbDHDIsEcTxu2qoCbxp/FEiyRh0/BaPPfd2BOSXhLf7vm WQ== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by userp2120.oracle.com with ESMTP id 2yrqwn3yga-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 17 Mar 2020 10:45:19 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 02HAVWvp070353; Tue, 17 Mar 2020 10:45:18 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserp3020.oracle.com with ESMTP id 2ys92cm0ef-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 17 Mar 2020 10:45:18 +0000 Received: from abhmp0007.oracle.com (abhmp0007.oracle.com [141.146.116.13]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id 02HAjFod003782; Tue, 17 Mar 2020 10:45:15 GMT Received: from kadam (/41.57.98.10) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 17 Mar 2020 03:45:14 -0700 Date: Tue, 17 Mar 2020 13:45:06 +0300 From: Dan Carpenter To: Oscar Carter Cc: Greg Kroah-Hartman , Forest Bond , devel@driverdev.osuosl.org, Malcolm Priestley , linux-kernel@vger.kernel.org, Gabriela Bittencourt , Colin Ian King Subject: Re: [PATCH] staging: vt6656: Use ARRAY_SIZE instead of hardcoded size Message-ID: <20200317104506.GA4650@kadam> References: <20200314164754.8531-1-oscar.carter@gmx.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200314164754.8531-1-oscar.carter@gmx.com> User-Agent: Mutt/1.9.4 (2018-02-28) X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9562 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 mlxlogscore=999 mlxscore=0 spamscore=0 bulkscore=0 adultscore=0 suspectscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2003170047 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9562 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 lowpriorityscore=0 mlxlogscore=999 mlxscore=0 bulkscore=0 phishscore=0 spamscore=0 suspectscore=0 malwarescore=0 priorityscore=1501 clxscore=1011 adultscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2003170047 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > --- > 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 > #include > +#include > #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