Received: by 10.223.185.116 with SMTP id b49csp4044269wrg; Tue, 6 Mar 2018 08:57:45 -0800 (PST) X-Google-Smtp-Source: AG47ELsBKk7UG7jZDeAoOxrzhpqRq1QD0aFkC4WzOqqrtelcJnAc16jDZtvfvbTLly107BfdOLvO X-Received: by 10.101.80.3 with SMTP id f3mr15981955pgo.242.1520355465420; Tue, 06 Mar 2018 08:57:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520355465; cv=none; d=google.com; s=arc-20160816; b=FTf+wke5wpLpAUg3LdqGtiYjC1ghCsakOdYrz+afKaSt6SSuOtfjA5u/d8mJnrCBmi /x5l9jmQ4UZPuvcVKYPDrA5IWTKQ5Ym0062Po4uEvpVezGWoigW73BuRPpojN8sDYjNT Fn6Invm3efdlYc8zP7nPlAn2iXBEO1oMO//IW2tzC0vLpucx+nFTBHfwYgYSX1dBq9oN byHlYjLLMwhkmAIuaV8xMUHICaVOq6IG/AvM6/oa7aQdLB4cPR+XX7s+ZwvfD/zsccF6 kPrYctYbdiFIAA8c+EY2iDhUYaOx+1qKgClSFO7Lczt7ShOWtENj7GtuxLITJCIQ9y1v tKQA== 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:dmarc-filter:dkim-signature:dkim-signature :arc-authentication-results; bh=KlKvi+Fbx55ODVy1eDr2ZZ1NIONfnvXKRWRkryfwEVU=; b=dVn0mpi53u7ZI1XTggrqT+lwyICYwEc3cFiuZYxyuT2T+NP8He+cqyp9J+M1teiz1Z kqf3W3MyQ5rA1W/iVGgPU2sBvg8xyampDNq5x9/wmklCXUwst00y5753xLvbn+oKrJ6k IkUg/QGlL2rR0qAJyiaai2fOKZEBKVPDgvgKaO75VTXWSpta6WAdi3LYLiyoifkjo9DM Z/mYtGKFrEfw/LjzgT0AnPkA5QPAsnaeNpRh+9Y1Lhi4Ziqsk3GuYlDeP8rLCtrhtBSD kBTT5QkAvVZqkf86dWQCRcG48xt3uacsXmJKN7xTxcFsVi1TMycT9K6cJMVe6Pu6Ddu/ 9DaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=nZlHikof; dkim=pass header.i=@codeaurora.org header.s=default header.b=nZlHikof; 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 r1si10061008pgq.305.2018.03.06.08.57.30; Tue, 06 Mar 2018 08:57:45 -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; dkim=pass header.i=@codeaurora.org header.s=default header.b=nZlHikof; dkim=pass header.i=@codeaurora.org header.s=default header.b=nZlHikof; 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 S1753902AbeCFQ4W (ORCPT + 99 others); Tue, 6 Mar 2018 11:56:22 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:44346 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753849AbeCFQ4U (ORCPT ); Tue, 6 Mar 2018 11:56:20 -0500 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 698606043F; Tue, 6 Mar 2018 16:56:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1520355380; bh=YKWkv2JtTmb6FErM+mX+dctog/5ISxvgsi+29XGmwRI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=nZlHikofJnay1t04WEWNHmBQNgXVbzWUYQy8vVmzuAWdRlKxH9JF1PlGH1S/hi+Rz 7z3/I54f9J4GlJcQqq5rMGn2uBmvANPwJFKIU3TEewkrcrT0NrokKSVnF53D2KX1fU /N0eyxXcISymvpgsB6aRQuyDpkYsgc6/4cz0shfo= 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 localhost (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: ilina@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id E2D586016D; Tue, 6 Mar 2018 16:56:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1520355380; bh=YKWkv2JtTmb6FErM+mX+dctog/5ISxvgsi+29XGmwRI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=nZlHikofJnay1t04WEWNHmBQNgXVbzWUYQy8vVmzuAWdRlKxH9JF1PlGH1S/hi+Rz 7z3/I54f9J4GlJcQqq5rMGn2uBmvANPwJFKIU3TEewkrcrT0NrokKSVnF53D2KX1fU /N0eyxXcISymvpgsB6aRQuyDpkYsgc6/4cz0shfo= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org E2D586016D 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=ilina@codeaurora.org Date: Tue, 6 Mar 2018 09:56:19 -0700 From: Lina Iyer To: Stephen Boyd Cc: andy.gross@linaro.org, david.brown@linaro.org, linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org, rnayak@codeaurora.org, bjorn.andersson@linaro.org, linux-kernel@vger.kernel.org, Mahesh Sivasubramanian Subject: Re: [PATCH v4 1/2] drivers: qcom: add command DB driver Message-ID: <20180306165619.GD4930@codeaurora.org> References: <20180226175802.20052-1-ilina@codeaurora.org> <20180226175802.20052-2-ilina@codeaurora.org> <152027534725.108663.13213325833387672227@swboyd.mtv.corp.google.com> <20180306162140.GC4930@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20180306162140.GC4930@codeaurora.org> User-Agent: Mutt/1.9.3 (2018-01-21) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 06 2018 at 09:21 -0700, Lina Iyer wrote: >On Mon, Mar 05 2018 at 11:42 -0700, Stephen Boyd wrote: >>Quoting Lina Iyer (2018-02-26 09:58:01) >>>+size_t cmd_db_read_aux_data_len(const char *id) >>>+{ >>>+ int ret; >>>+ struct entry_header ent; >>>+ struct rsc_hdr rsc_hdr; >>>+ >>>+ ret = cmd_db_get_header_by_rsc_id(id, &ent, &rsc_hdr); >> >>A bunch of code is calling this function. Why not change the user >>interface to use an opaque 'resource' cookie that we can 'get' or 'find' >>and then use that cookie in the rest of the API to pull out the data >>that's desired? >> >Fair point. Let me find out. I suspect this was done to keep the API >similar to other non-Linux interfaces. I am not sure why they all didn't >use a handle instead of char *. > I was reminded that the APIs are generally used once for each resource and are used for multiple resources and usually only at init. The handle method doesn't buy much in benefits. -- Lina