From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758827AbbFBJ7C (ORCPT ); Tue, 2 Jun 2015 05:59:02 -0400 Received: from mail-am1on0108.outbound.protection.outlook.com ([157.56.112.108]:48283 "EHLO emea01-am1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754842AbbFBJ6x convert rfc822-to-8bit (ORCPT ); Tue, 2 Jun 2015 05:58:53 -0400 From: "Dhere, Chaitanya (C.)" To: Johnny Kim , Rachel Kim , "Dean Lee" , Chris Park , "Greg Kroah-Hartman" CC: "linux-wireless@vger.kernel.org" , "devel@driverdev.osuosl.org" , "linux-kernel@vger.kernel.org" Subject: [PATCH] staging: wilc1000: Modification in code to use ARRAY_SIZE macro Thread-Topic: [PATCH] staging: wilc1000: Modification in code to use ARRAY_SIZE macro Thread-Index: AQHQnRq5WTPAI9XK9k+KNwAQLI6Ygw== Date: Tue, 2 Jun 2015 09:58:50 +0000 Message-ID: <20150602095844.GA31971@ubuntu> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=cvijaydh@visteon.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [74.112.164.116] x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:AM3PR06MB1396; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(601004)(520003)(5005006)(3002001);SRVR:AM3PR06MB1396;BCL:0;PCL:0;RULEID:;SRVR:AM3PR06MB1396; x-forefront-prvs: 05954A7C45 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(199003)(189002)(40100003)(5001960100002)(92566002)(86362001)(102836002)(122556002)(2860100001)(54356999)(5002640100001)(64706001)(2656002)(77156002)(50986999)(5001770100001)(81156007)(4001540100001)(105586002)(97736004)(68736005)(2900100001)(19580395003)(106116001)(33716001)(46102003)(5001860100001)(66066001)(19580405001)(5001830100001)(33656002)(101416001)(106356001)(229853001)(62966003)(87936001)(189998001);DIR:OUT;SFP:1102;SCL:1;SRVR:AM3PR06MB1396;H:AM3PR06MB1393.eurprd06.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; Content-Type: text/plain; charset="us-ascii" Content-ID: <1F849E09AC7E5D4B94EA49C173594B87@eurprd06.prod.outlook.com> Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-OriginatorOrg: visteon.com X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Jun 2015 09:58:50.1894 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 7a147aaf-01ec-498c-80a1-e34a8c63c548 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM3PR06MB1396 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Chaitanya Dhere In this patch, ARRAY_SIZE() macro is used to determine the size. This change was detected with the help of coccinelle tool. Signed-off-by: Chaitanya Dhere --- drivers/staging/wilc1000/linux_wlan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c index b033eb8..592b8ae 100644 --- a/drivers/staging/wilc1000/linux_wlan.c +++ b/drivers/staging/wilc1000/linux_wlan.c @@ -1737,7 +1737,7 @@ static int linux_wlan_read_mac_addr(void *vp) mm_segment_t old_fs; loff_t pos = 0; int index; - int array_size = sizeof(path_string) / sizeof(path_string[0]); + int array_size = ARRAY_SIZE(path_string); /* change to KERNEL_DS address limit */ old_fs = get_fs(); -- 1.7.9.5