From patchwork Fri Dec 2 16:41:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin Ian King X-Patchwork-Id: 13062923 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 36A33C47089 for ; Fri, 2 Dec 2022 16:43:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=Bxa8KNGswDckXgvg71ZbRXY5xL2MoPZ4t7rNskY3pXU=; b=MLxGJuXO5IGeFC UyZxhVvBzc5+SwsovTHvIHwN8qjW9Ee4QKecFB2KT0bvTjzpkx8XNIouwVqh1qBMhlz9cgZo49SOE +o/onFCoasbc5XkyTv3IkcFNb2Aoqr/VH+FfqEcsDrxvfE+URM4lEE+6ZDQxrAFYtIRUJPRrcL/mo SW5xRM+0UmGMndIRIlLfBk23lFUm7+l2ztLStzuXYZkdrTtEEzIxhtpZy1DcYhSHAQsBjHaUSkTQQ ZPkvIJKPEH8otWqLc1gxtZ6Y5bA4TZSVTV+wW6wbGkz4itQ0e+er9h98G+UHsIH/qGDGLXyioL6I7 0Lg79Nu35UYR+GaLi6CA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p196z-0002I2-JY; Fri, 02 Dec 2022 16:42:05 +0000 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p196w-0002FU-Sg for linux-arm-kernel@lists.infradead.org; Fri, 02 Dec 2022 16:42:04 +0000 Received: by mail-wr1-x433.google.com with SMTP id h11so8595918wrw.13 for ; Fri, 02 Dec 2022 08:41:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=NBhUhPdweZ3fTupviVjoDkaZ/Bzxjb/TM6/+Uzw6tYM=; b=W3qrvxNWQG18OXMSTFZQkIOrmn9ZkqxlS3C/C5VDGgmacy8F6t4GEmPN7+nIzI3R1W UQjqIBsFhs2EmDiU4IouSTnNwPv6jUb97Il4+HByArzo6uADGnPWEGKJLJ0rOnvWxX1Q f7y6wk9Q+rYhTodh2rXoXvfytFFWNLtzU0x8mLSiy9Oj/a0izKbpcO//QAVdGSHCTEQg x7K8L8ymNYZvoApuerQTVuOL6ysZ97HpDjOG0FG8GgNNUBbRBrKcD2VJFGysU5557HPv 5o7o9qy8DYTXJzniz5BXdgMtT2ot4J5sVDErgRFSi7f57gVONYVkQTVbHGLr6WJsqv3J dNOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=NBhUhPdweZ3fTupviVjoDkaZ/Bzxjb/TM6/+Uzw6tYM=; b=gtxyuhdHLtpdm79+S5/UuHTNxG1l2Gx9vEM82EGFdN2THEvB161FDKb4J97Op2Khr0 MOu4SjYx7rXWFYsE1WNRYuOE1VTel3UnEnA/asOv8Na6jIg/P5CKVE1ou6PfczYaHryZ yodR3aIU2FWfGu+OLCVuTPAeRTqwrmUy/pDQkFRntUn5E+Ysmt9CVAK+Zk4/0lq25T7Z NAztNAc/nY2JlO5bS0T4hPRum36trYbHFSmtPA9F05X1+hin2eOtL+KVe+xQoVGJtSSf HQ550BmatPCwKUvQX+UhODajg7URXcO4ohHpPC1NvNecTcYnNAj/DAMVfzn0+BxP+5db haGA== X-Gm-Message-State: ANoB5plGZiDQ6bLSiCVoqDOiyPN1pg1+unn+9nU5wxNUSk6T7Oucq1Mz WEGNBu6wBaXjYclwDzgHDEI= X-Google-Smtp-Source: AA0mqf684oIN5gBFoOCtGHGhakQpJrnScN39W14mgEhGfEioE0MUho6Hs0PFLef9eXd4F5q208iQ/A== X-Received: by 2002:a5d:46d1:0:b0:242:4698:f0a7 with SMTP id g17-20020a5d46d1000000b002424698f0a7mr2151557wrs.77.1669999318410; Fri, 02 Dec 2022 08:41:58 -0800 (PST) Received: from localhost (cpc154979-craw9-2-0-cust193.16-3.cable.virginm.net. [80.193.200.194]) by smtp.gmail.com with ESMTPSA id q17-20020a05600000d100b0024207ed4ce0sm7491149wrx.58.2022.12.02.08.41.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Dec 2022 08:41:57 -0800 (PST) From: Colin Ian King To: Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Kunihiko Hayashi , Masami Hiramatsu , alsa-devel@alsa-project.org, linux-arm-kernel@lists.infradead.org Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH][next] ASoC: uniphier: aio-core: Make some read-only arrays static const Date: Fri, 2 Dec 2022 16:41:56 +0000 Message-Id: <20221202164156.1812971-1-colin.i.king@gmail.com> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221202_084202_958617_37C3E6A7 X-CRM114-Status: GOOD ( 12.51 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Don't populate the read-only arrays slotsel_2ch, slotsel_multi, v_pll and v_div on the stack but instead make them static const. Also makes the object code a little smaller. Signed-off-by: Colin Ian King --- sound/soc/uniphier/aio-core.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/sound/soc/uniphier/aio-core.c b/sound/soc/uniphier/aio-core.c index b8195778953e..0eba60758134 100644 --- a/sound/soc/uniphier/aio-core.c +++ b/sound/soc/uniphier/aio-core.c @@ -277,17 +277,18 @@ void aio_port_reset(struct uniphier_aio_sub *sub) static int aio_port_set_ch(struct uniphier_aio_sub *sub) { struct regmap *r = sub->aio->chip->regmap; - u32 slotsel_2ch[] = { + static const u32 slotsel_2ch[] = { 0, 0, 0, 0, 0, }; - u32 slotsel_multi[] = { + static const u32 slotsel_multi[] = { OPORTMXTYSLOTCTR_SLOTSEL_SLOT0, OPORTMXTYSLOTCTR_SLOTSEL_SLOT1, OPORTMXTYSLOTCTR_SLOTSEL_SLOT2, OPORTMXTYSLOTCTR_SLOTSEL_SLOT3, OPORTMXTYSLOTCTR_SLOTSEL_SLOT4, }; - u32 mode, *slotsel; + u32 mode; + const u32 *slotsel; int i; switch (params_channels(&sub->params)) { @@ -515,13 +516,13 @@ static int aio_port_set_clk(struct uniphier_aio_sub *sub) struct uniphier_aio_chip *chip = sub->aio->chip; struct device *dev = &sub->aio->chip->pdev->dev; struct regmap *r = sub->aio->chip->regmap; - u32 v_pll[] = { + static const u32 v_pll[] = { OPORTMXCTR2_ACLKSEL_A1, OPORTMXCTR2_ACLKSEL_F1, OPORTMXCTR2_ACLKSEL_A2, OPORTMXCTR2_ACLKSEL_F2, OPORTMXCTR2_ACLKSEL_A2PLL, OPORTMXCTR2_ACLKSEL_RX1, }; - u32 v_div[] = { + static const u32 v_div[] = { OPORTMXCTR2_DACCKSEL_1_2, OPORTMXCTR2_DACCKSEL_1_3, OPORTMXCTR2_DACCKSEL_1_1, OPORTMXCTR2_DACCKSEL_2_3, };