Received: by 2002:a05:7412:d024:b0:f9:90c9:de9f with SMTP id bd36csp32491rdb; Wed, 20 Dec 2023 05:39:47 -0800 (PST) X-Google-Smtp-Source: AGHT+IFOsaJzLMe7QeqDNaxiamuWBCXByYDgv7WseKoI6PFi/z65vDWyVxRVubM6DxvCSpgwChhu X-Received: by 2002:a05:6214:c2e:b0:67f:5b62:2964 with SMTP id a14-20020a0562140c2e00b0067f5b622964mr3278977qvd.9.1703079586824; Wed, 20 Dec 2023 05:39:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703079586; cv=none; d=google.com; s=arc-20160816; b=oXN/v2eHLlODpCErkpsB1a7GyPGdeF0C48PU6DilltopJcJ1C4354+eiTbX/cu3Lcm 8MNALQvv8KljXGuABzFyu3HLg8olOsse+A567WGHQ7Hmrv9Ne9ktdMEcD5BZsuHqON9H AsmuntmugzgMJ7KjVEBFtWKb1VXMzoakKnltlp7siw+esnWjfnvTuhzfzVuXk7BpW4oB lN8oHSuQRZb9yUmYr7WSknU62VL9vmqFmV+99t7AUNDKKn8Om9kvNhKw6HuWrvsHKxHV /RJhyQf7Lxl9oG+DGKN+G9u+N96J+0WYm+y6IxagXhuHhZ4daoTxfoi8i2S4y878rWPy 4UxA== 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=9RKLjdsjB7hgv6u3qFnAA9PylVUkSW0jupqWz05QC/8=; fh=mFC8nmckJLq19l2a2JACcOVBANdLlvDzOiUZ3OvRdps=; b=wrdp1p1UujHIDqI6PikBIz3J5pKJ96DWGFBZthZbkXM8XdST0PsTF3rMeX3qRlKizv B37c0votdITWNhjAk/iydCqmB2RLVK49pZXBWG3Vbq5J84/grV3PJpXH0JcH7TtW2YV4 i8iTWQsyiHug6yHw2Gj+zOEDtdp5cnmumr8GTOfZakoI3kpZcIVtaSlwpg8qAQHjevgv bfbC/4UbIflIK4bi9vZJKqW6SJ6lGkz3aiYKwgM9bFRV7SnDYIMpybfFTYzhz+e1wnqf RCUOJoh7A4y0vXv4TtLj38O00WnFhcYQ7CwvKJ/jEdB3US4ONFUHmK/rfj85ZEpeJ0K/ 5m6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=GRg4NWRN; spf=pass (google.com: domain of linux-kernel+bounces-6973-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-6973-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id x11-20020a05620a448b00b0077f4299af1esi29250138qkp.630.2023.12.20.05.39.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 05:39:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-6973-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=GRg4NWRN; spf=pass (google.com: domain of linux-kernel+bounces-6973-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-6973-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 936D31C227E0 for ; Wed, 20 Dec 2023 13:39:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E4EA638DD8; Wed, 20 Dec 2023 13:39:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="GRg4NWRN" X-Original-To: linux-kernel@vger.kernel.org Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.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 ED9F538DE1; Wed, 20 Dec 2023 13:39:07 +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 (m0279865.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 3BKAvffb014606; Wed, 20 Dec 2023 13:38:48 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=9RKLjdsjB7hgv6u3qFnA A9PylVUkSW0jupqWz05QC/8=; b=GRg4NWRNn8VyeXOpRuXDde98fH9kitB53EnQ B2efzR32fg6Lx1w0QlllhKbNQJZJi61qyNwKVxR10oTFkzylqQoAU7hBNFEHPOVY JqipJc0cf7oPyqwIEjOkM+/EgL+/wfPutuHqZzPjQv6oeDN/rPJ8NH9tgzkpa/uG +zGE1khnps3tjs4JAON4ndBRC1phBdDrAo+dinyiA4Ra0y5c445O3wycmRCEde4d eAeAbgZ6lFIm6R9lbk0UUNRR1iL+DmsaYKV5E836wNYkw1co8G7RIGcqeqEASYlE huNqpHBMABwB/woravqZSyDE/R8AuPlwONt02rUGyIX2BSJU/Q== Received: from nalasppmta03.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3v3th6s1kh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 20 Dec 2023 13:38:48 +0000 (GMT) Received: from nalasex01c.na.qualcomm.com (nalasex01c.na.qualcomm.com [10.47.97.35]) by NALASPPMTA03.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 3BKDclLv003562 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 20 Dec 2023 13:38:47 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; Wed, 20 Dec 2023 05:38:41 -0800 From: Bibek Kumar Patro To: , , , , , , , , , , , , , , CC: , , , , , Bibek Kumar Patro Subject: [PATCH v6 2/5] iommu/arm-smmu: refactor qcom_smmu structure to include single pointer Date: Wed, 20 Dec 2023 19:08:05 +0530 Message-ID: <20231220133808.5654-3-quic_bibekkum@quicinc.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20231220133808.5654-1-quic_bibekkum@quicinc.com> References: <20231220133808.5654-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: nasanex01a.na.qualcomm.com (10.52.223.231) 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: 8JgIVXTyZ3EmqpcuIHIpwFl0yibnzDBI X-Proofpoint-ORIG-GUID: 8JgIVXTyZ3EmqpcuIHIpwFl0yibnzDBI 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_01,2023-12-07_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 impostorscore=0 bulkscore=0 mlxlogscore=991 lowpriorityscore=0 phishscore=0 priorityscore=1501 clxscore=1015 spamscore=0 mlxscore=0 adultscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2311290000 definitions=main-2312200097 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 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