Received: by 10.192.165.156 with SMTP id m28csp130211imm; Tue, 10 Apr 2018 18:05:36 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/lhySLoV9/n6R4N9wRY/n7P1t3BXi22kkYpyJeEsnoZjxsmKebHT43OdipffuJmxoX05m5 X-Received: by 2002:a17:902:20ca:: with SMTP id v10-v6mr2771101plg.9.1523408736827; Tue, 10 Apr 2018 18:05:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523408736; cv=none; d=google.com; s=arc-20160816; b=XZ8eEUvodcMVBn8jRfbnLaGlGMM4KzNtsGeK8wFf23UuKSI83ECu6OOOI8MFaIAac0 MH7LeHcOdinbcsj8MTPX4S5uHSyNN9ARt8KZ+c6uQoHjSfq2ozyTgysFIIw4VEld4E+c kxaR3Y393bO/tEwFlLy9hsmiFoOwLfk3KyPTps5nS6XTGF8zZg4yUVgIwF+Y7qkytcCb 1zU7m2BmvgG3mLRMxo48CMuIfPAn+620fVlAKf4f6ti621qYSAvL4wmb+KsxWCa86jUK CcRT9bReAfgdSGOc/iR4dB6QYxYr9NIOjO3veBrd3GKVIDVzSD8Wszc9Ex+A1ub7XeYO i0sw== 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=gut0PH2awWfpSIs5ubLPbt5sMj/sysSYnqY40nzMmsY=; b=OPaojPPEnf4DRhWHf1Wlvq3g8fcmaSKTKHUFbhMLbAvI/8AFfqj0J+6sPbZGgW1Nok KqkssLA5WPD2eniOBNyD6Q1aV5HlGa6Fdc6gd+NAy98YKWXLwCdr7FbXka7f3W7fgesV 3Fn7r9DuS72gGUttwR0L+GqzUia+2InqyQr1ZpKrr94SqPa3i8tvoPl6VzqkT9sFPNnd MWV3EdzNMp9R1/DuDOyhZLZQ2adTZT58N3EqWIXHdFKLtQvfZKBJGsRqEU5HFPngMazR p3n9kO1V0XHOrTbLv2efa9C/syDlcPObhTDboTEMg+2rSUKVplzf44xDakfeWwVMiRXH hOZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SIkGHI0b; 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 h91-v6si3743924pld.716.2018.04.10.18.04.58; Tue, 10 Apr 2018 18:05:36 -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=SIkGHI0b; 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 S1753797AbeDJXnz (ORCPT + 99 others); Tue, 10 Apr 2018 19:43:55 -0400 Received: from mail-it0-f65.google.com ([209.85.214.65]:55763 "EHLO mail-it0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752990AbeDJW0I (ORCPT ); Tue, 10 Apr 2018 18:26:08 -0400 Received: by mail-it0-f65.google.com with SMTP id 142-v6so256898itl.5 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=SJEfu7yrnHZpLkrL0SbjXfIJ1vojWrk4WZaDI3g2WWPdJfxLX7u/hMBUhQwX5kV6JM 2gjPMMPqcsJcx9ILEk6sNZfqvaBQMyQ+R+NWMqsvK0ga5nsZWlTS8w+tS7ZY5Q5Mcrgk QGrCKvpugokmroVZYVx71q5SIJHm0HF2mbHfCTjOu7iapAhW5K2uenNg0C5MZLIQcWlJ shP+giTZ5LD/NqALk54UfkEbnTsO4nrS5A5bH0FHiCjaN8ETWR0GFO43RRDutMymTyGP AHHhx4XT2weOi5rkrmuHAzKpVFAZLBwyBrLWVKwTYLY27zk4gVEYkKRK84sfabVIQqFQ 5IDg== X-Gm-Message-State: ALQs6tDq/67ImLcryuYYo1Vud9iTx6x3HEOJBO72haB56qVBXq8MeY6F CuqxbypyO5hMB7EGN9m7en2uAg== 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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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(-) 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