Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp267931rdd; Tue, 9 Jan 2024 03:44:08 -0800 (PST) X-Google-Smtp-Source: AGHT+IEJBCe8oO2j4yJazweSUo/wX3RWd97S+wnoDyReynNEmO/zFyV0pfgOdy9hcZs9M+O+frwJ X-Received: by 2002:a05:6358:3a1a:b0:175:5c8c:3ab with SMTP id g26-20020a0563583a1a00b001755c8c03abmr5017772rwe.65.1704800648513; Tue, 09 Jan 2024 03:44:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704800648; cv=none; d=google.com; s=arc-20160816; b=J488CyoQaBjpfAmBmiMbRyur3gm4vXneBX5NZ1DGafOPlzprzO044BsckPx8sV2cf6 CHTHGqqUn+FfTULyFiWKMLm2/94pB7YO/3rg/32hrBhT+e8iXn++S5cF561GCDKHyFW+ 1yNEWDQgNpYQn3iziDFaYbkfzIxDaWSjG2qPauWZQoHmeL2ATxbF813eSigNy4ZOfuAW ysrhQ/Ho/P8li0hF3wuff6P+EC5c8prbqyJrqwLdlfpxQWX+tITekw5TB7RvjWXiRXNA Ju6l79X+kqfgivEO3/C5N7cT8MLj2P3ni+8V4QWUoIgkJAO+ydsbsSElh2sIq+Hp7Cma 4bYg== ARC-Message-Signature: i=1; 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=2uYPt1Mjas2C8Qolx1Fa+U+4guFWgWwraDUiXDrYhuM=; fh=mFC8nmckJLq19l2a2JACcOVBANdLlvDzOiUZ3OvRdps=; b=DlQ63RnnPGaQAnapBF/OheMfSewW3BexvigzJ3hxV3OJVB7vAQvg3jK9Iw35+hee4I +jwT2RckfInVscjEkDi9VHnht8SmNlZns6yzhV75UXx0t5lKiaeEUPeKH4elWm1RrfF+ vEdMy2XPnhDgp564/UDEqD0IP2rNeu6SQWWN6Kjg5Brsst2G9m3RdtF3UOHFdMskPmZk QY5igJJZ5bFspDnMKzwbr8XVvl+zeXOU9oFpUYNW3PuGVJV/fBkor1qembvy0JnK9hS9 tY7b+AAiAZEsvAhisuPjeyvYgp2/YwKdHk3Q4RC3M36qb8/3+W5fffx3RHwTGItbZYHg xgrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=MEpxqWtf; spf=pass (google.com: domain of linux-kernel+bounces-20792-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-20792-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id n15-20020a63ee4f000000b005b96c2ab110si1294105pgk.131.2024.01.09.03.44.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jan 2024 03:44:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-20792-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=MEpxqWtf; spf=pass (google.com: domain of linux-kernel+bounces-20792-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-20792-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id D90EBB20C27 for ; Tue, 9 Jan 2024 11:44:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2D95638DDF; Tue, 9 Jan 2024 11:43:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="MEpxqWtf" 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 16164381C9; Tue, 9 Jan 2024 11:43:12 +0000 (UTC) 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 (m0279871.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 409AMavu017030; Tue, 9 Jan 2024 11:42:55 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=2uYPt1Mjas2C8Qolx1Fa +U+4guFWgWwraDUiXDrYhuM=; b=MEpxqWtfkCDk59BVOqw6QIYHOIBvekYcIEdz gdpSo2jp/8z/C87YJ+WZeLIAfIeYVvHc30EU9inyRIU92Zdmnzkd8Gq8eDIFfkxp iFHR3wznL/13ad+wC+5Q3QEe12mob33PchwJulJEG6zvckRc1VrKo/MZBosx0t8Y GrIKSBuDHUSsSD7xJD4wpVo5ScoHgr1hR4yAUPkW7CIy1kDFVqWXih3BOdoj/b0A PzDM9f3tsoRXEWHclRq7cHkNATg0IXRqivDVpWs8zh9FLzX9gygpn1jpvWGgcMi+ rVovRGzSKm/HoMZw11BQiTk+gN0mB8Z66XT767vbpkchVCX3tw== Received: from nalasppmta05.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3vgwsjrvtx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 09 Jan 2024 11:42:55 +0000 (GMT) Received: from nalasex01c.na.qualcomm.com (nalasex01c.na.qualcomm.com [10.47.97.35]) by NALASPPMTA05.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 409BgsUh029796 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 9 Jan 2024 11:42:54 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, 9 Jan 2024 03:42:47 -0800 From: Bibek Kumar Patro To: , , , , , , , , , , , , , , CC: , , , , , Bibek Kumar Patro Subject: [PATCH v7 2/5] iommu/arm-smmu: refactor qcom_smmu structure to include single pointer Date: Tue, 9 Jan 2024 17:12:17 +0530 Message-ID: <20240109114220.30243-3-quic_bibekkum@quicinc.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20240109114220.30243-1-quic_bibekkum@quicinc.com> References: <20240109114220.30243-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: zCm6qPU325hinPANMrBlzmTlBru-Nxuo X-Proofpoint-ORIG-GUID: zCm6qPU325hinPANMrBlzmTlBru-Nxuo X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.997,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-12-09_02,2023-12-07_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 suspectscore=0 lowpriorityscore=0 phishscore=0 priorityscore=1501 adultscore=0 spamscore=0 impostorscore=0 mlxscore=0 bulkscore=0 mlxlogscore=999 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2311290000 definitions=main-2401090095 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 000e207346af..20c9836d859b 100644 --- a/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c +++ b/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c @@ -496,7 +496,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