From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752549AbbEDI23 (ORCPT ); Mon, 4 May 2015 04:28:29 -0400 Received: from mail-bl2on0141.outbound.protection.outlook.com ([65.55.169.141]:8864 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751084AbbEDI2W (ORCPT ); Mon, 4 May 2015 04:28:22 -0400 Authentication-Results: spf=fail (sender IP is 192.88.158.2) smtp.mailfrom=freescale.com; freescale.mail.onmicrosoft.com; dkim=none (message not signed) header.d=none; Date: Mon, 4 May 2015 16:16:10 +0800 From: Dong Aisheng To: Stephen Boyd CC: Dong Aisheng , , , , , , , , , Subject: Re: [PATCH RFC v1 3/5] clk: remove unneeded __clk_enable and __clk_disable Message-ID: <20150504081609.GB4082@shlinux1.ap.freescale.net> References: <1429107999-24413-1-git-send-email-aisheng.dong@freescale.com> <1429107999-24413-4-git-send-email-aisheng.dong@freescale.com> <55427DDE.4090907@codeaurora.org> <20150430220548.GA31047@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20150430220548.GA31047@codeaurora.org> User-Agent: Mutt/1.5.20 (2009-06-14) X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:192.88.158.2;CTRY:US;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10019020)(6009001)(339900001)(189002)(24454002)(51914003)(199003)(51704005)(479174004)(110136002)(6806004)(5001960100002)(107886002)(77096005)(92566002)(62966003)(77156002)(93886004)(19580405001)(46102003)(19580395003)(85426001)(33656002)(2950100001)(50986999)(76176999)(106466001)(54356999)(23726002)(97756001)(47776003)(50466002)(87936001)(104016003)(105606002)(46406003)(42262002)(4001430100001)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:CY1PR03MB1373;H:az84smr01.freescale.net;FPR:;SPF:Fail;MLV:sfv;MX:1;A:1;LANG:en; X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CY1PR03MB1373; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(5005006)(3002001);SRVR:CY1PR03MB1373;BCL:0;PCL:0;RULEID:;SRVR:CY1PR03MB1373; X-Forefront-PRVS: 05669A7924 X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 May 2015 08:28:19.0227 (UTC) X-MS-Exchange-CrossTenant-Id: 710a03f5-10f6-4d38-9ff4-a80b81da590d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=710a03f5-10f6-4d38-9ff4-a80b81da590d;Ip=[192.88.158.2];Helo=[az84smr01.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR03MB1373 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 30, 2015 at 03:05:48PM -0700, Stephen Boyd wrote: > On 04/30, Stephen Boyd wrote: > > On 04/15/15 07:26, Dong Aisheng wrote: > > > The only thing __clk_enable/__clk_disable does is NULL pointer checking > > > of clk except calling clk_core_{enable|disable} which is already handled > > > by clk_core_{enable|disable}. > > > So remove this unneeded function. > > > > > > Cc: Mike Turquette > > > Cc: Stephen Boyd > > > Signed-off-by: Dong Aisheng > > > --- > > > > No. You can call clk_enable() and clk_disable() with NULL and it should > > be a no-op. With this change it would cause a NULL pointer exception. > > > > Here's the proper patch. I'll leave you as author. > Got your point. Thanks for the change. Regards Dong Aisheng > ---8<--- > diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c > index 0227ac3d5b1a..e45255226ffa 100644 > --- a/drivers/clk/clk.c > +++ b/drivers/clk/clk.c > @@ -1023,14 +1023,6 @@ static void clk_core_disable(struct clk_core *core) > clk_core_disable(core->parent); > } > > -static void __clk_disable(struct clk *clk) > -{ > - if (!clk) > - return; > - > - clk_core_disable(clk->core); > -} > - > /** > * clk_disable - gate a clock > * @clk: the clk being gated > @@ -1051,7 +1043,7 @@ void clk_disable(struct clk *clk) > return; > > flags = clk_enable_lock(); > - __clk_disable(clk); > + clk_core_disable(clk->core); > clk_enable_unlock(flags); > } > EXPORT_SYMBOL_GPL(clk_disable); > @@ -1089,14 +1081,6 @@ static int clk_core_enable(struct clk_core *core) > return 0; > } > > -static int __clk_enable(struct clk *clk) > -{ > - if (!clk) > - return 0; > - > - return clk_core_enable(clk->core); > -} > - > /** > * clk_enable - ungate a clock > * @clk: the clk being ungated > @@ -1115,8 +1099,11 @@ int clk_enable(struct clk *clk) > unsigned long flags; > int ret; > > + if (!clk) > + return 0; > + > flags = clk_enable_lock(); > - ret = __clk_enable(clk); > + ret = clk_core_enable(clk->core); > clk_enable_unlock(flags); > > return ret; > > -- > Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, > a Linux Foundation Collaborative Project