From nobody Thu Nov 14 06:36:28 2024 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E6365C678DB for ; Tue, 7 Mar 2023 06:55:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230491AbjCGGzu (ORCPT ); Tue, 7 Mar 2023 01:55:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57040 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230414AbjCGGz2 (ORCPT ); Tue, 7 Mar 2023 01:55:28 -0500 Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 592CD4B803; Mon, 6 Mar 2023 22:55:26 -0800 (PST) X-UUID: 0621c638bcb511eda06fc9ecc4dadd91-20230307 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=eefp2TBphSryNflr6IaD3aAgrNF4D6LWqWrwV3IEx3s=; b=prM2b1ayDhBusw1Kc3xfXwA2BE9hX4BKQOktUf3WQ3niG3cJTYjd2CbeEucEG2nJbtqaqmV+nF8KFpuiTP71Stiapd4Y8rwtraEZxrQKXZDOB1Ms7mqOKTa7ZPkRrkz/NQOgYgfBNiuygGL9vk0CFN14WBb/zDWw7w8UDeU1ctw=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.20,REQID:c1918929-7082-46e2-ae40-a9486a2b4e86,IP:0,U RL:0,TC:0,Content:-25,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTIO N:release,TS:-25 X-CID-META: VersionHash:25b5999,CLOUDID:19fc9027-564d-42d9-9875-7c868ee415ec,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:102,TC:nil,Content:0,EDM:-3,IP:nil,U RL:0,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OSA:0,AV:0 X-CID-BVR: 0,NGT X-UUID: 0621c638bcb511eda06fc9ecc4dadd91-20230307 Received: from mtkmbs10n2.mediatek.inc [(172.21.101.183)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 341793758; Tue, 07 Mar 2023 14:55:19 +0800 Received: from mtkmbs11n2.mediatek.inc (172.21.101.187) by mtkmbs10n2.mediatek.inc (172.21.101.183) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.25; Tue, 7 Mar 2023 14:55:18 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkmbs11n2.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1118.25 via Frontend Transport; Tue, 7 Mar 2023 14:55:18 +0800 From: Po-Wen Kao To: , , , , Alim Akhtar , Avri Altman , Bart Van Assche , "James E.J. Bottomley" , "Martin K. Petersen" , Matthias Brugger CC: , , , , , , , , , , , Subject: [PATCH v4 2/5] scsi: ufs: core: Rename symbol sizeof_utp_transfer_cmd_desc() Date: Tue, 7 Mar 2023 14:54:43 +0800 Message-ID: <20230307065448.15279-3-powen.kao@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20230307065448.15279-1-powen.kao@mediatek.com> References: <20230307065448.15279-1-powen.kao@mediatek.com> MIME-Version: 1.0 X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Naming the functions after standard operators like sizeof may cause confusion. So let's rename it to ufshcd_get_ucd_size(). Signed-off-by: Po-Wen Kao Suggested-by: Manivannan Sadhasivam Reviewed-by: Stanley Chu Reviewed-by: Ziqi Chen Reviewed-by: Bart Van Assche --- drivers/ufs/core/ufs-mcq.c | 2 +- drivers/ufs/core/ufshcd.c | 8 ++++---- include/ufs/ufshcd.h | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/ufs/core/ufs-mcq.c b/drivers/ufs/core/ufs-mcq.c index 3a27fa4b0024..a39746b2a8be 100644 --- a/drivers/ufs/core/ufs-mcq.c +++ b/drivers/ufs/core/ufs-mcq.c @@ -265,7 +265,7 @@ static int ufshcd_mcq_get_tag(struct ufs_hba *hba, addr =3D (le64_to_cpu(cqe->command_desc_base_addr) & CQE_UCD_BA) - hba->ucdl_dma_addr; =20 - return div_u64(addr, sizeof_utp_transfer_cmd_desc(hba)); + return div_u64(addr, ufshcd_get_ucd_size(hba)); } =20 static void ufshcd_mcq_process_cqe(struct ufs_hba *hba, diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c index 629442c6bc9c..8c62d92228ed 100644 --- a/drivers/ufs/core/ufshcd.c +++ b/drivers/ufs/core/ufshcd.c @@ -2830,10 +2830,10 @@ static void ufshcd_map_queues(struct Scsi_Host *sho= st) static void ufshcd_init_lrb(struct ufs_hba *hba, struct ufshcd_lrb *lrb, i= nt i) { struct utp_transfer_cmd_desc *cmd_descp =3D (void *)hba->ucdl_base_addr + - i * sizeof_utp_transfer_cmd_desc(hba); + i * ufshcd_get_ucd_size(hba); struct utp_transfer_req_desc *utrdlp =3D hba->utrdl_base_addr; dma_addr_t cmd_desc_element_addr =3D hba->ucdl_dma_addr + - i * sizeof_utp_transfer_cmd_desc(hba); + i * ufshcd_get_ucd_size(hba); u16 response_offset =3D offsetof(struct utp_transfer_cmd_desc, response_upiu); u16 prdt_offset =3D offsetof(struct utp_transfer_cmd_desc, prd_table); @@ -3742,7 +3742,7 @@ static int ufshcd_memory_alloc(struct ufs_hba *hba) size_t utmrdl_size, utrdl_size, ucdl_size; =20 /* Allocate memory for UTP command descriptors */ - ucdl_size =3D sizeof_utp_transfer_cmd_desc(hba) * hba->nutrs; + ucdl_size =3D ufshcd_get_ucd_size(hba) * hba->nutrs; hba->ucdl_base_addr =3D dmam_alloc_coherent(hba->dev, ucdl_size, &hba->ucdl_dma_addr, @@ -3842,7 +3842,7 @@ static void ufshcd_host_memory_configure(struct ufs_h= ba *hba) prdt_offset =3D offsetof(struct utp_transfer_cmd_desc, prd_table); =20 - cmd_desc_size =3D sizeof_utp_transfer_cmd_desc(hba); + cmd_desc_size =3D ufshcd_get_ucd_size(hba); cmd_desc_dma_addr =3D hba->ucdl_dma_addr; =20 for (i =3D 0; i < hba->nutrs; i++) { diff --git a/include/ufs/ufshcd.h b/include/ufs/ufshcd.h index 05e416414e41..ed72c0a2d432 100644 --- a/include/ufs/ufshcd.h +++ b/include/ufs/ufshcd.h @@ -1137,7 +1137,7 @@ static inline size_t ufshcd_sg_entry_size(const struc= t ufs_hba *hba) ({ (void)(hba); BUILD_BUG_ON(sg_entry_size !=3D sizeof(struct ufshcd_sg_e= ntry)); }) #endif =20 -static inline size_t sizeof_utp_transfer_cmd_desc(const struct ufs_hba *hb= a) +static inline size_t ufshcd_get_ucd_size(const struct ufs_hba *hba) { return sizeof(struct utp_transfer_cmd_desc) + SG_ALL * ufshcd_sg_entry_si= ze(hba); } --=20 2.18.0