Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp2054960imm; Wed, 16 May 2018 07:14:00 -0700 (PDT) X-Google-Smtp-Source: AB8JxZot8F7PDwd/XsJyT3cAUmsYZuc/bC5NNifEUobC3XTL3Gih3PgT4G7GU4YalFC/LXgYSiQN X-Received: by 2002:a17:902:5327:: with SMTP id b36-v6mr1166583pli.316.1526480040393; Wed, 16 May 2018 07:14:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526480040; cv=none; d=google.com; s=arc-20160816; b=PVdGcUYoO4lXJUuyyzbTdWNP+77FZqK1/pxRPBm0hw6xVGvS9fAmp+lG4iCiYznWdE avzKvtmI8J0TMwdI0dzkF7+7f7rrXiy21L9IM+AF+N3bkpORbsC9ifYCxlTJQhlxd7dH KFRC31+JE7/tpvmDJ4ALdGWapv1B4W14gVYlpd4znF1sDP2Hy5VgUKqcwV+3ybq6qqTk 6V+18Pik2oMjqi61iYwTQAJjhJRRzTzHMgJdTB/COac9vqY1mD3SFEJ8xlKtDl1rsF/A iMwhH3FFPC59VqDcKWJw19+w9e4ovY+/0Y+AklHwFqS0s2cs6zaMuuSZMNuFl61ZWTmk dHDg== 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=KDuBB8lWKJpUqNsFYJBxV08SK1AwNtxAXXmsOQIohmc=; b=HBcdefCOuOJ+zD7M9YqHlxlLnayq2iAxETMabZIjwB8N7HALfqz68ZGQ3TLKysKLLT gxr70tykl+WE1gvkxtlii7DOl3Dg7WrhBY/wj1SlyqDZZamACOYzrp1OUc2sc1Zvnafo 5ufwrI89YT/CPBL/cq/W4fhHY8qgJBL+v5eWtCD5F+kiNCDNxrjd64zztXqEt79cZfDj tX4vmnUJiJMSWn3HGt2aZ33YttDD3dJZBIQE2HwGzLGi88xLfSmNljvT3icJqA5RkJ+I 3JbzEkL6cRUYQ8nlK91rLrNALWSwpuNpFQofa3BMe6euhoFa8RLZZcdCYZZ71bV8m6YF kIjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dqOZJ3ky; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j194-v6si2103570pgc.92.2018.05.16.07.13.46; Wed, 16 May 2018 07:14:00 -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=@linaro.org header.s=google header.b=dqOZJ3ky; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752568AbeEPOLk (ORCPT + 99 others); Wed, 16 May 2018 10:11:40 -0400 Received: from mail-pf0-f195.google.com ([209.85.192.195]:41507 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752215AbeEPOLh (ORCPT ); Wed, 16 May 2018 10:11:37 -0400 Received: by mail-pf0-f195.google.com with SMTP id v63-v6so417681pfk.8 for ; Wed, 16 May 2018 07:11:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=KDuBB8lWKJpUqNsFYJBxV08SK1AwNtxAXXmsOQIohmc=; b=dqOZJ3ky29deqqzZvFymywxfuyzumIHuFdddNI/K7rpTfdBM6CCuealirGkB/P7N2P 5AIhxMJQN4AQ+EDVhzxZTEkk9t7esPwRi0OrVp9Dxk19noQoG1WKmlrQGKuY4Ns6hN45 U2j36rHzx9+2FjY2/Ltd67diHF+0Jidli/8o8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=KDuBB8lWKJpUqNsFYJBxV08SK1AwNtxAXXmsOQIohmc=; b=hyG89AGe23sjzGMO+m+roGv3hIM1bjTsRfBHZamyyYpMtdRIE2zivtChNglAP5NOkO ZIpFAeLGwpu83u4h9Bg2vg1j/yKeYrJ6hjBEojLIrntRgtZ8zC+pB9Q1/bF5fdjZUF1q SmOsF6mvDEs1qOqpqoBoQwERyLZx6T51eqyPhxjxLFlrAb9ZzEHtNsOSqcZoCxAvws+u kZlRlUMwo8BfQYLiMl9I+z2naR2rCaBZMMiIw72lC0YrURoa8jXf7BqpUsJesxRXO+Io 7pr7nJUs/xImYAKGSEC456P/T2CzrYKGBid9IwspaSrAIPuvU3MgRaP7LJWcvpw+gOqz MKdA== X-Gm-Message-State: ALKqPwdX0TWy+Vfh8+754ybF7I6ndCa/yAvAdBRkimvzWPiaZCkfg0B0 6fS9CjiXZyt5ns7GxGfVrnCHpQ== X-Received: by 2002:a65:5244:: with SMTP id q4-v6mr868517pgp.201.1526479896583; Wed, 16 May 2018 07:11:36 -0700 (PDT) Received: from localhost ([122.167.163.112]) by smtp.gmail.com with ESMTPSA id a77-v6sm4623814pfe.70.2018.05.16.07.11.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 16 May 2018 07:11:35 -0700 (PDT) Date: Wed, 16 May 2018 19:41:32 +0530 From: Viresh Kumar To: Amit Kucheria Cc: Ilia Lin , Michael Turquette , sboyd@kernel.org, Rob Herring , Mark Rutland , nm@ti.com, lgirdwood@gmail.com, broonie@kernel.org, Andy Gross , David Brown , catalin.marinas@arm.com, will.deacon@arm.com, "Rafael J. Wysocki" , linux-clk@vger.kernel.org, devicetree@vger.kernel.org, LKML , Linux PM list , linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org, lakml , Rajendra Nayak , nicolas.dechesne@linaro.org, celster@codeaurora.org, tfinkel@codeaurora.org Subject: Re: [PATCH v7 12/14] cpufreq: Add Kryo CPU scaling driver Message-ID: <20180516141132.aqjif7d5motmmnlo@vireshk-i7> References: <1526375616-16904-1-git-send-email-ilialin@codeaurora.org> <1526375616-16904-13-git-send-email-ilialin@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180323-120-3dd1ac Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 16-05-18, 16:12, Amit Kucheria wrote: > > + ret = PTR_ERR_OR_ZERO(opp_temp = > > + dev_pm_opp_set_supported_hw(cpu_dev,&versions,1)); > > + if (0 > ret) > > Any particular reason to prefer this over (ret < 0) that is generally > used? I've seen it used to avoid the == vs. = typos, but not for other > comparisons. > > Suggest sticking to what is commonly used i.e. ret < 0. > > > + goto free_opp; > > + > > + cpu_dev = get_cpu_device(GOLD_LEAD); > > Error check cpu_dev here? > > > + ret = PTR_ERR_OR_ZERO(opp_temp = > > + dev_pm_opp_set_supported_hw(cpu_dev,&versions,1)); > > + if (0 > ret) > > + goto free_opp; The goto here is wrong > > + > > + > > + ret = PTR_ERR_OR_ZERO(platform_device_register_simple("cpufreq-dt", > > + -1, NULL, 0)); > > + > > + if (0 == ret) > > + return 0; > > + > > +free_opp: > > + dev_pm_opp_put_supported_hw(opp_temp); > > This is not needed because dev_pm_opp_set_supported_hw will free > memory in case of failure. This call in only needed in case of a > successful get. But this is still required for the case where platform device registration fails. -- viresh