Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1273032rwd; Thu, 18 May 2023 10:00:41 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6ncDN1tPVQ5uQJ+yJuwWRxLRnLXOrtEXHr08ndrlPKXbNiNspkwkH0bMj6Ts0a60EiLZj/ X-Received: by 2002:a17:903:32c8:b0:1ac:7345:f254 with SMTP id i8-20020a17090332c800b001ac7345f254mr3697836plr.33.1684429241135; Thu, 18 May 2023 10:00:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684429241; cv=none; d=google.com; s=arc-20160816; b=EMELX4737mqR+QS1ZuG4vvU0ZFQ5ab6ZApTtSYO1Cij8q5d9qiq/BBeCNATWAYH40Y Roza4H+8dDHTDP8nWFHy8E9rsbsIerOFHYMkPO3jh4CqGg+PkpFFcL8ZMp80hp6LfOhc Ee2QZ6yNEYpc97vwvk5itCTcxy+mj1zB6FU5P2bBNfppXanK9bdDq5AOSo9wZxiyzZeO I8v45llkTivHFo7hroL5of9Byp6TVEB0e1mLwOpLVIHLKK+2kH99BJFXmm9ZsoiyZzDb sXPiSiAEosVhiDdQLyTxe8Y7/uAkXyNl5xrkrq8oeAVgdnSrfnkMDER+owEp2kJDnH1n 2GNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :organization:from:content-language:references:cc:to:subject :user-agent:mime-version:date:message-id:dkim-signature; bh=gVsrXoEInpYf8k9zrelI12LbquSfhTBNiPz/DtpCgwE=; b=Q6T44cEnbduACs9mH9tA7lLSMyvZk2Nl+CvzKoMqlFah9or2KRKCw5EV7wxu18hDCq MwWkxAdDt7p+KJ16tBpfS72RLp7A8ppGiAwp6y1v+6iO6Tn04cJzAedFy2egpz9E0mgq 9AKwMuQTa/0A8dkG8MTZXgqJMcsOmtOP7nSEY/ZyVhcprSsvePdqbnIvc2vS3UKCEcX6 nyi0bwImzlM59KJEqMWglPcAVyaqaRyS6rsumdkkifd+bg9GjrICjK0zsnXgEZ6UAmx1 +h56b7WfOGum0i5Ihw1MBc71WHoba0JR+btX+rrAuwJu00cY9RBWorgPy5rKp8EkFYp1 eABQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=VFIAplx8; 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=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u16-20020a170902e81000b001a6fe422894si1830202plg.200.2023.05.18.10.00.24; Thu, 18 May 2023 10:00:41 -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=@intel.com header.s=Intel header.b=VFIAplx8; 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=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229558AbjERQni (ORCPT + 99 others); Thu, 18 May 2023 12:43:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34802 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229457AbjERQnh (ORCPT ); Thu, 18 May 2023 12:43:37 -0400 Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AC9EBD1; Thu, 18 May 2023 09:43:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1684428216; x=1715964216; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=kegxpnfkaQJ/nP+d2s5eNw9UacalFzi2yPWpbyh024o=; b=VFIAplx81+Z0mvwYVj++SJeMecb5Libgq8EnKe8MI2DL6+6qcDCmr91h 4mJj3mZIQmLFRMwRYOLKna4/Utz3uZgiThkFlnAkyFf5Bd1OEQDJshvLo cHnwhhhYfH2jC+hBW5+/yntuWobAHhmGOkysxxoKJt5BBINqd8/B5xw49 kMT9bN5T64UrjJWzy8SibbZKP21cvI1bnZwG7K2r5zhqOGk58GvshU7Sn 5I3F/Zyldgc3xJnhxZQMckSQJiEn163ZmG4Y44qcS1CxhvflYf3NBbmip zhdrsUl4AiepswNqLJ79K7GBPrWoFbTg4mGxyBd8RT6R72PfWOkc5AQol Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10714"; a="415572079" X-IronPort-AV: E=Sophos;i="6.00,285,1681196400"; d="scan'208";a="415572079" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 May 2023 09:43:36 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10714"; a="767276995" X-IronPort-AV: E=Sophos;i="6.00,285,1681196400"; d="scan'208";a="767276995" Received: from ahunter6-mobl1.ger.corp.intel.com (HELO [10.0.2.15]) ([10.251.221.202]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 May 2023 09:43:31 -0700 Message-ID: Date: Thu, 18 May 2023 19:43:28 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Firefox/102.0 Thunderbird/102.11.0 Subject: Re: [PATCH] mmc: core: Remove unnecessary error checks and change return type To: Yeqi Fu , ulf.hansson@linaro.org, CLoehle@hyperstone.com, avri.altman@wdc.com, axboe@kernel.dk Cc: linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org References: <36e805fa-338d-a945-2621-75c5077572fc@intel.com> <20230518101216.369970-1-asuk4.q@gmail.com> Content-Language: en-US From: Adrian Hunter Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki In-Reply-To: <20230518101216.369970-1-asuk4.q@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham 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 On 18/05/23 13:12, Yeqi Fu wrote: > The error checks in mmc_blk_add_debugfs() and mmc_blk_remove_debugfs() > are extraneous. Therefore, this patch removes all error checks from > both functions. > Additionally, mmc_blk_add_debugfs() has been changed to return void > instead of an integer value that was never used. This simplifies the > function and improves its clarity. > > Signed-off-by: Yeqi Fu Acked-by: Adrian Hunter > --- > drivers/mmc/core/block.c | 25 +++++++------------------ > 1 file changed, 7 insertions(+), 18 deletions(-) > > diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c > index 00c33edb9fb9..81f33200b893 100644 > --- a/drivers/mmc/core/block.c > +++ b/drivers/mmc/core/block.c > @@ -2894,12 +2894,12 @@ static const struct file_operations mmc_dbg_ext_csd_fops = { > .llseek = default_llseek, > }; > > -static int mmc_blk_add_debugfs(struct mmc_card *card, struct mmc_blk_data *md) > +static void mmc_blk_add_debugfs(struct mmc_card *card, struct mmc_blk_data *md) > { > struct dentry *root; > > if (!card->debugfs_root) > - return 0; > + return; > > root = card->debugfs_root; > > @@ -2908,19 +2908,13 @@ static int mmc_blk_add_debugfs(struct mmc_card *card, struct mmc_blk_data *md) > debugfs_create_file_unsafe("status", 0400, root, > card, > &mmc_dbg_card_status_fops); > - if (!md->status_dentry) > - return -EIO; > } > > if (mmc_card_mmc(card)) { > md->ext_csd_dentry = > debugfs_create_file("ext_csd", S_IRUSR, root, card, > &mmc_dbg_ext_csd_fops); > - if (!md->ext_csd_dentry) > - return -EIO; > } > - > - return 0; > } > > static void mmc_blk_remove_debugfs(struct mmc_card *card, > @@ -2929,22 +2923,17 @@ static void mmc_blk_remove_debugfs(struct mmc_card *card, > if (!card->debugfs_root) > return; > > - if (!IS_ERR_OR_NULL(md->status_dentry)) { > - debugfs_remove(md->status_dentry); > - md->status_dentry = NULL; > - } > + debugfs_remove(md->status_dentry); > + md->status_dentry = NULL; > > - if (!IS_ERR_OR_NULL(md->ext_csd_dentry)) { > - debugfs_remove(md->ext_csd_dentry); > - md->ext_csd_dentry = NULL; > - } > + debugfs_remove(md->ext_csd_dentry); > + md->ext_csd_dentry = NULL; > } > > #else > > -static int mmc_blk_add_debugfs(struct mmc_card *card, struct mmc_blk_data *md) > +static void mmc_blk_add_debugfs(struct mmc_card *card, struct mmc_blk_data *md) > { > - return 0; > } > > static void mmc_blk_remove_debugfs(struct mmc_card *card,