Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp394416ybl; Tue, 20 Aug 2019 22:33:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqz5kUW1S8AeI3cgr/6w4r+HGbv9dNLWBRwPWR8Ti1bG4/FfDBM8tl93PyviZgZ6i/dkSM9c X-Received: by 2002:a17:90a:6d43:: with SMTP id z61mr3662671pjj.32.1566365595611; Tue, 20 Aug 2019 22:33:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566365595; cv=none; d=google.com; s=arc-20160816; b=Q0ylWfNqJ2wTZHUKCAGK6uK57G3YC1ERgg6D7pIr+Eklg0Puu4qtiU7HJoPyzRdxe5 nuM6lqFhIXaBWMsVv8LXo37zkYmF3VdG0YJm0yimabE/FoXkI6EbGyzWFgGBtk2tUbLy G+olODFv4i97ePZO1xCvdlDgUru9kVfQm7CHSdW4KxtWIS5qzkYF9outkmSuZlxtN3vM ub147pADbCQNMYJR8M8bmTU2USuW/ZwUpMIAUyYLWnOl1xclKajjFOCm1c9sO02BtD7U AKz66A4bPhYrAhOSsDAk8G1cTXK6WZPgSv/nsOsvxvSuqwo2XgOKK3kEETmj9J7rZwOz mpRw== 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; bh=AbgNFdtNiAHc3P9dNg3Cl9n2STrQ5D8oYPMR42M6k4o=; b=HGvr4fkNn+bFAbdNpsGObUu/3QzNkPCjhktrvyJVyf4j7RjQYsP69+xZnQehmqab+t fMYOWtB8UcdgJwW0vhzpCjChJTea1VzfMvoeJX73A05hKy7P0ZnfcaAMM/eX7vO9AvoO hZJdYID/Jq585lJXHPTiCV7NBzx+VkonnBujZ6Jci6iImy+QhxwTjzyh5kvab/x9TUmc 7TkBC4AWk7daPY2mZ30OIm4U5P8yiI6aKHvZ6WNFOeFFJef5RS+staDanBy1Jmo360TE KxpEZPUlDPXsGjC5dbS495dVZne9fhK6um4+Uwmybd45gns7KdORvBNpQhvmW7tNYfIm X3UQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=g89urCuD; 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 b6si13641028pge.44.2019.08.20.22.33.00; Tue, 20 Aug 2019 22:33:15 -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=g89urCuD; 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 S1727839AbfHUF0Z (ORCPT + 99 others); Wed, 21 Aug 2019 01:26:25 -0400 Received: from mail-pf1-f193.google.com ([209.85.210.193]:37145 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726409AbfHUF0Y (ORCPT ); Wed, 21 Aug 2019 01:26:24 -0400 Received: by mail-pf1-f193.google.com with SMTP id y9so271731pfl.4 for ; Tue, 20 Aug 2019 22:26:24 -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=AbgNFdtNiAHc3P9dNg3Cl9n2STrQ5D8oYPMR42M6k4o=; b=g89urCuDkhMGyZzEXrRZ37obKQXCa1XnlXt/Hk6+A6ohfMQnchNzu0R4bXKm9QgvFf /R09pOzrLs7VDW143XnAO9DrtBPp6CPSLBBXKYVhe9E6XevH/qMnrRdlnrtkKSbxz/Xf MxyXcENFbtESYyodxxTLAaYsDjgiymLW+s1mQO5Ii1UuzdptKI4CBIIyNIIPWZ1dJV6C X47cpnU+VMbC2xW762i8bjEAvX/hJBT6Pngaq/8/NJaw5mSzrUdMRtedkZZzbc70rr8G GkwPMZYC7DXMU28a/q/8NRp2p6wzZelT/XogjlYTUiWdbSRz7VOlnxchLAvWnKflSqey 4vDg== 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=AbgNFdtNiAHc3P9dNg3Cl9n2STrQ5D8oYPMR42M6k4o=; b=CKoLBR+jXaEIMmFKNMltJCKyJ4HMUOiHh6cnYphF+RR9o2wfqEMxE1MNnDKKKpLou+ FU3GdmoLCOSs+P+W5PwhwnbvJLGVd7xihvNzKlma/qiTirWcLQz0uVodH6XjNdeoRj4r VBvuMd4nnXmi0cMt0bUmWXn++1GU9KrnxfrG+mkzX5yH46aF9r6L727w5WCVcIOqHIyW idLI3rfsdpY9B9PIEqOY1dj/oycg99csKtWA8K3ODTaw2qIcXYU3frwI7VPIJJ96nrEB c5mcngn5reBcNX3sUbABv658MdGwPjVoNkUtOSNbaHjdPUqGOJzhwL3oOjiBpqD02WH/ XOLQ== X-Gm-Message-State: APjAAAUgk4BXiVdzCdGPBzf9xiGHEzS7TI4t20kownIh53aF4AwkTIVh 0HLEObcD4WUgFZUJYoRpcb8isw== X-Received: by 2002:a17:90a:d146:: with SMTP id t6mr3636385pjw.76.1566365183880; Tue, 20 Aug 2019 22:26:23 -0700 (PDT) Received: from localhost ([122.172.76.219]) by smtp.gmail.com with ESMTPSA id o67sm16966864pfb.39.2019.08.20.22.26.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 20 Aug 2019 22:26:23 -0700 (PDT) Date: Wed, 21 Aug 2019 10:56:21 +0530 From: Viresh Kumar To: Saravana Kannan Cc: Rob Herring , Mark Rutland , Viresh Kumar , Nishanth Menon , Stephen Boyd , "Rafael J. Wysocki" , Georgi Djakov , Vincent Guittot , "Sweeney, Sean" , David Dai , adharmap@codeaurora.org, Rajendra Nayak , Sibi Sankar , Bjorn Andersson , Evan Green , Android Kernel Team , Linux PM , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , LKML Subject: Re: [PATCH v5 2/3] OPP: Add support for bandwidth OPP tables Message-ID: <20190821052621.ftvxivls6tdf6vnx@vireshk-i7> References: <20190807223111.230846-1-saravanak@google.com> <20190807223111.230846-3-saravanak@google.com> <20190820061300.wa2dirylb7fztsem@vireshk-i7> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180716-391-311a52 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 20-08-19, 15:36, Saravana Kannan wrote: > On Tue, Aug 20, 2019 at 3:27 PM Saravana Kannan wrote: > > > > On Mon, Aug 19, 2019 at 11:13 PM Viresh Kumar wrote: > > > > > > On 07-08-19, 15:31, Saravana Kannan wrote: > > > > > + ret = of_property_read_u32(np, "opp-peak-kBps", &bw); > > > > + if (ret) > > > > + return ret; > > > > + new_opp->rate = (unsigned long) bw; > > > > + > > > > + ret = of_property_read_u32(np, "opp-avg-kBps", &bw); > > > > + if (!ret) > > > > + new_opp->avg_bw = (unsigned long) bw; Why is this casting required ? If you really want a 64 bit value for bw, then make it 64 bit in bindings as well, like opp-hz. And then you can simply do: of_property_read_u32(np, "opp-avg-kBps", &new_opp->avg_bw); > > > > > > If none of opp-hz/level/peak-kBps are available, print error message here > > > itself.. > > > > But you don't print any error for opp-level today. Seems like it's optional? > > > > > > > > > + > > > > + return 0; > > > > > > You are returning 0 on failure as well here. > > > > Thanks. > > Wait, no. This is not actually a failure. opp-avg-kBps is optional. So > returning 0 is the right thing to do. If the mandatory properties > aren't present an error is returned before you get to th end. > > -Saravana -- viresh