From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753475AbbC3SUh (ORCPT ); Mon, 30 Mar 2015 14:20:37 -0400 Received: from smtprelay0069.hostedemail.com ([216.40.44.69]:49975 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752982AbbC3SUf (ORCPT ); Mon, 30 Mar 2015 14:20:35 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::::::::::::,RULES_HIT:41:355:379:541:599:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1540:1593:1594:1711:1730:1747:1777:1792:2393:2553:2559:2562:2828:3138:3139:3140:3141:3142:3352:3622:3865:3866:3867:3868:3871:3874:4321:4384:5007:6119:6261:6742:7903:10004:10400:10848:11232:11658:11914:12296:12517:12519:12740:13069:13311:13357:14096:14097:21080,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0 X-HE-Tag: horn52_5c1400cf90202 X-Filterd-Recvd-Size: 2140 Message-ID: <1427739631.14276.23.camel@perches.com> Subject: Re: [PATCH 1/6] clk: make strings in parent name arrays const From: Joe Perches To: Sascha Hauer Cc: Mike Turquette , Stephen Boyd , YH Chen , linux-kernel@vger.kernel.org, Henry Chen , linux-mediatek@lists.infradead.org, kernel@pengutronix.de, Matthias Brugger , Yingjoe Chen , Eddie Huang , linux-arm-kernel@lists.infradead.org Date: Mon, 30 Mar 2015 11:20:31 -0700 In-Reply-To: <20150330181657.GF9742@pengutronix.de> References: <1427737245-4064-1-git-send-email-s.hauer@pengutronix.de> <1427737245-4064-2-git-send-email-s.hauer@pengutronix.de> <1427738119.14276.19.camel@perches.com> <20150330181657.GF9742@pengutronix.de> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.12.10-0ubuntu1~14.10.1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2015-03-30 at 20:16 +0200, Sascha Hauer wrote: > On Mon, Mar 30, 2015 at 10:55:19AM -0700, Joe Perches wrote: > > On Mon, 2015-03-30 at 19:40 +0200, Sascha Hauer wrote: > > > The clk functions and structs declare the parent_name arrays as > > > 'const char **parent_names' which means the parent name strings > > > are const, but the array itself is not. Use > > > 'const char * const * parent_names' instead which also makes > > > the array const. This allows us to put the parent_name arrays into > > > the __initconst section. > > > > If these are pointer entries are stored, care needs to be > > taken to make sure that the memory isn't discarded or needed > > post init. > > The clock framework makes deep copies of all initialization data > structures. Great. Is/Should that be documented somewhere? From mboxrd@z Thu Jan 1 00:00:00 1970 From: joe@perches.com (Joe Perches) Date: Mon, 30 Mar 2015 11:20:31 -0700 Subject: [PATCH 1/6] clk: make strings in parent name arrays const In-Reply-To: <20150330181657.GF9742@pengutronix.de> References: <1427737245-4064-1-git-send-email-s.hauer@pengutronix.de> <1427737245-4064-2-git-send-email-s.hauer@pengutronix.de> <1427738119.14276.19.camel@perches.com> <20150330181657.GF9742@pengutronix.de> Message-ID: <1427739631.14276.23.camel@perches.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Mon, 2015-03-30 at 20:16 +0200, Sascha Hauer wrote: > On Mon, Mar 30, 2015 at 10:55:19AM -0700, Joe Perches wrote: > > On Mon, 2015-03-30 at 19:40 +0200, Sascha Hauer wrote: > > > The clk functions and structs declare the parent_name arrays as > > > 'const char **parent_names' which means the parent name strings > > > are const, but the array itself is not. Use > > > 'const char * const * parent_names' instead which also makes > > > the array const. This allows us to put the parent_name arrays into > > > the __initconst section. > > > > If these are pointer entries are stored, care needs to be > > taken to make sure that the memory isn't discarded or needed > > post init. > > The clock framework makes deep copies of all initialization data > structures. Great. Is/Should that be documented somewhere?