Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp519619rdb; Tue, 23 Jan 2024 06:47:24 -0800 (PST) X-Google-Smtp-Source: AGHT+IF3TERfp6cyaYjNqVMyNQPYxk0WT9WqXoAm5tlsur7ccyVPZXXzOnkZXWox5ZB3YK/44/Ca X-Received: by 2002:a05:600c:5409:b0:40e:53f7:243 with SMTP id he9-20020a05600c540900b0040e53f70243mr209384wmb.120.1706021243994; Tue, 23 Jan 2024 06:47:23 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706021243; cv=pass; d=google.com; s=arc-20160816; b=GBtp+tu3DNSBtIGTb8ItsrjcD9dcnRLHJGogabBmONvroU+sH3dcYuoZ6NAIkgPoNA u0XIT9OxdQt4Lsqe3aGeNztNDQ5vBiDqiAiK+gN2w2ql404+NulilJYDV8OSOQq14S+E p6x4y1Jw/XI/APizeKrWnSCTpbytSgymGfbEQyRFBp4Ega0BL+QHbv+g80uB9xDCjQlN dknnxs/uoEhwyH3nzF6+kgeglSx8SuDn0pPpu+lOUanP9JF5skU8Ur9za/mP7vcYRVcM jzl3bjExJZ7C4GAfMY7EsMQ0cW4h3TzsCbns4Z+1JS9fA0X9YwzoW06+XUt5ZduSwYYc TSlQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=DMfQBjrfNczbXPn3AcnVUzt1rdSCcg9fuhCWzFHBvmk=; fh=2b5Hz7/94Zva/HiqXptvJTbobkLgBIeTZr9PwKBsRw4=; b=L0WV0O+dNSMpVjgnteh2v+W7hPnkEEb/Az0GTDhiAt8erIHxqF6CP7QE+B5mTGjWas HjHRNAocQZ0bUBeKJmdY52dcA7KC2snHCOGZdzG+hLIyWnOfjCtVtsVn/KInI0iETxpW ir9o3MnkiskFqXl2zcYGlNgEIcIvYtUyAJ4+SBjNIMgkh0uomYOs21oH9JjkQ1dhx0Lw +Me/1EGoSq60iVE8ZQB6pnRlfM2n1PmT9v9SbrkwKeFK3TrZI9IGKSkOYf/f5vXC9JgE z/Rkw5RbNWf58fnDtH+cXeX1vOqnn3SrSBSFfKF/Lwjf0t5KIOGumiIHTc8RVyXu7Kuj vXqg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=dh6deLTb; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-kernel+bounces-35471-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-35471-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id y7-20020a50eb07000000b0055c2380b660si2631695edp.261.2024.01.23.06.47.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 06:47:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-35471-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=dh6deLTb; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-kernel+bounces-35471-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-35471-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id BADD61F26488 for ; Tue, 23 Jan 2024 14:47:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C099C5FDAF; Tue, 23 Jan 2024 14:46:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="dh6deLTb" Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 929C05FB8C; Tue, 23 Jan 2024 14:46:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706021203; cv=none; b=q9XJi1PzJytPv9hOEcLYe8PK/OveadpNJ+/9K8y0o0pcINdCUvVsiEzI/PGA+asLRoqMZl9XZNSsDWe4xaHjU2g4XGoWNmHHHdvKeNyIpNbtIGuXr2QIozX1k6egxb4VTZFQ+r4EUI1on6q4v3P6/Q7MJJ9M/SIhB3tcFIXWE04= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706021203; c=relaxed/simple; bh=2wkH81LhV0pPDweyKxZ8ELqH2FYnsQa8TT694hlrr+8=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=JLaUqlzMxEoP0DskhPCLRyu+3304nP+3oJDrxIIq6sjliI7s9osJDxl9BKZ8N4h3xr6nbABlx6UC09i8wwRfDvvNb+h0Etx/vNSoVKWkg0d7d2c2N8p8wULGbr9vSNVgD6WFIYT6ryLR1P3mX+d9s5kRFjVLNuHYlGxXZGevDm8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=dh6deLTb; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Received: from pps.filterd (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 40N2sqCb018332; Tue, 23 Jan 2024 14:46:24 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type; s=qcppdkim1; bh=DMfQBjrfNczbXPn3AcnV Uzt1rdSCcg9fuhCWzFHBvmk=; b=dh6deLTbDSesN+iyYMH5+B8BYLt8O2gcHoCA 0HexNn8/b+/Ak76nmbkpDkbxlGR/FYqFb5L1jJeCZsKhs0/y2c33/Oe/Q9z0dR3N SBtgPuOKgiyy3wcyUzv9v66jBETs8oT7ZDoKPlf5xNL3M0Yjit6StpQg/SGACfp/ yJv0/87gXbJ+qZXmx8Z/9Qx5S6RA1/csQkpgRanW4r58xrRIovNKjpNagAcQIliE ERobBFfHthn3EdRMZAZ4XZEyGNJt++Af9bwOjVYlzunJmj76G0XznpJKRHgamY7D lYVD3QeA9YQybNrWCngBb9XpNM0w/IEirpnyFIv2qb4KFc8HgA== Received: from nalasppmta01.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3vt06mj3xg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 23 Jan 2024 14:46:23 +0000 (GMT) Received: from nalasex01c.na.qualcomm.com (nalasex01c.na.qualcomm.com [10.47.97.35]) by NALASPPMTA01.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 40NEkMkc026233 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 23 Jan 2024 14:46:22 GMT Received: from hu-bibekkum-hyd.qualcomm.com (10.80.80.8) by nalasex01c.na.qualcomm.com (10.47.97.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Tue, 23 Jan 2024 06:46:17 -0800 From: Bibek Kumar Patro To: , , , , , , , , , , , , , , CC: , , , , Bibek Kumar Patro Subject: [PATCH v9 2/5] iommu/arm-smmu: refactor qcom_smmu structure to include single pointer Date: Tue, 23 Jan 2024 20:15:40 +0530 Message-ID: <20240123144543.9405-3-quic_bibekkum@quicinc.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20240123144543.9405-1-quic_bibekkum@quicinc.com> References: <20240123144543.9405-1-quic_bibekkum@quicinc.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01c.na.qualcomm.com (10.47.97.35) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: u25yVzlm1Kw6W4FOQpsqv_wWP1ZNIyIp X-Proofpoint-ORIG-GUID: u25yVzlm1Kw6W4FOQpsqv_wWP1ZNIyIp X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-01-23_06,2024-01-23_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 priorityscore=1501 spamscore=0 suspectscore=0 mlxlogscore=997 mlxscore=0 lowpriorityscore=0 malwarescore=0 clxscore=1015 adultscore=0 impostorscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2311290000 definitions=main-2401230106 qcom_smmu_match_data is static and constant so refactor qcom_smmu to store single pointer to qcom_smmu_match_data instead of replicating multiple child members of the same and handle the further dereferences in the places that want them. Suggested-by: Robin Murphy Reviewed-by: Dmitry Baryshkov Signed-off-by: Bibek Kumar Patro --- drivers/iommu/arm/arm-smmu/arm-smmu-qcom-debug.c | 2 +- drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c | 2 +- drivers/iommu/arm/arm-smmu/arm-smmu-qcom.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/iommu/arm/arm-smmu/arm-smmu-qcom-debug.c b/drivers/iommu/arm/arm-smmu/arm-smmu-qcom-debug.c index bb89d49adf8d..e9798b133cbb 100644 --- a/drivers/iommu/arm/arm-smmu/arm-smmu-qcom-debug.c +++ b/drivers/iommu/arm/arm-smmu/arm-smmu-qcom-debug.c @@ -22,7 +22,7 @@ void qcom_smmu_tlb_sync_debug(struct arm_smmu_device *smmu) if (__ratelimit(&rs)) { dev_err(smmu->dev, "TLB sync timed out -- SMMU may be deadlocked\n"); - cfg = qsmmu->cfg; + cfg = qsmmu->data->cfg; if (!cfg) return; diff --git a/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c b/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c index c432e80a69fc..333daeb18c1c 100644 --- a/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c +++ b/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c @@ -495,7 +495,7 @@ static struct arm_smmu_device *qcom_smmu_create(struct arm_smmu_device *smmu, return ERR_PTR(-ENOMEM); qsmmu->smmu.impl = impl; - qsmmu->cfg = data->cfg; + qsmmu->data = data; return &qsmmu->smmu; } diff --git a/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.h b/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.h index 593910567b88..f3b91963e234 100644 --- a/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.h +++ b/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.h @@ -8,7 +8,7 @@ struct qcom_smmu { struct arm_smmu_device smmu; - const struct qcom_smmu_config *cfg; + const struct qcom_smmu_match_data *data; bool bypass_quirk; u8 bypass_cbndx; u32 stall_enabled; -- 2.17.1