Received: by 10.192.165.156 with SMTP id m28csp1451250imm; Wed, 18 Apr 2018 09:49:33 -0700 (PDT) X-Google-Smtp-Source: AIpwx49nzFqWaxyWuQR/7q/XghF/ofhGmTSOHWrWfY8xnMvcPLWzOht5I4SjqqyXpHhcjwprT3Pg X-Received: by 10.98.139.7 with SMTP id j7mr2665023pfe.28.1524070172969; Wed, 18 Apr 2018 09:49:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524070172; cv=none; d=google.com; s=arc-20160816; b=fLSmdhCvzUom4IgrXGAqk5QZKHch5YA7cpMrZjjYMYytJFGhgtLBCE8lbiktGkBwbS 4QQQjQSI+I7oVmxEOyvoQF5BumWTbXqJs6siXvAEPZqVdGt679ZPS1oDKJsH0KcSpAoM 7t+zxuao/BYPaJzJnIkHMpm//+7F/DN8efHsx0y5q71x3OgFnhg2oCFa9Lzv9w9aI6fl jYRpz56zs01Y/F5jc3nkOGlxTv60rSJ2jq+hX4Dw+YItv7GTJKsiBbDUrFruxJTVX1D7 M6teP3ULpXqtlXcizr1O7tbcR6riJ/weUglgxLVQFxzuHHbKOHV6YuedWc46hMtJyHAa +MYA== 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-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=NXIfEldvBrjpCRP8W3opx3RPale8knteYBPkiqDIxD4=; b=E4PYtWVPzmbDMVS3Z2PEHhlA2h1sDe6QpLbd+x/PXLkiai/cn5mqXZMleKj5q3Ha/E W33o0i+yKu7w6Lywil38gtZS/uq49SXmVJhA7ovbrVAxd8dSql6vluN+Hdr+MJbbkHME VilYtKPzS/6YE7/q+265hZHX78UGV8HOw/3lOPFwTxu30L2M0EKUk6ThhB+LQE8L2zC1 3JD6Rue0Wze6/QXZqX/tmeumzqAy8KqQCv3f99tA7ruHJGEoE8FSFgtmxEqx1TkfZ9u1 K/xCBVIcUMtucMTo/4yD2PNJPnYz0zSo40i7luvxgoy3bgHf3FdgtmKcn4o9daHcyYdT b8CQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=m0MaGrP8; 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 n14si1347718pgc.366.2018.04.18.09.49.18; Wed, 18 Apr 2018 09:49:32 -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=fail header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=m0MaGrP8; 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 S1752077AbeDRQsJ (ORCPT + 99 others); Wed, 18 Apr 2018 12:48:09 -0400 Received: from heliosphere.sirena.org.uk ([172.104.155.198]:44848 "EHLO heliosphere.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750961AbeDRQsI (ORCPT ); Wed, 18 Apr 2018 12:48:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sirena.org.uk; s=20170815-heliosphere; h=In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=NXIfEldvBrjpCRP8W3opx3RPale8knteYBPkiqDIxD4=; b=m0MaGrP8U2vyy5CyfEGR1u/73 OTRZ5QT1VSPvSrBZQcD+f0Zy+MHYXTnII8gL15vqur2f1IiK8efsnEBYK+UuvO2NKxf3QdIfj83fX feG52AzVKu5L97KoR4jVSQZIkTX32mffL5HKgDzFx8Oy+W4AXBSFojM8hAb5q5Gd8S994=; Received: from debutante.sirena.org.uk ([2001:470:1f1d:6b5::3] helo=debutante) by heliosphere.sirena.org.uk with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1f8qFY-0000oU-KE; Wed, 18 Apr 2018 16:48:04 +0000 Received: from broonie by debutante with local (Exim 4.90_1) (envelope-from ) id 1f8qFY-00050d-50; Wed, 18 Apr 2018 17:48:04 +0100 Date: Wed, 18 Apr 2018 17:48:04 +0100 From: Mark Brown To: Doug Anderson Cc: Javier Martinez Canillas , David Collins , Evan Green , swboyd@chromium.org, linux-omap , Liam Girdwood , Tony Lindgren , Linux Kernel Subject: Re: [PATCH v2] regulator: Don't return or expect -errno from of_map_mode() Message-ID: <20180418164804.GJ10061@sirena.org.uk> References: <20180418033143.208986-1-dianders@chromium.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="Xssso5lpTBgMxDfe" Content-Disposition: inline In-Reply-To: X-Cookie: Sank heaven for leetle curls. User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --Xssso5lpTBgMxDfe Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Apr 18, 2018 at 08:56:22AM -0700, Doug Anderson wrote: > On Wed, Apr 18, 2018 at 12:15 AM, Javier Martinez Canillas > >> if (!of_property_read_u32(np, "regulator-initial-mode", &pval)= ) { > >> if (desc && desc->of_map_mode) { > >> - ret =3D desc->of_map_mode(pval); > >> - if (ret =3D=3D -EINVAL) > >> + unsigned int mode =3D desc->of_map_mode(pval); > > I think the convention is to always declare local variables at the > > start of the function? Although I couldn't find anything in the coding > > style document... > I haven't seen this as a consistent kernel convention. It seems a bit > up to the subsystem and/or driver maintainer. However, I'm happy to > put it up at the top if it makes people happy. It's *fairly* consistent (this is C code after all) - doing something different usually has some form of motivation. =20 --Xssso5lpTBgMxDfe Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAlrXdsMACgkQJNaLcl1U h9Cgwgf+L45bv3e9yxNHJhGSZS3zTVaDeXbSKorw2sho86f0DYSEneXEyBqHgI14 dBMe4KL0Q7miw3+YPmgzMc81v1m+wj72NOmaxO849mEK2t8LUxFgf+SlI2f2dozk WaTRUQsJODb4ncvh40pzXVZE5Iwx31wRQufKaOP+BMZNIUkkVtYCZFk23l10kEjJ QCzAcSC1Wyms8hhdWrwzggKLPTp49xw3Y77pxgDfmMED1BB5nYE3aN58+uDZmQhb K4iIM3PtJ77H2e1FWMBYv1irZG23zw1Rk+cj9u5w/TNyw2wQmY6xylI6JZzBcMkM 1Crl75ctzHNv+bTk8ZQtCL1arm4ovg== =GCTt -----END PGP SIGNATURE----- --Xssso5lpTBgMxDfe--