Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp1038963iog; Wed, 29 Jun 2022 15:55:22 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uoc/Je6OrDW0a5hKSY6y78+AwfqnJbMrdcG4TY92wtX9zYNyUI1xfCeb5l+fG6+KF1f2Lv X-Received: by 2002:a17:903:32cb:b0:16a:3f2e:ca70 with SMTP id i11-20020a17090332cb00b0016a3f2eca70mr11296747plr.153.1656543322729; Wed, 29 Jun 2022 15:55:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656543322; cv=none; d=google.com; s=arc-20160816; b=WHvd2vubAf8cyKK5xe6Q1P71k4wFnGOkxH3XKGjtIsauuMb/Kk2xFjZ+04EhVRuTAK qByJ+K/XetuKDwwei6+01c0Mhoyz/4DjmMk1zGoCsQl7EGZ9Owe6qW7UXEWX1XY7Wxtb hBBWqhQKtMhsJjQmZkWy6oroyjjScLUyBzD0/oVXGJVODlTlInBBGhUBSzlHuyOSPNIw VfpcLAIQuzEYxz1O5+g2Jn9R9/hJVWXojt8q5e6AEfUa8StokWhOiL8CIcOTTa76/CUG IrMjGZcSeiLFvJHTjvsOHsXvNemz/aQRjGy7bmC+pfYCks4bcFLQeCxuFcuxtuof1oy9 S5hw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=r6vAl6r3AkC+CVYxQCcS0SPSgQyLyeZzFWkGctjST6U=; b=EwL4vxD+oEl1hk5mjS0nyCDT4iIUVKgqlCvYnoLdICoh2AGxJ20XzeiGaC+/KJxLew XCJPw+HPFQQGBendWThFV4vwffOqINOfgQ253kbk6bj3LDdEndRrV3JCDj72bFkLiad1 NzEZukSEkTQjymFZt4uma0p4SonZ8YdmbLNszEvi0pxt2huGh7RqasKcxWW7od/hCvvw XkPZ58t620JJ3h3U5r6rssSnUqb7bntN2lt05t77gfJkqPRArs5qw/hXN+MmDwaFWSmb OO4qy1tKwJ1VKgsntw0lf2efgvCpYGgINR0D1LEX0AYr0HTisFSA+Md/CPis3DiSQtGw T8Mg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bt6-20020a056a00438600b005250a05fff7si4443382pfb.50.2022.06.29.15.55.11; Wed, 29 Jun 2022 15:55:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230501AbiF2Wxy (ORCPT + 99 others); Wed, 29 Jun 2022 18:53:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35784 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229838AbiF2Wxp (ORCPT ); Wed, 29 Jun 2022 18:53:45 -0400 Received: from m-r2.th.seeweb.it (m-r2.th.seeweb.it [IPv6:2001:4b7a:2000:18::171]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F3DEE2558B; Wed, 29 Jun 2022 15:53:43 -0700 (PDT) Received: from Marijn-Arch-PC.localdomain (94-209-165-62.cable.dynamic.v4.ziggo.nl [94.209.165.62]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by m-r2.th.seeweb.it (Postfix) with ESMTPSA id DB5FA3F796; Thu, 30 Jun 2022 00:53:41 +0200 (CEST) From: Marijn Suijten To: phone-devel@vger.kernel.org, Dmitry Baryshkov , Stephen Boyd Cc: ~postmarketos/upstreaming@lists.sr.ht, AngeloGioacchino Del Regno , Konrad Dybcio , Martin Botka , Jami Kettunen , Marijn Suijten , Michael Turquette , Rob Clark , Abhinav Kumar , Sean Paul , David Airlie , Daniel Vetter , Rajeev Nandan , Vladimir Lypak , Jonathan Marek , linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org Subject: [PATCH v3 05/11] drm/msm/dsi_phy_28nm_8960: Use stack memory for temporary clock names Date: Thu, 30 Jun 2022 00:53:25 +0200 Message-Id: <20220629225331.357308-6-marijn.suijten@somainline.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220629225331.357308-1-marijn.suijten@somainline.org> References: <20220629225331.357308-1-marijn.suijten@somainline.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The clock names formatted into the hw_clk's init structure are only used for the duration of the registration function where they are kstrdup'ed, making it unnecessary to keep the allocations alive for the duration of the device (through devm). Just like the other DSI PHY PLL clock trees, use a stack-local char array and save on memory outside of the pll_28nm_register function. Signed-off-by: Marijn Suijten Reviewed-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/dsi/phy/dsi_phy_28nm_8960.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/drivers/gpu/drm/msm/dsi/phy/dsi_phy_28nm_8960.c b/drivers/gpu/drm/msm/dsi/phy/dsi_phy_28nm_8960.c index af630b8eb9f3..24bac401b210 100644 --- a/drivers/gpu/drm/msm/dsi/phy/dsi_phy_28nm_8960.c +++ b/drivers/gpu/drm/msm/dsi/phy/dsi_phy_28nm_8960.c @@ -383,7 +383,7 @@ static int dsi_28nm_pll_restore_state(struct msm_dsi_phy *phy) static int pll_28nm_register(struct dsi_pll_28nm *pll_28nm, struct clk_hw **provided_clocks) { - char *clk_name, *parent_name, *vco_name; + char clk_name[32], parent_name[32], vco_name[32]; struct clk_init_data vco_init = { .parent_data = &(const struct clk_parent_data) { .fw_name = "ref", @@ -404,18 +404,6 @@ static int pll_28nm_register(struct dsi_pll_28nm *pll_28nm, struct clk_hw **prov if (!bytediv) return -ENOMEM; - vco_name = devm_kzalloc(dev, 32, GFP_KERNEL); - if (!vco_name) - return -ENOMEM; - - parent_name = devm_kzalloc(dev, 32, GFP_KERNEL); - if (!parent_name) - return -ENOMEM; - - clk_name = devm_kzalloc(dev, 32, GFP_KERNEL); - if (!clk_name) - return -ENOMEM; - snprintf(vco_name, 32, "dsi%dvco_clk", pll_28nm->phy->id); vco_init.name = vco_name; -- 2.37.0