Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp197322imw; Fri, 8 Jul 2022 00:54:11 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tTggXT64W/42qx9CWpXyuyyWzXt9rQHi+nYZKBvznZzi0/BWfPC8SPEglEaEeB6TQ7G9nR X-Received: by 2002:a63:1843:0:b0:412:6ea5:ac5c with SMTP id 3-20020a631843000000b004126ea5ac5cmr2143037pgy.366.1657266850780; Fri, 08 Jul 2022 00:54:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657266850; cv=none; d=google.com; s=arc-20160816; b=DvFNrAei7idIgS/Ve1AfWYaM1EiaEnCUKLN2YJXYQJXvednnsj3RBLrVSa943eOOyi BJHL3YKWQF+VYJTG1l75N3VU1xvbVOH+DMyWJIbln6gx2cyrTFaa4hpa3tvnzLVvWOIc 9SdUJWR7r/5ztZwLg3XqLJ33nrfQLVJ9gu0gCU9T/6MDg95pdta4FXkI+C2zfRdp2I7p icwRctGpKUoIKLe0KSwmdEvXCNyc04MjXQzIkLdgoTeFdwAtAGU/fUHVEVAleVBXEky6 peaki6rroxAUhA/yi8DNkq9m3ihkc8FY6snH809JKvXa1diT4797MHUfTNCh8SHM/jfc wEYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature:dkim-signature; bh=AR73VFU4xhO2Wv5kLjdkzS0nSTAgkRpNRvkdlCke4Ak=; b=EK0ShnXgBf7kzz0aEPhaduGWcEDA9pHSHCwUZytMtsTSax2rPU3epLof/m1owGoecs 9gLwjkTSl2eKCqf+R16n/Yim9Ae1AXl6wmvMEzrw5oVkHwrQswaHUcSCQAHihBop5cYs ZTMhXhCsZVdZ2asouu63Paxhhkpt5j3Edk+MWxdrLKs1kTAFehalEuN4S62fqi0WqSgy zFJCSqahnJmgD44GpgshBjocmHQt3jq8q+FCVOwlU9zeJu1RV0APk+BFcbF4glxXQJCo z6q803Qtqm5yfTvMQ9/4GnGXy8tXv19I4/svqvsavwZZbPqv3UfbOD7SAvs8XW7Va/U0 XpPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=Bpppd1GE; dkim=neutral (no key) header.i=@suse.cz; 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 q4-20020a170902a3c400b0016c116a940csi5551538plb.495.2022.07.08.00.53.56; Fri, 08 Jul 2022 00:54:10 -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; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=Bpppd1GE; dkim=neutral (no key) header.i=@suse.cz; 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 S237468AbiGHHQR (ORCPT + 99 others); Fri, 8 Jul 2022 03:16:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57492 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237206AbiGHHQQ (ORCPT ); Fri, 8 Jul 2022 03:16:16 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B1D1E796BB; Fri, 8 Jul 2022 00:16:15 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 264CB21A46; Fri, 8 Jul 2022 07:16:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1657264573; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=AR73VFU4xhO2Wv5kLjdkzS0nSTAgkRpNRvkdlCke4Ak=; b=Bpppd1GEhso3X+/xusk2NqO2VthvZZ9NUM/R8rzwUFiPbL+NqMmBcNvU0Y72/EsGaFxXNU 4BfsCGl1HPqsjjHOq58R82LNgbxVRH9gj7A6ERHrhWCiuZKf6OaPTin+rWsQQgmPwARIQm T7zP516fEPOXztnSV5wvWwaADdlN4KQ= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1657264573; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=AR73VFU4xhO2Wv5kLjdkzS0nSTAgkRpNRvkdlCke4Ak=; b=s1QhdVaXv0j+QjrUNzPD2yeNaEJaxE+XelKwd6DEh3mzpEv69+0f6R1pG8r2pcWrhF0928 rvplMhWpotDhgRBA== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id E5A1E13A7D; Fri, 8 Jul 2022 07:16:12 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id elb8NrzZx2IwDQAAMHmgww (envelope-from ); Fri, 08 Jul 2022 07:16:12 +0000 Message-ID: <98363f27-e7a4-7351-fad7-361f7e465b7e@suse.cz> Date: Fri, 8 Jul 2022 09:16:12 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.10.0 Subject: Re: [PATCH 1/2] clk: pistachio: Fix initconst confusion Content-Language: en-US To: Stephen Boyd , mturquette@baylibre.com Cc: mliska@suse.cz, linux-kernel@vger.kernel.org, Andi Kleen , linux-clk@vger.kernel.org References: <20220623083217.26433-1-jslaby@suse.cz> <20220624004225.0DE4AC3411D@smtp.kernel.org> <0edab0e2-5355-a3da-445d-b6f45e3082ed@suse.cz> <20220629082104.E25D2C34114@smtp.kernel.org> From: Jiri Slaby In-Reply-To: <20220629082104.E25D2C34114@smtp.kernel.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 On 29. 06. 22, 10:21, Stephen Boyd wrote: > Quoting Jiri Slaby (2022-06-27 00:46:15) >> On 24. 06. 22, 2:42, Stephen Boyd wrote: >>> Quoting Jiri Slaby (2022-06-23 01:32:16) >>>> From: Andi Kleen >>>> >>>> A variable pointing to const isn't const itself. It'd have to contain >>>> "const" keyword after "*" too. Therefore, PNAME() cannot put the strings >>>> to "rodata". Hence use __initdata instead of __initconst to fix this. >>>> >>>> [js] more explanatory commit message. >>>> >>>> Cc: Michael Turquette >>>> Cc: Stephen Boyd >>>> Cc: linux-clk@vger.kernel.org >>>> Signed-off-by: Andi Kleen >>>> Signed-off-by: Jiri Slaby >>>> --- >>>> drivers/clk/pistachio/clk.h | 2 +- >>>> 1 file changed, 1 insertion(+), 1 deletion(-) >>>> >>>> diff --git a/drivers/clk/pistachio/clk.h b/drivers/clk/pistachio/clk.h >>>> index f9c31e3a0e47..742e5fab00c0 100644 >>>> --- a/drivers/clk/pistachio/clk.h >>>> +++ b/drivers/clk/pistachio/clk.h >>>> @@ -34,7 +34,7 @@ struct pistachio_mux { >>>> const char **parents; >>>> }; >>>> >>>> -#define PNAME(x) static const char *x[] __initconst >>>> +#define PNAME(x) static const char *x[] __initdata >>> >>> Can it be const char * const and left as __initconst? >> >> Let me check, IIRC the struct where this is assigned would need to be >> updated too. >> >> I will get into it only some time next week. >> > > Ok, sounds good. This seems to at least compile locally. Yeah, that works. I've sent a v2. BTW is the code intended to put the actual strings to .init.rodata? As that was never the case. Only those PNAME defined arrays (pointers to strings) end up in .init.rodata now and the strings are in .rodata. > ----8<--- > > diff --git a/drivers/clk/pistachio/clk.h b/drivers/clk/pistachio/clk.h > index f9c31e3a0e47..8be02ac2d909 100644 > --- a/drivers/clk/pistachio/clk.h > +++ b/drivers/clk/pistachio/clk.h > @@ -31,10 +31,10 @@ struct pistachio_mux { > unsigned int shift; > unsigned int num_parents; > const char *name; > - const char **parents; > + const char * const *parents; > }; > > -#define PNAME(x) static const char *x[] __initconst > +#define PNAME(x) static const char * const x[] __initconst > > #define MUX(_id, _name, _pnames, _reg, _shift) \ > { \ -- js suse labs