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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7F54AC352A1 for ; Wed, 30 Nov 2022 11:19:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234525AbiK3LTB (ORCPT ); Wed, 30 Nov 2022 06:19:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42004 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234469AbiK3LSO (ORCPT ); Wed, 30 Nov 2022 06:18:14 -0500 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9483F4AF13; Wed, 30 Nov 2022 03:18:08 -0800 (PST) Received: from dggpemm500022.china.huawei.com (unknown [172.30.72.57]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4NMc636DJGzqSM5; Wed, 30 Nov 2022 19:14:03 +0800 (CST) Received: from dggpemm500006.china.huawei.com (7.185.36.236) by dggpemm500022.china.huawei.com (7.185.36.162) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Wed, 30 Nov 2022 19:18:06 +0800 Received: from [10.174.178.55] (10.174.178.55) by dggpemm500006.china.huawei.com (7.185.36.236) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Wed, 30 Nov 2022 19:18:06 +0800 Subject: Re: [PATCH] mmc: core: Fix error return code in sd_read_ext_regs() To: Ulf Hansson CC: , References: <20221130092847.2092-1-thunder.leizhen@huawei.com> From: "Leizhen (ThunderTown)" Message-ID: Date: Wed, 30 Nov 2022 19:18:05 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.178.55] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To dggpemm500006.china.huawei.com (7.185.36.236) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2022/11/30 18:04, Ulf Hansson wrote: > On Wed, 30 Nov 2022 at 10:29, Zhen Lei wrote: >> >> Fix to return a negative error code from the error handling >> case instead of 0, as done elsewhere in this function. >> >> Fixes: c784f92769ae ("mmc: core: Read the SD function extension registers for power management") >> Signed-off-by: Zhen Lei >> --- >> drivers/mmc/core/sd.c | 1 + >> 1 file changed, 1 insertion(+) >> >> diff --git a/drivers/mmc/core/sd.c b/drivers/mmc/core/sd.c >> index 3662bf5320ce56d..7b64f76f0179ca8 100644 >> --- a/drivers/mmc/core/sd.c >> +++ b/drivers/mmc/core/sd.c >> @@ -1277,6 +1277,7 @@ static int sd_read_ext_regs(struct mmc_card *card) >> if (rev != 0 || len > 512) { >> pr_warn("%s: non-supported SD ext reg layout\n", >> mmc_hostname(card->host)); >> + err = -EOPNOTSUPP; > > The original intent was to not return an error code. Simply, because > the card remains functional and all but the new features from the SD > function extensions registers can still be used. OK, I got it. > > Perhaps, we should update the comment a few lines above to better > reflect that this is in-fact what we intend here. How about also add 'warning' to the output? The other two outputs contain the 'error' keyword. > >> goto out; >> } >> > > Kind regards > Uffe > . > -- Regards, Zhen Lei