Received: by 2002:a05:7412:8598:b0:f9:33c2:5753 with SMTP id n24csp516962rdh; Tue, 19 Dec 2023 06:04:30 -0800 (PST) X-Google-Smtp-Source: AGHT+IGaPLytqQkN8/+Wckkgx9XZjxh/QtQcoANO5g1tDVNeY633b1I3LznaN1U5T3H491QF1Yyo X-Received: by 2002:a17:903:32d0:b0:1d3:d3a6:1575 with SMTP id i16-20020a17090332d000b001d3d3a61575mr1376802plr.69.1702994670398; Tue, 19 Dec 2023 06:04:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702994670; cv=none; d=google.com; s=arc-20160816; b=TFkHBVEpqBTsLoKflQA1Ij72r3D76bBbyPDJGvl3Fo2fviACKMRQ6U0lBQ2kdYAV9w GQIKZM5iOTbBccLKghK28PH2VofX2isQcJi71gCTGHqZlc9IWeR2XXZPNLvYAVjMtd+A v2ZmskyAkpqrMGMJJBopMPakVAp1ntNOFi7TtTI72f1zJlIHDn9ern/WH6Py7GEp4HzC vrFWyLNgVoyYQ0dqTb88D9ynf7f5uyAvSgVh4X7TBHnIKFllPTC4LQmb5n7TCFvvNtb3 87178QLC+cD4Z3a2QmJp8w+pr9xxg+NDvo0KNpa7at/GkxAYk95F+Wnttpv56UVH7FKj 1bNw== 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=81VyAfYYwZUEd7/HxPCq6uZiOCPFQNkwtMk8/VynR7c=; fh=mFC8nmckJLq19l2a2JACcOVBANdLlvDzOiUZ3OvRdps=; b=u5qaGqbcKECTnsaZa3b69gUp98D/HJFxr1spDPn1S7CrBkLWMn3MEMmgGL2aV4FcPq yP+9hgU3r13lkimwg/CornO5YPjrBC3ESUlh7hKhTNKjqt5v4+o6rnxQjSEhQfogCULe ptmrGWzUPcK3v+HSPY33iUAAJPZLxi8xFFDaT95uYLBcisWsZ+hujXHXap8miZCht654 T0vMKUBqJVZr9BiDotfDomyehltZGBLS+KRMyd19kPYfrWzWRUPWO19dWQpdKm0ceM17 OC3YXsZNcZfS6BjX/rHoTVICddDSGmFsNUJFNY0eDo5kP+WDSzjt8Uk+BiqqkHIoUZOk Vd/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b="LyV+46O/"; spf=pass (google.com: domain of linux-kernel+bounces-5301-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5301-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id j14-20020a170903024e00b001d1ce46f067si19903920plh.485.2023.12.19.06.04.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 06:04:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-5301-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b="LyV+46O/"; spf=pass (google.com: domain of linux-kernel+bounces-5301-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5301-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 8F2FB287455 for ; Tue, 19 Dec 2023 14:01:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A1F061BDDB; Tue, 19 Dec 2023 14:00:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="LyV+46O/" 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 AFF4B1BDD9; Tue, 19 Dec 2023 14:00:45 +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 3BJDCsHi009992; Tue, 19 Dec 2023 14:00: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=81VyAfYYwZUEd7/HxPCq 6uZiOCPFQNkwtMk8/VynR7c=; b=LyV+46O/PM1vBNpYMLF4PbwVX6Ac/oTg8GJn GK7JhRRTYQkGyU+n0A4qCY1fNteEqlqm+XN5Q8aI294AsIHGPlp4PJHczzYCBUm2 YNw5N/+A2UXzx0EugI9sTnksfen4p1tds1g0N0It7HfVG8HYtZZlY/44vIahwHI4 hPyuxxmEJSVsuKx8OYhTGEhV+6UdN222ekgjZbB1vfdcwr6Q8EgHx7f8LDO5JP3I qpBPPAYSfCWHNyN7O5nZFq3rYBMcwxXaDnErLh/ZWRCTDzzRiNwiBy4FaVu/FFjG E7VjYvDOgBnnx0UjIgra6EazpHD/9mCUsOGMf2L6wnTTqeGcFQ== Received: from nalasppmta05.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3v360yh3s5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 19 Dec 2023 14:00:23 +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 3BJE0Nno010422 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 19 Dec 2023 14:00:23 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, 19 Dec 2023 06:00:16 -0800 From: Bibek Kumar Patro To: , , , , , , , , , , , , , , CC: , , , , , Bibek Kumar Patro Subject: [PATCH v5 2/5] iommu/arm-smmu: refactor qcom_smmu structure to include single pointer Date: Tue, 19 Dec 2023 19:29:44 +0530 Message-ID: <20231219135947.1623-3-quic_bibekkum@quicinc.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20231219135947.1623-1-quic_bibekkum@quicinc.com> References: <20231219135947.1623-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: gM3vBs4qcrSAv47QbPj-H3-M6L50DWdi X-Proofpoint-ORIG-GUID: gM3vBs4qcrSAv47QbPj-H3-M6L50DWdi 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 suspectscore=0 priorityscore=1501 spamscore=0 mlxlogscore=990 adultscore=0 bulkscore=0 clxscore=1015 mlxscore=0 malwarescore=0 phishscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2311290000 definitions=main-2312190104 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 225a53486307..6af2c8b1ed3d 100644 --- a/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c +++ b/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c @@ -492,7 +492,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