From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 47C53C4360F for ; Wed, 3 Apr 2019 14:14:11 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 15D6320830 for ; Wed, 3 Apr 2019 14:14:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="ow5dB/nH" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 15D6320830 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bootlin.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=BvkjDD/ihnoO7TJpLmDhAOjTWR14kRSFFNp5O91stTw=; b=ow5dB/nHTSHuUP hargAWddj64cIqe9MIVFnKSedp6VaRLhaBAD5OKtsq6oJ+T7BkDwCP3UsR7Or5wvdnRbO7ABqouNp 7X1f9azCtb3/2WYLBKu+gIsi7de/eJh5AyNz4ktUI+qIC8/JPH2tZPBv9sqDKeNvJU1i1xhJoKsDH quSqARLC0WiGgCtcybCGnt4YDpHDt/Ac/Z03NKj2dwgjzzeGqRUrPQNlcvEPqD62UstiDrNjA09j6 YJQITZ71ADhg5aWjKt+tWku6EhBJb7sl2KHgdNkEsB/fgrdAB1Utcv5RnchCLRPLMlD4IOr0e9bxB YmIxpZfh1+sP5ij1itlA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hBgeS-0001qn-Vn; Wed, 03 Apr 2019 14:14:04 +0000 Received: from relay7-d.mail.gandi.net ([217.70.183.200]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hBgcg-0007p5-4Y for linux-arm-kernel@lists.infradead.org; Wed, 03 Apr 2019 14:12:44 +0000 X-Originating-IP: 109.213.83.19 Received: from localhost (alyon-652-1-60-19.w109-213.abo.wanadoo.fr [109.213.83.19]) (Authenticated sender: alexandre.belloni@bootlin.com) by relay7-d.mail.gandi.net (Postfix) with ESMTPSA id DE8712000F; Wed, 3 Apr 2019 14:12:09 +0000 (UTC) From: Alexandre Belloni To: Daniel Lezcano , Greg Kroah-Hartman Subject: [PATCH 12/12] clocksource/drivers/timer-atmel-tcb: Use ARRAY_SIZE instead of hardcoded size Date: Wed, 3 Apr 2019 16:11:20 +0200 Message-Id: <20190403141120.32754-13-alexandre.belloni@bootlin.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190403141120.32754-1-alexandre.belloni@bootlin.com> References: <20190403141120.32754-1-alexandre.belloni@bootlin.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190403_071214_781840_53DDB2FD X-CRM114-Status: GOOD ( 11.86 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-pwm@vger.kernel.org, Alexandre Belloni , Arnd Bergmann , Alexander Dahl , Sebastian Andrzej Siewior , linux-kernel@vger.kernel.org, Thomas Gleixner , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org Use ARRAY_SIZE to replace the hardcoded size so we will never have a mismatch. Signed-off-by: Alexandre Belloni --- drivers/clocksource/timer-atmel-tcb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/clocksource/timer-atmel-tcb.c b/drivers/clocksource/timer-atmel-tcb.c index 10350dffd157..eab5beadf2ca 100644 --- a/drivers/clocksource/timer-atmel-tcb.c +++ b/drivers/clocksource/timer-atmel-tcb.c @@ -396,7 +396,7 @@ static int __init tcb_clksrc_init(struct device_node *node) /* How fast will we be counting? Pick something over 5 MHz. */ rate = (u32) clk_get_rate(t0_clk); - for (i = 0; i < 5; i++) { + for (i = 0; i < ARRAY_SIZE(atmel_tc_divisors); i++) { unsigned divisor = atmel_tc_divisors[i]; unsigned tmp; -- 2.20.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel