Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp2972577imm; Thu, 17 May 2018 00:51:34 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpc6W4V3zdpTA55RzbDQ5C4OJo2PtioMCUmGTHgxIccoKq25kYa4Zz+7SciulTWABZV10tf X-Received: by 2002:a63:7a5e:: with SMTP id j30-v6mr3357838pgn.145.1526543494478; Thu, 17 May 2018 00:51:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526543494; cv=none; d=google.com; s=arc-20160816; b=miwGQI8AA5PTq9U3evjKKCfmQBkdHe1bnE1o+6/7cAqSkXO2LeQqr18l0EbFiL8QsN mzb0hGTTQswNW348ydNpp/hHWS5ECJKI8kCTqe6hPAzD+3EVYSOUi9VY8ss4drC5TW0k E0lRtOzP8tIzWvBtYqJtp2yyn2OQ1Qn1t1o5TH6NF0B4eejIBofC/8va3ukAz+FjA2Pl b8CZX293BvzCe/n1OCVTszylRAvp51lpCihKtycv6/wqPFyoXr7cIus8mjkNjtz/pdUg YAWQgLSpcvKkJvt02b3Mh8kWOrAcItP8fizVJvK13ErxlISQ+iNUlsVLQ09hN9XjRWsS pGTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language:thread-index :content-transfer-encoding:mime-version:message-id:date:subject :in-reply-to:references:cc:to:from:dmarc-filter:dkim-signature :dkim-signature:arc-authentication-results; bh=0p4D/mc3pWe5qPFAlXWIqNvnZcgi0sK53pVCZ8sjuzA=; b=rtLVm6FqvvG9RPv6gxtkpO58HRPCp07fNrcYbqk2w4Z8b2xO+SICDqBBQ7gYXdKIqo 02NyfJXAlxpLK7CQNjV27nP8CRWM6p4BNr8vxbkrDwot59UkYx8uI3hB4rp4HLtBOq1T 863XcvOu2YpaeX6Vl4AeZOH0AQFHlN9/um2mks6e6kVtpgG+Dw7ZP5of69exyMfLNvd0 dItfccGHcAXJLj1VO0sjwtRqllq9AOou6Gnvb6uym/U0dq0r9Ujnkw1TDHRaVy+UjHZX kNo8HcQH8Shmm4NeLTJrrt0243jS7twwUQaF9hjYhS0ZlrHaaTPpg4DHmMHgTt5dKMpD 1mVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=o4yMv1/3; dkim=pass header.i=@codeaurora.org header.s=default header.b=UfDt7B7j; 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 h131-v6si4394102pfc.206.2018.05.17.00.51.19; Thu, 17 May 2018 00:51:34 -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=@codeaurora.org header.s=default header.b=o4yMv1/3; dkim=pass header.i=@codeaurora.org header.s=default header.b=UfDt7B7j; 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 S1752312AbeEQHvL (ORCPT + 99 others); Thu, 17 May 2018 03:51:11 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:36092 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751680AbeEQHvH (ORCPT ); Thu, 17 May 2018 03:51:07 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 394ED60131; Thu, 17 May 2018 07:51:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1526543467; bh=TpOYZwcMP07+y3F4lZJqDJuWIYDujUy2mDoOrtJ1Pt0=; h=From:To:Cc:References:In-Reply-To:Subject:Date:From; b=o4yMv1/3VwahkCmus1A0gnzcg/HbHKz+nQoQMobLwU5RxOArhdgJ3Owm7BYUAIQ9E B+YwPjIz8JM/LLlOMoB5aU5S9HHB7JQ7fmT/uL80LUXRs05uAUrf5RhKXygtKpuYd6 xMHSAJMfGWJb2tJEtQH3K0vCocYKShhiVQ89QwIs= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 Received: from ilial (unknown [185.23.60.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: ilialin@codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 5481F60274; Thu, 17 May 2018 07:50:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1526543441; bh=TpOYZwcMP07+y3F4lZJqDJuWIYDujUy2mDoOrtJ1Pt0=; h=From:To:Cc:References:In-Reply-To:Subject:Date:From; b=UfDt7B7jlzkQcw23lhiU3pMYrmlJEjz+1silfNy33PZJUr8cjyCMP/EdDvDthIPdE MBNJLDDyI5ahLrO+5rwUi7HykRv+wkBAcLNXGPtjcOshcN+n8+Jp8vhWKJd0mddG3T DT6rG0gurC1IO8QPUw3Y0NsZOVyE272avMdY+rcE= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 5481F60274 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=ilialin@codeaurora.org From: To: "'Viresh Kumar'" , "'Amit Kucheria'" Cc: "'Michael Turquette'" , , "'Rob Herring'" , "'Mark Rutland'" , , , , "'Andy Gross'" , "'David Brown'" , , , "'Rafael J. Wysocki'" , , , "'LKML'" , "'Linux PM list'" , , , "'lakml'" , "'Rajendra Nayak'" , , , References: <1526375616-16904-1-git-send-email-ilialin@codeaurora.org> <1526375616-16904-13-git-send-email-ilialin@codeaurora.org> <20180516141132.aqjif7d5motmmnlo@vireshk-i7> In-Reply-To: <20180516141132.aqjif7d5motmmnlo@vireshk-i7> Subject: RE: [PATCH v7 12/14] cpufreq: Add Kryo CPU scaling driver Date: Thu, 17 May 2018 10:50:34 +0300 Message-ID: <017601d3edb3$c0d96d40$428c47c0$@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQGnp1nyG6UZbI+UZ9yYhcbjWitfQAKeDSLwAZ7sm4kCZbuURqRXAqOQ Content-Language: en-us Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > -----Original Message----- > From: Viresh Kumar > Sent: Wednesday, May 16, 2018 17:12 > 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 > > 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 If we are here, then the first dev_pm_opp_set_supported_hw() succeeded. And should be deallocated before exit with error. > > > > + > > > + > > > + 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