Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp524009ybi; Fri, 7 Jun 2019 12:00:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqzlsBgImlyLGLX2GBWhGmxdiPm5v/tJ5qlJjWUTad23jlFbMAwhHdIKRtaI4J3JHLvYemCj X-Received: by 2002:a62:764d:: with SMTP id r74mr37808748pfc.110.1559934052137; Fri, 07 Jun 2019 12:00:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559934052; cv=none; d=google.com; s=arc-20160816; b=Flm6um0U41tm5C0zl/bNOTogtNrBK0fMieTbXXFQvXpYcpzEcPeM1Pk0AF4xCgpIUc BkT0o32OToBWP/UZ31lB4G5ANXkjnNZPxC8kwibxN5E4zvDIVBu/zl+qNNwlkZAqDIV4 J+wuCo8G2vpcl6269md5dq5L4//7LOLr4VIkcfb+5xSP5UzAIGd8G15nE2O7uIn+jVO8 axHfurpDoee1KgPbJpPB5zviTJN60kUO+TBbE+fErruri13HhGxeFIuZnDmgZ86qXbdJ R+Npx9oqbSpr6wpyEGTGdnYvfxHFMaHUfI6ceo9fhqsAP6DrUHSnRPTMo9uuv8IYt2Yy qlkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:user-agent:cc:subject :from:to:references:in-reply-to:content-transfer-encoding :mime-version:dkim-signature; bh=MqJreODoM+H7TRL8NdegoYQKYvRm10L/bT/6DJdqNhc=; b=mscYBpLaQ0DQtHPZK738zU/VlCVUEeV0+4+Eey1gHD7I5eYvPKqY8cb89R7PBKEyuo Ms3UfFkWvif78hd3Xs72zfBoapJOj65ptJ/oIx2EptEyQearWoHse0t/npiBfT9yTSGF XQwaXJ4zwjhcjGW4SViIjQ7KbyDfyeWCBOIMpZO6zx3tQ3dsCnewoI0wbxTbNVZKehoh 0Fdgb3LefgokMMeUG3OJcP9J+LXLPjz2EZPGNoQFmedcBG3SbQSru9EJ513lny5bzQyH WG0Slp94Ri+jJ9x920s5i1M40MZsMaNmxokTaoE7LWSThaH2WAkmAx4HQgQPWuYJf84G 1/MQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Ds6bRfWQ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j14si2888800pfi.276.2019.06.07.12.00.35; Fri, 07 Jun 2019 12:00:52 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Ds6bRfWQ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731258AbfFGSR0 (ORCPT + 99 others); Fri, 7 Jun 2019 14:17:26 -0400 Received: from mail.kernel.org ([198.145.29.99]:42470 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729817AbfFGSR0 (ORCPT ); Fri, 7 Jun 2019 14:17:26 -0400 Received: from kernel.org (unknown [104.132.0.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0086E20868; Fri, 7 Jun 2019 18:17:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1559931445; bh=avBGzeDVPLC9Ku4xRFNfHkrWVnK+12j3mF281rswmfs=; h=In-Reply-To:References:To:From:Subject:Cc:Date:From; b=Ds6bRfWQvpaGWItGBIQ2L+kHDmodlH1EYVF3q7lMDBTgqnuENK9g2pHSlExCOXG5X a+pte8EbrOWyuTxeCw/a2lS6/ldaHVZ6kPB+YPcyl5Ama5fQXvJZs/RBhbqOgQL93m i15dWegbnRDru6/8ThZdIe2Z8XTWmBKRA8rQLErs= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable In-Reply-To: <20190520080421.12575-3-wens@kernel.org> References: <20190520080421.12575-1-wens@kernel.org> <20190520080421.12575-3-wens@kernel.org> To: Chen-Yu Tsai , Maxime Ripard , Michael Turquette From: Stephen Boyd Subject: Re: [PATCH 02/25] clk: Add CLK_HW_INIT_* macros using .parent_hws Cc: Chen-Yu Tsai , linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org User-Agent: alot/0.8.1 Date: Fri, 07 Jun 2019 11:17:24 -0700 Message-Id: <20190607181725.0086E20868@mail.kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Quoting Chen-Yu Tsai (2019-05-20 01:03:58) > A special CLK_HW_INIT_HWS macro is included, which takes an array of > struct clk_hw *, but sets .num_parents to 1. This variant is to allow > the reuse of the array, instead of having a compound literal allocated > for each clk sharing the same parent. >=20 > Signed-off-by: Chen-Yu Tsai [...] > diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h > index bb6118f79784..0c241b43a802 100644 > --- a/include/linux/clk-provider.h > +++ b/include/linux/clk-provider.h > @@ -904,6 +904,24 @@ extern struct of_device_id __clk_of_table; > .ops =3D _ops, \ > }) > =20 > +#define CLK_HW_INIT_HW(_name, _parent, _ops, _flags) \ > + (&(struct clk_init_data) { \ > + .flags =3D _flags, = \ > + .name =3D _name, = \ > + .parent_hws =3D (const struct clk_hw*[]) { _parent },= \ > + .num_parents =3D 1, = \ > + .ops =3D _ops, = \ > + }) > + > +#define CLK_HW_INIT_HWS(_name, _parent, _ops, _flags) \ Minor nitpick, please add a comment here to indicate that this is here to share the same compound literal between multiple clks using the same parent. > + (&(struct clk_init_data) { \ > + .flags =3D _flags, = \ > + .name =3D _name, = \ > + .parent_hws =3D _parent, = \ > + .num_parents =3D 1, = \ > + .ops =3D _ops, = \ > + })