From patchwork Mon Dec 23 03:32:33 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Emilio_L=C3=B3pez?= X-Patchwork-Id: 304640 Return-Path: X-Original-To: incoming-imx@patchwork.ozlabs.org Delivered-To: patchwork-incoming-imx@bilbo.ozlabs.org Received: from casper.infradead.org (unknown [IPv6:2001:770:15f::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 376DB2C00A9 for ; Mon, 23 Dec 2013 14:35:16 +1100 (EST) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VuwHU-0005Z3-Gw; Mon, 23 Dec 2013 03:34:13 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VuwHH-000878-IV; Mon, 23 Dec 2013 03:33:59 +0000 Received: from yotta.elopez.com.ar ([31.220.24.173]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VuwH0-00084Q-QF for linux-arm-kernel@lists.infradead.org; Mon, 23 Dec 2013 03:33:44 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=elopez.com.ar; s=mail; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From; bh=WxJhQU+PcarxiUjxaiNR0e53dCOLyVLzfQ3W9A6YUJs=; b=PJGVU9hwkFg4OsaTs5qEiT/T0FJ5dsA8fegoRHrvRZONvumO8+L546znSxq2iX7dNXue7HFd1lAHgPLTAzv7MEz2KJpW8fZD1F66b2FUB6p8hzs8qhsKSL3geqQvDaedOG8rKk7LWyupJw/aO9FTvgXSaQjFA4Fj3ShDPafwbjthV3UG82peVe5LnZm04u/VQOx+BUGkYCqoc12DymQkZ6x0cV2Vu0jd6C7SzUMVHuP/HaR/Gp6N19N4ACofc5zMa9PhtQEJ+92aIA3PwMBU4E7hod3Mf/VvBeC6wQdzhNrHxkMcIb/PUtZvvEArjxHIOixoVgHbbqZ+LgVY4AR5Gw==; Received: from [181.164.111.231] (helo=desktop.lan) by yotta.elopez.com.ar with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA256:128) (Exim 4.82) id 1VuwGi-0004Ey-70; Mon, 23 Dec 2013 00:33:24 -0300 From: =?UTF-8?q?Emilio=20L=C3=B3pez?= To: Mike Turquette , Maxime Ripard Subject: [PATCH v3 02/13] clk: sunxi: clean the magic number of mux parents Date: Mon, 23 Dec 2013 00:32:33 -0300 Message-Id: <1387769564-12894-3-git-send-email-emilio@elopez.com.ar> X-Mailer: git-send-email 1.8.5.2 In-Reply-To: <1387769564-12894-1-git-send-email-emilio@elopez.com.ar> References: <1387769564-12894-1-git-send-email-emilio@elopez.com.ar> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131222_223343_032567_02192364 X-CRM114-Status: UNSURE ( 7.76 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.5 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.5 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -0.5 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Cc: =?UTF-8?q?Emilio=20L=C3=B3pez?= , Hans de Goede , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org List-Id: linux-imx-kernel.lists.patchwork.ozlabs.org This was pointed out during the review of the factor patches. Let's indicate what does that magic 5 mean. Signed-off-by: Emilio López --- drivers/clk/sunxi/clk-sunxi.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/clk/sunxi/clk-sunxi.c b/drivers/clk/sunxi/clk-sunxi.c index b823613..ce42c92 100644 --- a/drivers/clk/sunxi/clk-sunxi.c +++ b/drivers/clk/sunxi/clk-sunxi.c @@ -414,13 +414,14 @@ static void __init sunxi_mux_clk_setup(struct device_node *node, { struct clk *clk; const char *clk_name = node->name; - const char *parents[5]; + const char *parents[SUNXI_MAX_PARENTS]; void *reg; int i = 0; reg = of_iomap(node, 0); - while (i < 5 && (parents[i] = of_clk_get_parent_name(node, i)) != NULL) + while (i < SUNXI_MAX_PARENTS && + (parents[i] = of_clk_get_parent_name(node, i)) != NULL) i++; clk = clk_register_mux(NULL, clk_name, parents, i,