Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp6571647rdb; Fri, 15 Dec 2023 02:20:11 -0800 (PST) X-Google-Smtp-Source: AGHT+IHg6t1on93PWivgJ7i9zflBOngM1b8pG+xGph33uedXtPpALB0KNI/GNvtyKoCa8Gp0J2aa X-Received: by 2002:a05:6214:27c6:b0:67e:f470:d21b with SMTP id ge6-20020a05621427c600b0067ef470d21bmr7400388qvb.62.1702635611191; Fri, 15 Dec 2023 02:20:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702635611; cv=none; d=google.com; s=arc-20160816; b=xIGe4vTEb6HRgS+O6a5ZzrDBZBKelbKUnUaeTi5mMRAk4cSZOoDFtMh9oWpBPJKtSA r3kTqrUXCG6CNjaAe8QqFGrb7nhvuVW4awXQbRASx7FMizOdYx64MIW0zuba/hv/E/ua +VBT6w/TCX5v1y2R4oCNOJtnCfI1TnXtnxvu8UAemoKc0gZYGcbXyW87pDlME+n28Ig3 w40qDpAXqKs0R03f+s7va8R9Epm0roSgp17eqjRzJk8y1v+mfFncGmErihLYC9mOIPjA xGTDUltx17SgLzCgw3iBPAf2tDNS24CJAregxZi1uOgV3yRVYVWBCIsyuyD1oykDLrry bBKw== 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=Cyuy5K1/eJPUo/RtECMiX6Lsj6sa60ojM0f9F7kHHXg=; fh=mFC8nmckJLq19l2a2JACcOVBANdLlvDzOiUZ3OvRdps=; b=qKR+4rmtDaH3YE6cIsin+mAgolREYB7z6GJtV0Pfww6mWjzQBEd9h1XmF+aRlZ4seD +7JMxeLMQ6GFt3cYLhRkl8QtbFBF3VyMuyP7nMBY7cdD+fTZW5aXTj4SKliFVgwMXBNm pzKhuYgoo3z07wwzaXhsF/VEYcqnzZAXeVUs5DD5UUujKuNViqkX1/LxgjLoYmXA5u4f ZQ+sQ48Sqwgxge1ze+Soil/fmFmoM6L1bIepjoRsqqChC83mjQYCgjZiL0PseM1NmJdA PIOWFIIP5I8z1lZA0J3jeGXL7h/Q6rEWN5UE0VABDG1O10oH7p+rivGfA5mMiqzqfZUX Lw1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=ZjJpxklG; spf=pass (google.com: domain of linux-kernel+bounces-735-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-735-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. [147.75.199.223]) by mx.google.com with ESMTPS id bz15-20020ad44c0f000000b0067acc6ed81esi17388595qvb.52.2023.12.15.02.20.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Dec 2023 02:20:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-735-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=ZjJpxklG; spf=pass (google.com: domain of linux-kernel+bounces-735-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-735-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 EE0341C22C48 for ; Fri, 15 Dec 2023 10:20:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6B5D219BDF; Fri, 15 Dec 2023 10:19:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="ZjJpxklG" 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 7E452199C2; Fri, 15 Dec 2023 10:19:28 +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 (m0279862.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 3BF2wUCf001631; Fri, 15 Dec 2023 10:18:59 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=Cyuy5K1/eJPUo/RtECMi X6Lsj6sa60ojM0f9F7kHHXg=; b=ZjJpxklGsVmD5/DJYE8rhIEkLt4yEnnRY9Yz VofxOqx5W2CckkIXUJhH6nKiHMHnjcuVlPNlYwK+5+yX41wJf2cdAPMkQbVjg5XV MUtqFnWjSSeCbRWeDGyZ8N+XnkqhOPpKiMEkg/D35QrdrhHBpQFATlmWdBE1BDwJ oE3psR0NdAMozOdIo3rVlLyF0Nl/hlgrq9/W0mNZqznNewi1P0WTKsP3V1FxfHo/ A300lQUSlt2YX1TBDp1Hv4fn327IWiVoB1YVgOLnCNK307tdYykD+P8JqfBZBEj+ wjY3me1Rs6f2AtN6Gq12XN5Voc3gDa8s+n5j5Dwql6+5X7pXXA== Received: from nalasppmta02.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3v081t1rcc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 15 Dec 2023 10:18:59 +0000 (GMT) Received: from nalasex01c.na.qualcomm.com (nalasex01c.na.qualcomm.com [10.47.97.35]) by NALASPPMTA02.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 3BFAIweK006502 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 15 Dec 2023 10:18:58 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; Fri, 15 Dec 2023 02:18:51 -0800 From: Bibek Kumar Patro To: , , , , , , , , , , , , , , CC: , , , , , Bibek Kumar Patro Subject: [PATCH v4 1/5] iommu/arm-smmu: refactor qcom_smmu structure to include single pointer Date: Fri, 15 Dec 2023 15:48:23 +0530 Message-ID: <20231215101827.30549-2-quic_bibekkum@quicinc.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20231215101827.30549-1-quic_bibekkum@quicinc.com> References: <20231215101827.30549-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-ORIG-GUID: rnr6NeXde7M3oiFdKFb1C6OL-eSqBbpF X-Proofpoint-GUID: rnr6NeXde7M3oiFdKFb1C6OL-eSqBbpF 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 lowpriorityscore=0 priorityscore=1501 phishscore=0 mlxlogscore=982 mlxscore=0 bulkscore=0 impostorscore=0 adultscore=0 malwarescore=0 suspectscore=0 spamscore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2311290000 definitions=main-2312150069 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 549ae4dba3a6..8a7c16a86694 100644 --- a/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c +++ b/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c @@ -465,7 +465,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