Received: by 10.192.165.148 with SMTP id m20csp246027imm; Tue, 24 Apr 2018 21:40:02 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/Qw/ChMAE+8ZR2EIkhlVHODZWHmS/SrCw0ijmw8P+oQD6WdsXR5no9jeVO95NrJ2ZFG1ny X-Received: by 2002:a17:902:ba94:: with SMTP id k20-v6mr27761358pls.193.1524631202164; Tue, 24 Apr 2018 21:40:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524631202; cv=none; d=google.com; s=arc-20160816; b=LFI8FxRxmLPbitECTKLPvDeq6CsV3+pd/U2KCY4U5Nbj9eiPq5jQNDmEBBdNqafKmt i3hE7HOijAgr984+DgwlY+0yuz7xiG2aban5TC2ZIYUyNcjUDwswkVolUmJGuOVsf8KL M2wu02gSCYPz9DuZkWb4Nqx20uhDVtLq0E1RdQq2P5TUhynDBMaXs024Y1DJDJiFyPgv XHPkHez+SDvEyOThSa53uAVvvdkqAQugCgZPz25zRQbHWUfPfx/ZtGmZD4vZBg3sxSaH P3x0p3OmI/4Zqn+8Oh01/2JpMZEJ3PFKlkYm+OMPPWvMKrCbFEX7UlvTytzaI4bxfBc2 PcCA== 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=5+OumAAlhMYjHKuM/W90GlJci1JCBtZsKKGK8Y9lvds=; b=RPL9/Cqax2TP9HQT1kYnng3HEa/Pvr+f+j4M1R8C+313OpMb71owwNWiqi3e0vIDm+ YyXgUPx81Irk7eazpCZIbjqHsKNPEG+JrA4oFZQzWGzpC2Z7Lbyo+oJGEDCX9jlfv1K7 jP413bciJ5lBvVmL5I7Z1utRxcOHQtEDvWCcdkvut4z7sdCiRKaMVEBXFCitjgWQhGNE GxojYc0fvXwITz4QoIJpZisxvPlPiDc5Bqz8n6P/gmmaiCVaf81UHuPD6aIPsxDfR/KG W1CtFUvDhqBCDxjomSUJ3kZHV1HjL5RXZDCLVbERP024e5c7mbhCdsCqVcq238Hb1VuC 2VZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=cnFVk7zk; 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 l15si10680360pgn.414.2018.04.24.21.39.46; Tue, 24 Apr 2018 21:40:02 -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=cnFVk7zk; 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 S1751229AbeDYEim (ORCPT + 99 others); Wed, 25 Apr 2018 00:38:42 -0400 Received: from mail-pf0-f194.google.com ([209.85.192.194]:38753 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750962AbeDYEik (ORCPT ); Wed, 25 Apr 2018 00:38:40 -0400 Received: by mail-pf0-f194.google.com with SMTP id o76so9405643pfi.5 for ; Tue, 24 Apr 2018 21:38:40 -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=5+OumAAlhMYjHKuM/W90GlJci1JCBtZsKKGK8Y9lvds=; b=cnFVk7zkJrFg9SkqfP5QfXGCFBYlpQ0m7eWtdfOGrR2GkSCGPxaz7KXoDyI4Q8nLrh ZTtyfX6slS2ZQIaKaF0Rws8YCBVFGBwKU5Q3tthghrxJqO977O1RYjO7+OY/leR0//LQ Gyi2LnUTIzVsLGrqFx8OBv/vIK0nr79ypGUc4= 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=5+OumAAlhMYjHKuM/W90GlJci1JCBtZsKKGK8Y9lvds=; b=gLIFDXGOP9tvSQ5dC6qE8PwBOfbzMOnI0KxyB1CvSpeVvmh7JivZ1M4eE/3X1ngxdU tykY39zsy+mU9EPBX/ypyf+bG+r68Lz2olU95QSX660beTPk9Tf/f/OHscSI/WrNfoQd HmwQOmmbstrqMJSlZ4KGYXRU236R7TqZlYMaX4d4xKBU7oDrWztGiB9kgMDPrLM1ooFn 7Uhd8UjGSCxuH45X+chc8zuPd4s2skQbSgw+eAHxyRbMeOKMbXptTeW7BYr75GcOaDrY q2ZxRqsj74Wt8A8oTUszRmXN2xXbjcPO+nB+pnTA5hCR30NpcrBkkIryLQxX54ol0+hm t37A== X-Gm-Message-State: ALQs6tDRz+HzlEl+0rzCh1nUhKcJE0waDPtleHwhsQ1CoVzmB6J7Fx4s 5zAz/JE6l62VDyIBwj29NPEU/g== X-Received: by 2002:a17:902:8f96:: with SMTP id z22-v6mr27401949plo.200.1524631119677; Tue, 24 Apr 2018 21:38:39 -0700 (PDT) Received: from tuxbook-pro (104-188-17-28.lightspeed.sndgca.sbcglobal.net. [104.188.17.28]) by smtp.gmail.com with ESMTPSA id j74sm5810717pfk.25.2018.04.24.21.38.38 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 24 Apr 2018 21:38:39 -0700 (PDT) Date: Tue, 24 Apr 2018 21:39:48 -0700 From: Bjorn Andersson To: Alex Elder Cc: andy.gross@linaro.org, clew@codeaurora.org, aneela@codeaurora.org, david.brown@linaro.org, linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/6] soc: qcom: smem: return proper type for cached entry functions Message-ID: <20180425043948.GF2052@tuxbook-pro> References: <20180410222542.29474-1-elder@linaro.org> <20180410222542.29474-3-elder@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180410222542.29474-3-elder@linaro.org> 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 On Tue 10 Apr 15:25 PDT 2018, Alex Elder wrote: > What phdr_to_last_uncached_entry() returns is the address of the > start of the free space following all allocated uncached entries. > It really doesn't refer to an actual (initialized) private entry > structure. Similarly phdr_to_last_cached_entry() returns the > address of the end of free space, preceding the last allocated cache > entry. Change both functions' return type to be pointer to void > to reflect this. > > Meanwhile, phdr_to_first_cached_entry() really *does* point to a > private entry structure, so change its return type to reflect > this fact. > > Signed-off-by: Alex Elder Reviewed-by: Bjorn Andersson Regards, Bjorn > --- > drivers/soc/qcom/smem.c | 8 +++++--- > 1 file changed, 5 insertions(+), 3 deletions(-) > > diff --git a/drivers/soc/qcom/smem.c b/drivers/soc/qcom/smem.c > index 7f38c5e11440..3102aa94aec2 100644 > --- a/drivers/soc/qcom/smem.c > +++ b/drivers/soc/qcom/smem.c > @@ -280,7 +280,7 @@ struct qcom_smem { > struct smem_region regions[0]; > }; > > -static struct smem_private_entry * > +static void * > phdr_to_last_uncached_entry(struct smem_partition_header *phdr) > { > void *p = phdr; > @@ -288,7 +288,8 @@ phdr_to_last_uncached_entry(struct smem_partition_header *phdr) > return p + le32_to_cpu(phdr->offset_free_uncached); > } > > -static void *phdr_to_first_cached_entry(struct smem_partition_header *phdr, > +static struct smem_private_entry * > +phdr_to_first_cached_entry(struct smem_partition_header *phdr, > size_t cacheline) > { > void *p = phdr; > @@ -297,7 +298,8 @@ static void *phdr_to_first_cached_entry(struct smem_partition_header *phdr, > return p + le32_to_cpu(phdr->size) - ALIGN(sizeof(*e), cacheline); > } > > -static void *phdr_to_last_cached_entry(struct smem_partition_header *phdr) > +static void * > +phdr_to_last_cached_entry(struct smem_partition_header *phdr) > { > void *p = phdr; > > -- > 2.14.1 > > -- > To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html