From patchwork Mon Feb 20 13:20:56 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leonard Crestez X-Patchwork-Id: 9582757 X-Patchwork-Delegate: sboyd@codeaurora.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C78CB604A0 for ; Mon, 20 Feb 2017 13:21:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B96F628867 for ; Mon, 20 Feb 2017 13:21:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ADDFD28874; Mon, 20 Feb 2017 13:21:23 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3F0A828867 for ; Mon, 20 Feb 2017 13:21:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753281AbdBTNVK (ORCPT ); Mon, 20 Feb 2017 08:21:10 -0500 Received: from mail-sn1nam02on0062.outbound.protection.outlook.com ([104.47.36.62]:10992 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753238AbdBTNVH (ORCPT ); Mon, 20 Feb 2017 08:21:07 -0500 Received: from BY2PR03CA046.namprd03.prod.outlook.com (10.141.249.19) by BY2PR03MB1941.namprd03.prod.outlook.com (10.164.114.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.888.16; Mon, 20 Feb 2017 13:21:04 +0000 Received: from BN1BFFO11FD018.protection.gbl (2a01:111:f400:7c10::1:172) by BY2PR03CA046.outlook.office365.com (2a01:111:e400:2c5d::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.919.13 via Frontend Transport; Mon, 20 Feb 2017 13:21:04 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; vger.kernel.org; dkim=none (message not signed) header.d=none; vger.kernel.org; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BN1BFFO11FD018.mail.protection.outlook.com (10.58.144.81) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.919.10 via Frontend Transport; Mon, 20 Feb 2017 13:21:03 +0000 Received: from fsr-ub1664-115.ea.freescale.net (fsr-ub1664-115.ea.freescale.net [10.171.73.201]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id v1KDL0Y7025283; Mon, 20 Feb 2017 06:21:01 -0700 From: Leonard Crestez To: Michael Turquette , Stephen Boyd , CC: Leonard Crestez , Subject: [PATCH] clk: core: Copy connection id Date: Mon, 20 Feb 2017 15:20:56 +0200 Message-ID: <60d115f6c11bc51cd8bc10c64cd222c3cdb43cc7.1487596492.git.leonard.crestez@nxp.com> X-Mailer: git-send-email 2.7.4 X-EOPAttributedMessage: 0 X-Matching-Connectors: 131320704638076988; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(336005)(7916002)(39380400002)(39450400003)(39840400002)(39410400002)(39850400002)(39400400002)(39860400002)(2980300002)(1110001)(1109001)(339900001)(199003)(189002)(36756003)(104016004)(54906002)(92566002)(85426001)(38730400002)(97736004)(189998001)(5003940100001)(33646002)(5660300001)(6666003)(8656002)(8936002)(356003)(106466001)(118296001)(4326007)(50466002)(68736007)(77096006)(626004)(8676002)(105606002)(86362001)(53936002)(2906002)(50226002)(81156014)(305945005)(47776003)(48376002)(81166006)(50986999); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR03MB1941; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD018; 1:VlGODjEz4JEDoaVgy14U6O+cG4VvGuWBGNzZbJqAAzv1cTc4cYdnOPXcMW5jyD/GuKTWzUO9noP/N05TU6aEHObl5GHpTmgV7NyE1cS52ZbWG7y43O0UlDxOO6xK1xGet9UcdO46D7OMOJ3+aulcWcwhKVz6dRPrKtJIs5HSYPkCQek+Eyv2vF5pSYYbm2uJeK4l67VQzZrBEE6OKEf94mBE7zTPbFam0lbt9sVQ3k8m+T5JCv9f3OJEJhLcDEodTGrW3koQZv8Cn3VmtGZXWZuvZstBJNto7T2r7CrtP8o2P/0bEaQRsiJDb7NqT292IEDNmeGjJqVp1MI+OKl2V5Ja2gBvWaz8aoT56KzGHNmqxI+bASBcxtj35S5t9wXwQTtkyC/uXQLi70dwBIcZ6GwFgVou2WfSAzlPaRC+usp2zJwKvVHRD7b1TIYjbvoDU56IrHPzACUwEzk0uDdkmbyf6vgfeGf0zNfRvZLHV5bUU5oWU+8IctzLudZZfDLi8+IcR+aVqjSSWhU1uLxwTST12FMlNbWrtFAH+LH0FO11ly2o0mk+eE5oysRjOyBN+J+mYi3usBJhVIgMqny7mBHwf006HFUQ37vkPiSGIfY= MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 08c83414-732b-45ed-483c-08d459935212 X-Microsoft-Antispam: UriScan:; BCL:0; PCL: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DqK2QmJDtoON2rzahBzf6JahZ2ow08ptU0hWyECDrWSHlU1hpDnZQYcsT08COvzI6T1ev/VzzKGEVdkLfiK5f+0qmChSZm6Fi7MEChzbcfS/WeqOLAJtZX9FbJqOXUsHCX/SaUmVpU7YMdvzD5eguebZ4ChhmAJaaVPg== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095060)(601004)(2401047)(13017025)(13018025)(13023025)(13024025)(13015025)(8121501046)(5005006)(10201501046)(3002001)(6055026)(6096035)(20161123563025)(20161123561025)(20161123556025)(20161123559025)(20161123565025); SRVR:BY2PR03MB1941; BCL:0; PCL:0; RULEID:(400006); SRVR:BY2PR03MB1941; X-Microsoft-Exchange-Diagnostics: 1; BY2PR03MB1941; 4:mfpQhQAQHfTyaume9A43fNVCu5sJkmC2t9kDHsAZIipX5NAicA1by6cziV1iV0Heqw1hAGx3rBrA1Pebn2IuSm49qzuOGbT53Jq5dcHF3QOqveT2E6XxpeIbOlUqioKFGChom6MGfqC9LJV+ecGIe/0/YmQnV31cwUFfPndp44OhYcHSLqtLh2/bllZhO6VCdqZ5KxveaoQssaAuBLrKewqBr5K1J8vtwfQTVNulI/NYD26bqS1F+Xn0vODcb93Xa7XWU4TDcCLCPwy3870pSzafVxqb5Wb3yt/bVbiz5WrPmiGnrcffcwv15u8GuNW0J+27axCYeEztrB+tz0O3EuKD3CT6LyJ0DYHhVpo3MWCjf1SVDwk/bt1p+Sjlrwm9g/PrXsP/OghzwN/uefUiln1khhXxny7SupZqGzrAeRk/5yVYdZa7ompuU3bFQ1CgNkRItuDgnCFz1vdg4o0P2cy+HjzaY0Gq27PE280GmwbCEqo07Hsb8ZT8V5hixQ44nYwm1+z02wcAe7fDXPRMeoomEP/nHJ3DWMqfwwwnjlrS9ybEbqU6wocXFe00itPHsz0Pud9aqe7prp1BIGmO0NV8eIXkH1vV/X3O5zaccAHte7gqF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-ascii?Q?76GqtGCxmszbt6Ng1EvvtFvQXdNADo9koVh4ioPpRZw3co7eOAdnCJAlu3c2?= =?us-ascii?Q?lQcbpxv383F4Ss9D566YRy0SEafPychv3PIHLUbzlXkkvLm9DK6oJU3KCgOd?= =?us-ascii?Q?Bwx/gbczltvYD+5G8N+T6szOHBElfZlEoPJzGaDNzYjeyYisgtkM/NXnflpf?= =?us-ascii?Q?Ox+WMNlRLxYVy05nzbH/pahdGb5W/FowT0s/AXjdlhNpdljkqbFikM4Thz4W?= =?us-ascii?Q?mOnWYxZmNXnAYK/9PtRAy8OHw0IQONkIh20Ps6VX3uf+sj698rBqQF/KwzC3?= =?us-ascii?Q?/bzGsrdWRskAtjr31GwrPVAjfCzJfZZY+IvwExYAcbqKRUywlsDLZz2i6bmT?= =?us-ascii?Q?0QaY/ByXMazyR8of1rHffO0E8pFtbnF1G99aKLH49wArAyVbwm3sIk92FCV/?= =?us-ascii?Q?hFFQXtDXZ5pxhv6xSpJxbBlFe0+sIZmIWBJYlTPKgfo1irPAHaxQ3MrmXuYf?= =?us-ascii?Q?57dNijczZn/XPrOOtZnKNzGpFbfAKGAQzRg7nJEmPFkbLZopGm1m7bTtg=3D?= =?us-ascii?Q?=3D?= X-Microsoft-Exchange-Diagnostics: 1; BY2PR03MB1941; 6:CS+01yHUc8rd4PSWlvfXKI4GPls8bRtqawfszzT+YiE3c9LnNCk8YNwiR5zB7xTe7f7BzwxhY/Jb5cK059LkH63ircuKQ0/Kooye5CavEU/hi0jAsXb+lR2V88m5hORy2Un1ly3fUboaaItBmOYDzxadVaspAPhhLZGDEBw1ZWkt2A7KJV08AEVul1jEtcasOKPZKgc0Lms8IBVTREeddOB3ZJ8pbPMXqC6OSNmMos2bFopqwLcEvKy4C+4Ax6xytElGo/MmuBaoNAZLGzm8Xx5RHHZds2EDgMVQhnnQvqOANOenmATyqHSfnNcoAzP7DOvFhD6pyowFWHpi89r6UHVCjsakZLu+vcnx6kzZRC0afER0BtzwVtE7kTWo+wKDYK0pI3QI3mT0CCO/iwdeu/48Bh/t/FR67ayjU+9XBLA=; 5:ZNdHy1NBiD1JkVW2AcpjlIuvdWlcD1/6q/C+wFXdE/ZRHow2aI1o5IRspuqFvl/ea+w4ju4oW3vsoXIRmdiXd9g8yMjG9ODfkFm+ndvdGyFSSNivwJmKYz4q3Ep3MRJZ5rY3PhykrJwwcvwHIrZiDbyMPi4T53y7N8TJdXMoHAGA9zwVi9vcaKQgA8wxXaS4; 24:g2mSboyTn0B3+FjmlRq5Njx+P+GgGPZVWuyuSNs9YNaOw8FoYfurj4PhQ0i/hSm6eWVeIKOYJzGms+iSojtCSfnANa5PeEG0NQGBmOunG6c= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BY2PR03MB1941; 7:iaMuglgT0gslY8i3HTDQhvUTzMIVQHYokgqSs60sU5bKaqccYrdnrKlQUsIpo5s4Xyh4/+dteFChocRcFxKcoNaIKr3WCEgVPpg7BEeFF7ko+8HRw6t8n3nI+ajLihj3W3ecgAaF2KROY9DJyEXQlPQ+gkT34Ztu9sFmkJnIOALWP1s49rLtWCPVd2+Zs1vVtnHjrV+uKjQaOGzs5QzV7RBLOSddiaappi+luLTMUYUPgORNpfSlMgz5hhzNpBtCAXPyFZRwF+v6mri+0kA9Y7b7apcSA5QjV5JjcFYXJg9m7uaqv2HcTAqf+yog1QaY5DlL6YN8iUDvr4A0CLFDyg== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Feb 2017 13:21:03.6205 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR03MB1941 Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Some drivers use sprintf to build clk connection id names but the clk core will save those strings and occasionally print them back. Duplicate the con_id strings instead of fixing all the users. Signed-off-by: Leonard Crestez --- drivers/clk/clk.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) Some examples of using sprintf for con_id include: drivers/mfd/omap-usb-host.c drivers/tty/serial/samsung.c sound/soc/fsl/fsl_asrc.c There are lots more. They are difficult to find and "fixing" them on the consumer side requires nasty code to keep track of the allocated clkname. diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c index 0fb39fe..67201f6 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c @@ -2502,7 +2502,7 @@ struct clk *__clk_create_clk(struct clk_hw *hw, const char *dev_id, clk->core = hw->core; clk->dev_id = dev_id; - clk->con_id = con_id; + clk->con_id = kstrdup_const(con_id, GFP_KERNEL); clk->max_rate = ULONG_MAX; clk_prepare_lock(); @@ -2518,6 +2518,7 @@ void __clk_free_clk(struct clk *clk) hlist_del(&clk->clks_node); clk_prepare_unlock(); + kfree_const(clk->con_id); kfree(clk); }