From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY, URIBL_BLOCKED,USER_AGENT_SANE_2 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E899CC2D0A3 for ; Tue, 3 Nov 2020 07:41:37 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6CDC321D91 for ; Tue, 3 Nov 2020 07:41:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="sfFLWgdr"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b="jpEKNxLM" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6CDC321D91 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=mediatek.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Date:To:From: Subject:Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=M775N5x4WwcTudmmytI4Tsrb0DGNaCA0mghSqeE6nIQ=; b=sfFLWgdrQnLGMLwLFzC/2VK9W 4D61gKaPo1vmUZCZsQQlpebptRdavzuWCMyVMb9EpdIBCY9NJ5UMPCV4dwLpeLlTdDjUVztY2dIo6 B2/v4ahe9ubyj5cwEQVyPKVMmFu2Salc695Sy9RT7cHwqozVZkFMsG3ultN/hk0b4DI6Nmrkux0Lz sCgDS/g5qLCdLVKFViaffzUNsdMO3WD7IfGWRZwTzpopVlb7COeXZuSaflSrKviEWzGFDREd/9wYO hct87ilhRw2Mgk3qqmKVl2jHkVJK96SucUv9dO3ZEE3SuuCMD/7rBR7neEtZL5uhfM8Q6LtkuVkd8 EeZUTzuIQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kZqvJ-0001Qz-6R; Tue, 03 Nov 2020 07:40:09 +0000 Received: from mailgw02.mediatek.com ([216.200.240.185]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kZqvE-0001Pb-SL; Tue, 03 Nov 2020 07:40:06 +0000 X-UUID: 68d8bca986fb4e4ba35aea121ca07304-20201102 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:MIME-Version:Content-Type:References:In-Reply-To:Date:CC:To:From:Subject:Message-ID; bh=ZZrwHSS1iEJcnFxsaFwOkWSIeqBrHNXbvsvad1w31c0=; b=jpEKNxLMJF3m1Z2UJy/TLKydQxeNHaEsfpxxLSTBf/189X6IgF1caOFcvf27tZduzmCI/3kn4RaTzyE3nu2JoYTuVNoYsK87bkvtjpCf0Y8EVzvwV3BltVdt3UqdsohYaySfcBFan1SZ2JYC6bFUWlXUO9WwookACIf9u9FmsCk=; X-UUID: 68d8bca986fb4e4ba35aea121ca07304-20201102 Received: from mtkcas66.mediatek.inc [(172.29.193.44)] by mailgw02.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 613923419; Mon, 02 Nov 2020 23:39:53 -0800 Received: from MTKMBS02N2.mediatek.inc (172.21.101.101) by MTKMBS62N2.mediatek.inc (172.29.193.42) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 2 Nov 2020 23:39:51 -0800 Received: from mtkcas10.mediatek.inc (172.21.101.39) by mtkmbs02n2.mediatek.inc (172.21.101.101) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 3 Nov 2020 15:39:44 +0800 Received: from [172.21.77.33] (172.21.77.33) by mtkcas10.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Tue, 3 Nov 2020 15:39:44 +0800 Message-ID: <1604389184.13152.9.camel@mtkswgap22> Subject: RE: [PATCH v1 1/6] scsi: ufs-mediatek: Assign arguments with correct type From: Stanley Chu To: Avri Altman Date: Tue, 3 Nov 2020 15:39:44 +0800 In-Reply-To: References: <20201029115750.24391-1-stanley.chu@mediatek.com> <20201029115750.24391-2-stanley.chu@mediatek.com> X-Mailer: Evolution 3.2.3-0ubuntu6 MIME-Version: 1.0 X-TM-SNTS-SMTP: 0E859257A7E797E8F756E436308F7A8CC066855BC4D0EBA211CF9AA173D4A0132000:8 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201103_024005_117447_721FD9AF X-CRM114-Status: GOOD ( 24.61 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "linux-scsi@vger.kernel.org" , "martin.petersen@oracle.com" , "andy.teng@mediatek.com" , "jejb@linux.ibm.com" , "chun-hung.wu@mediatek.com" , "kuohong.wang@mediatek.com" , "linux-kernel@vger.kernel.org" , "jiajie.hao@mediatek.com" , "linux-mediatek@lists.infradead.org" , "peter.wang@mediatek.com" , "alim.akhtar@samsung.com" , "matthias.bgg@gmail.com" , "chaotian.jing@mediatek.com" , "cc.chou@mediatek.com" , "linux-arm-kernel@lists.infradead.org" , "alice.chao@mediatek.com" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Avri, On Tue, 2020-11-03 at 07:12 +0000, Avri Altman wrote: > > > > In ufs_mtk_unipro_set_lpm(), use specific unsigned values > > as the argument to invoke ufshcd_dme_set(). > > > > In the same time, change the name of ufs_mtk_unipro_set_pm() > > to ufs_mtk_unipro_set_lpm() to align the naming convention > > in MediaTek UFS driver. > > > > Signed-off-by: Stanley Chu > Looks like this patch is gilding the lily? Thanks for the review. Please see explanation below. > > > --- > > drivers/scsi/ufs/ufs-mediatek.c | 12 ++++++------ > > 1 file changed, 6 insertions(+), 6 deletions(-) > > > > diff --git a/drivers/scsi/ufs/ufs-mediatek.c b/drivers/scsi/ufs/ufs-mediatek.c > > index 8df73bc2f8cb..0196a89055b5 100644 > > --- a/drivers/scsi/ufs/ufs-mediatek.c > > +++ b/drivers/scsi/ufs/ufs-mediatek.c > > @@ -639,14 +639,14 @@ static int ufs_mtk_pwr_change_notify(struct > > ufs_hba *hba, > > return ret; > > } > > > > -static int ufs_mtk_unipro_set_pm(struct ufs_hba *hba, bool lpm) > > +static int ufs_mtk_unipro_set_lpm(struct ufs_hba *hba, bool lpm) > > { > > int ret; > > struct ufs_mtk_host *host = ufshcd_get_variant(hba); > > > > ret = ufshcd_dme_set(hba, > > UIC_ARG_MIB_SEL(VS_UNIPROPOWERDOWNCONTROL, 0), > > - lpm); > > + lpm ? 1 : 0); > bool is implicitly converted to int anyway? This change is the echo of your suggestion in https://patchwork.kernel.org/project/linux-scsi/patch/20200908064507.30774-4-stanley.chu@mediatek.com/ Actually I think your suggestion is constructive that the accepted values of VS_UNIPROPOWERDOWNCONTROL are better clearly defined so I use the casting here in this patch. > > > if (!ret || !lpm) { > > /* > > * Forcibly set as non-LPM mode if UIC commands is failed > > @@ -664,7 +664,7 @@ static int ufs_mtk_pre_link(struct ufs_hba *hba) > > int ret; > > u32 tmp; > > > > - ret = ufs_mtk_unipro_set_pm(hba, false); > > + ret = ufs_mtk_unipro_set_lpm(hba, false); > > if (ret) > > return ret; > > > > @@ -774,7 +774,7 @@ static int ufs_mtk_link_set_hpm(struct ufs_hba > > *hba) > > if (err) > > return err; > > > > - err = ufs_mtk_unipro_set_pm(hba, false); > > + err = ufs_mtk_unipro_set_lpm(hba, false); > > if (err) > > return err; > > > > @@ -795,10 +795,10 @@ static int ufs_mtk_link_set_lpm(struct ufs_hba > > *hba) > > { > > int err; > > > > - err = ufs_mtk_unipro_set_pm(hba, true); > > + err = ufs_mtk_unipro_set_lpm(hba, true); > > if (err) { > > /* Resume UniPro state for following error recovery */ > > - ufs_mtk_unipro_set_pm(hba, false); > > + ufs_mtk_unipro_set_lpm(hba, false); > > return err; > > } > > > > -- > > 2.18.0 Thanks, Stanley Chu _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel