Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp855619imu; Tue, 20 Nov 2018 08:00:24 -0800 (PST) X-Google-Smtp-Source: AFSGD/Wi3moZUHsFb3bK0xh3nOoLp3GBiDhoRffR0WguSt0ntEPOG9xNsPlTi8MHP6NIifFZwQyp X-Received: by 2002:a17:902:2969:: with SMTP id g96mr2733915plb.295.1542729624503; Tue, 20 Nov 2018 08:00:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542729624; cv=none; d=google.com; s=arc-20160816; b=uuZ1GffwC/oSQR8Fzrj+R8MtuMTRNqg/2CdYYmEBgpN1LZ4bjD8lYtGdAWdzSw01Da otVOguiruKKfALHuH0ws06t9/URm/ReuivLRmMp1Pmx6HVvvkt4aSgkX7FEqEubcc2d9 oL/hGSxI2/a8+BEI6N4VhKRt4cBgbolXUBeUoJgUJjSnfKmQMe3BOzPbGevZFkz4AbS9 RvfgkrCb4bMWa5kF41jrJpptoamaSQBDbMBeEOzDLrtcC2PcnyMKHi0C2UKEKf4v0kYP 61+J5w6WYu7YVkiaBrlec/V8uS8wmYf1PR0lzAU3YXyQHH4Q3/ex38MaIuIY9EewvZ15 Zt0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=JzIOO+uRm8sh3qyDteX0DcqEwer58gWdOc5Y5gQJ9L0=; b=jg3GPHzc24I2O2xa+iCiWivQJ12Z7pf5RplFuXRMGeVCb4WVwdvXvIVtCDdcr13qwr i2/EpFNB4FYu50+z7MDl9YHZzGndf4mwQc/VC2gSC9GeVpPV2KzREd1s66XE82X5OXQ0 wnki3sum+ndNEKJdQa+cqbefWA8tRYNpUna0ffsGuR38j6eE5WP+rKcOJieluVSrxYMe prM1GarWCEpIiyM5PFUSQFW7r8B1QTgnXqFbmrazStteBTIGIkgqqyVeg+Xaait81+pu Yzwt6pn97M+/gks3zerzbN9WGahBqBxQX1x0ekFzuhj59yNjIYacPEvuwYmtWbPlYLIK JHFA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id cf14-v6si45221482plb.422.2018.11.20.08.00.08; Tue, 20 Nov 2018 08:00:24 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729118AbeKTX0G (ORCPT + 99 others); Tue, 20 Nov 2018 18:26:06 -0500 Received: from metis.ext.pengutronix.de ([85.220.165.71]:54927 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726911AbeKTX0F (ORCPT ); Tue, 20 Nov 2018 18:26:05 -0500 Received: from ptx.hi.pengutronix.de ([2001:67c:670:100:1d::c0]) by metis.ext.pengutronix.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1gP5aL-0000QC-R8; Tue, 20 Nov 2018 13:56:57 +0100 Received: from ukl by ptx.hi.pengutronix.de with local (Exim 4.89) (envelope-from ) id 1gP5aG-00017J-JU; Tue, 20 Nov 2018 13:56:52 +0100 Date: Tue, 20 Nov 2018 13:56:52 +0100 From: Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= To: Andy Shevchenko Cc: Phil Edworthy , Stephen Boyd , Michael Turquette , Russell King , linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Greg Ungerer , Geert Uytterhoeven , Ralf Baechle , Paul Burton , James Hogan , Jiaxun Yang , Huacai Chen , Guan Xuetao , linux-m68k@lists.linux-m68k.org, linux-mips@linux-mips.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH] clk: Add (devm_)clk_get_optional() functions Message-ID: <20181120125652.afk2rltmnunfo346@pengutronix.de> References: <20181119141259.11992-1-phil.edworthy@renesas.com> <20181120103832.GV10650@smile.fi.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20181120103832.GV10650@smile.fi.intel.com> User-Agent: NeoMutt/20170113 (1.7.2) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c0 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, On Tue, Nov 20, 2018 at 12:38:33PM +0200, Andy Shevchenko wrote: > On Mon, Nov 19, 2018 at 02:12:59PM +0000, Phil Edworthy wrote: > > + if (clk == ERR_PTR(-ENOENT)) > > + return NULL; > > + else > > + return clk; > > return clk == ERR_PTR(-ENOENT) ? NULL : clk; > > ? Not sure this adds to the readability of the expression. Personally I prefer the explicit if. Maybe even: clk = clk_get(...); if (clk == ERR_PTR(-ENOENT)) clk = NULL; return clk; Best regards Uwe -- Pengutronix e.K. | Uwe Kleine-K?nig | Industrial Linux Solutions | http://www.pengutronix.de/ |