Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp763225rwr; Thu, 4 May 2023 09:14:58 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ67RzrL4iWl4kplym2DbKKqp8mkaJMASbPa4WDGyMHQpJ0eRhRhjIjUzkHeV6WkSDC11j00 X-Received: by 2002:a05:6a20:918e:b0:ee:cc76:5023 with SMTP id v14-20020a056a20918e00b000eecc765023mr3058000pzd.22.1683216898160; Thu, 04 May 2023 09:14:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683216898; cv=none; d=google.com; s=arc-20160816; b=z6T7I7pZEXLZAS5S7BKWtw2YXcidpO+DAo2drJz7pu05FsUZv16ySxF0tURR73+ecf F0/XYR/fBZ0LCzAM0xW3F96w0PJ0YZY0sEWm0gvoGwcgkGAhvR6HSIfaviXt0ya9/TaM k6qdRsoaE29Dbvfvuxq+SB0jqqIQhZBz5aibDMIIbviZbsB10bDdR/uJqnfQbpmD9G2l YpkB736A5sxf6Thutcs8iS8eZfZ385tsz6koRzkhbC2x0Sp1AjRZCA+zyEy79EDr6+2K 6EfemsngDxJFWea+WrAls7ZIe2Iym67sE1xRojyfd0wScHNuBg0EgwpBoqS8FnkqpLG8 8wdw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=EMolWppIxSDsvuReLyYrwGonSoAuCBkkM1bAynDTv60=; b=yrev4Fq25IhCworD3nXnxuEMvyCQjTnQ9o2W5GPe9UNv0EACPOi3dEpZYTvL1Zm/n6 /VHlFjrOkzsDqBVNss2jIFElywulwl9HNzdgnmQ98YrXzfb6KG1B4MF/YLW1olC3vJT2 Qt2NWtsylNAjXy+Ue/6dNMqF4Q7JdqMgrWO6loFVg24H0uK5j38pukl+4a6axS2T5VSJ +ufDQSqP5U2McX9IUwYR+6898WSbY56sJc9yDnTAj8LkB8HU02bOumXAGKknb1PeexKf +y+b2FVhBfUL+PchkMPDSkR8I/oaQ7yQNlWcz8aevAABOLNKZ4v9F1dRvuYpnZV2SAeZ qtTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=aUNT2L5b; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t21-20020a63f355000000b005133c334fe9si33869405pgj.847.2023.05.04.09.14.42; Thu, 04 May 2023 09:14:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=aUNT2L5b; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231526AbjEDPpu (ORCPT + 99 others); Thu, 4 May 2023 11:45:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55974 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231503AbjEDPpn (ORCPT ); Thu, 4 May 2023 11:45:43 -0400 Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0093F4EE2; Thu, 4 May 2023 08:45:14 -0700 (PDT) X-UUID: a0b12ea4ea9211edb20a276fd37b9834-20230504 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=EMolWppIxSDsvuReLyYrwGonSoAuCBkkM1bAynDTv60=; b=aUNT2L5bEx1xPpK5iNl/8CnG/9izxITV37xqdzNwIDVvRgvAV2vI4E9wpciBz1h9oLeIQDFrBh0j3zhLNc7hg5oIIeJsCyBCR/1pGfd4vDshH9pqY7KLnnG9VEjK57+p6aMf5FYARN8QxP2M+OTZj9GHFn+JvBGmJezw04LLqa0=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.23,REQID:9126046f-6e43-4bfd-ac40-3de7498566b3,IP:0,U RL:0,TC:0,Content:-5,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION :release,TS:-5 X-CID-META: VersionHash:697ab71,CLOUDID:8d83c130-6935-4eab-a959-f84f8da15543,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-CID-BAS: 0,NGT,0,_ X-UUID: a0b12ea4ea9211edb20a276fd37b9834-20230504 Received: from mtkmbs10n2.mediatek.inc [(172.21.101.183)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1364203358; Thu, 04 May 2023 23:45:00 +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.26; Thu, 4 May 2023 23:44:58 +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.26 via Frontend Transport; Thu, 4 May 2023 23:44:58 +0800 From: Po-Wen Kao To: , , , , Alim Akhtar , Avri Altman , Bart Van Assche , "James E.J. Bottomley" , "Martin K. Petersen" , Matthias Brugger , AngeloGioacchino Del Regno CC: , , , , , , , , Subject: [PATCH v6 2/3] scsi: ufs: core: Rename symbol sizeof_utp_transfer_cmd_desc() Date: Thu, 4 May 2023 23:44:50 +0800 Message-ID: <20230504154454.26654-3-powen.kao@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20230504154454.26654-1-powen.kao@mediatek.com> References: <20230504154454.26654-1-powen.kao@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-MTK: N X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,RDNS_NONE, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 | 10 +++++----- include/ufs/ufshcd.h | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/ufs/core/ufs-mcq.c b/drivers/ufs/core/ufs-mcq.c index b7c5f39b50e6..937933d3f77c 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 = (le64_to_cpu(cqe->command_desc_base_addr) & CQE_UCD_BA) - hba->ucdl_dma_addr; - return div_u64(addr, sizeof_utp_transfer_cmd_desc(hba)); + return div_u64(addr, ufshcd_get_ucd_size(hba)); } 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 6c4ae32a1c49..3ef650317357 100644 --- a/drivers/ufs/core/ufshcd.c +++ b/drivers/ufs/core/ufshcd.c @@ -2849,10 +2849,10 @@ static void ufshcd_map_queues(struct Scsi_Host *shost) static void ufshcd_init_lrb(struct ufs_hba *hba, struct ufshcd_lrb *lrb, int i) { struct utp_transfer_cmd_desc *cmd_descp = (void *)hba->ucdl_base_addr + - i * sizeof_utp_transfer_cmd_desc(hba); + i * ufshcd_get_ucd_size(hba); struct utp_transfer_req_desc *utrdlp = hba->utrdl_base_addr; dma_addr_t cmd_desc_element_addr = hba->ucdl_dma_addr + - i * sizeof_utp_transfer_cmd_desc(hba); + i * ufshcd_get_ucd_size(hba); u16 response_offset = offsetof(struct utp_transfer_cmd_desc, response_upiu); u16 prdt_offset = offsetof(struct utp_transfer_cmd_desc, prd_table); @@ -3761,7 +3761,7 @@ static int ufshcd_memory_alloc(struct ufs_hba *hba) size_t utmrdl_size, utrdl_size, ucdl_size; /* Allocate memory for UTP command descriptors */ - ucdl_size = sizeof_utp_transfer_cmd_desc(hba) * hba->nutrs; + ucdl_size = ufshcd_get_ucd_size(hba) * hba->nutrs; hba->ucdl_base_addr = dmam_alloc_coherent(hba->dev, ucdl_size, &hba->ucdl_dma_addr, @@ -3861,7 +3861,7 @@ static void ufshcd_host_memory_configure(struct ufs_hba *hba) prdt_offset = offsetof(struct utp_transfer_cmd_desc, prd_table); - cmd_desc_size = sizeof_utp_transfer_cmd_desc(hba); + cmd_desc_size = ufshcd_get_ucd_size(hba); cmd_desc_dma_addr = hba->ucdl_dma_addr; for (i = 0; i < hba->nutrs; i++) { @@ -8452,7 +8452,7 @@ static void ufshcd_release_sdb_queue(struct ufs_hba *hba, int nutrs) { size_t ucdl_size, utrdl_size; - ucdl_size = sizeof_utp_transfer_cmd_desc(hba) * nutrs; + ucdl_size = ufshcd_get_ucd_size(hba) * nutrs; dmam_free_coherent(hba->dev, ucdl_size, hba->ucdl_base_addr, hba->ucdl_dma_addr); diff --git a/include/ufs/ufshcd.h b/include/ufs/ufshcd.h index f7553293ba98..df1d04f7a542 100644 --- a/include/ufs/ufshcd.h +++ b/include/ufs/ufshcd.h @@ -1133,7 +1133,7 @@ static inline size_t ufshcd_sg_entry_size(const struct ufs_hba *hba) ({ (void)(hba); BUILD_BUG_ON(sg_entry_size != sizeof(struct ufshcd_sg_entry)); }) #endif -static inline size_t sizeof_utp_transfer_cmd_desc(const struct ufs_hba *hba) +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_size(hba); } -- 2.18.0