From patchwork Tue Apr 10 22:25:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 133127 Delivered-To: patch@linaro.org Received: by 10.46.84.29 with SMTP id i29csp90709ljb; Tue, 10 Apr 2018 16:43:31 -0700 (PDT) X-Google-Smtp-Source: AIpwx49WXW1/y/DKyy4iA9OC852j4W42F0IUYzqJR/yVsvbC+UB+ucCq3be3iyxwBBavh4tpOY6F X-Received: by 10.99.43.80 with SMTP id r77mr1676302pgr.193.1523403811010; Tue, 10 Apr 2018 16:43:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523403811; cv=none; d=google.com; s=arc-20160816; b=MnpUmVvyAsMTwk7V8QT+0al7WVy3XXohwpUKYCEsCJRV+HHZehzpS0Bwiyrb42NEw1 zmvWmieMp1P+xDtmti8gY3klJiM+2sTLa6OtrHSvyf8yBb+nfVTTm4i1yqWIMphwqDXl da/su9qfR+unI4ChJC3k7rO7yu5cqeiLPMB2e6URrgUZKJWcwbRMbZ/xHDsfWv4AieoN cPweSXACECT95QUfWRw94AoafUVTobBQpLKWjiKytpFFFHy2WvhHvb+lmMJdMp6yOUvI 4qaXMWnN4TVwukdTA+KkqRIpkZB9M4rV/m9mxCnfRdt3MiTCnSu8UfEtRpXAe3tsjMyp 4q6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=PQb9LvH+x5+Hy7WvGsZAp22qBtd4/tqEzYY9J24Zf2w=; b=bfb/ATkighFUDmjdXMvTpoVYOVxYmqmJqJJql1Frn6nJ+PmSPOYEICF99XErgOwEgo ZIdWM1Ob+Wup+AjodSWOjbpw+AFtAqJTLiio/ce46OOWQ+b91TSYI3VdKiIL0FqrQTIQ wBnJ77Kr6TGNN01BKklmK7frBttQGgAqgCRo7RWSTV8/nFzkj4+A8CBRv6sTbV7id1+7 MkaAJ4TBRn0dDnF9FHxTmrcZfGlh7tKO8rIwThK0OD5HPKQ7XIMEAO+gkBmxURSOHpLE C/Vy2zngsVdqj65tTZgAS1ATcBJ2f/Hz4nqNEh4EK/3Uv/RAfn5a3FYuovx7nSzYrhr6 NHQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=SIkGHI0b; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (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 o2-v6si3577878pls.161.2018.04.10.16.43.30; Tue, 10 Apr 2018 16:43:31 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=SIkGHI0b; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754673AbeDJXnX (ORCPT + 11 others); Tue, 10 Apr 2018 19:43:23 -0400 Received: from mail-it0-f65.google.com ([209.85.214.65]:52155 "EHLO mail-it0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752995AbeDJW0I (ORCPT ); Tue, 10 Apr 2018 18:26:08 -0400 Received: by mail-it0-f65.google.com with SMTP id b5-v6so288313itj.1 for ; Tue, 10 Apr 2018 15:26:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=gut0PH2awWfpSIs5ubLPbt5sMj/sysSYnqY40nzMmsY=; b=SIkGHI0bYMQinXHxhoL00czcoSlVEhDX9vnWCISPotmIDDZrEPiMrAcH7r4hJGsdjX ekQm665K1qVN/Ul6O9KdqQJtMBstccdFZFfL26tPCGcvWVR7u3MN68X8+AK5yaqK4ggq ioSIBD8IWsrSNrXMGn+le0+IMhJFCMvfVqbv0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=gut0PH2awWfpSIs5ubLPbt5sMj/sysSYnqY40nzMmsY=; b=RIM5izXu4GXRXL/zHpQXhn7nb4UcCTnxloQ3GCI41VtwybnGHrsewulroGTow2nxmL gOmToJgzjw77MssENd2ZGb6kA+7I3gJFEys9uWTiwuk8kZT/VOOjHG6xR43rbuSSc70p fyCTJ3VFApnDFGLkzDS49PwQnvEFFHTbGWbd9iP2r6Dtb87QopUQYFG4DeP+MTGVFl2G nkwqHLnKb8KASdBtfvR+saKxZ2yqFdqJnr4xLb2gSjA9lO1yLUduDBZiQo2ghM6F0aCV 1/esEthcDQEsiawc144JizN7q6roXH/AEILYF7jHOL8at1RSx9KZdzaEln22l+nu3QC/ efng== X-Gm-Message-State: ALQs6tAIeRD8XwqhWEKq9fcOiHz5GO4MvX6UP40ELTEFARSYdZb+T+dR kDOjFlXq50GdbGhA4QYq94ABLA== X-Received: by 2002:a24:b911:: with SMTP id w17-v6mr1507855ite.12.1523399167933; Tue, 10 Apr 2018 15:26:07 -0700 (PDT) Received: from localhost.localdomain (c-71-195-29-92.hsd1.mn.comcast.net. [71.195.29.92]) by smtp.gmail.com with ESMTPSA id l16-v6sm1373640iti.18.2018.04.10.15.26.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 10 Apr 2018 15:26:07 -0700 (PDT) From: Alex Elder To: andy.gross@linaro.org Cc: 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: [PATCH 2/6] soc: qcom: smem: return proper type for cached entry functions Date: Tue, 10 Apr 2018 17:25:38 -0500 Message-Id: <20180410222542.29474-3-elder@linaro.org> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180410222542.29474-1-elder@linaro.org> References: <20180410222542.29474-1-elder@linaro.org> Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org 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 --- drivers/soc/qcom/smem.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) -- 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 Reviewed-by: Bjorn Andersson 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;