From: Venu Byravarasu <vbyravarasu@nvidia.com>
To: Shawn Lin <shawn.lin@rock-chips.com>,
Ulf Hansson <ulf.hansson@linaro.org>
Cc: "linux-mmc@vger.kernel.org" <linux-mmc@vger.kernel.org>,
Venu Byravarasu <vbyravarasu@nvidia.com>
Subject: RE: [PATCH 3/8] mmc: core: remove BUG_ONs from mmc
Date: Wed, 2 Nov 2016 09:40:35 +0000 [thread overview]
Message-ID: <4a277797476345c7a4db8f1fa12bca08@bgmail103.nvidia.com> (raw)
In-Reply-To: <1478071533-12775-1-git-send-email-shawn.lin@rock-chips.com>
> -----Original Message-----
> From: linux-mmc-owner@vger.kernel.org [mailto:linux-mmc-
> owner@vger.kernel.org] On Behalf Of Shawn Lin
> Sent: Wednesday, November 02, 2016 12:56 PM
> To: Ulf Hansson <ulf.hansson@linaro.org>
> Cc: linux-mmc@vger.kernel.org; Shawn Lin <shawn.lin@rock-chips.com>
> Subject: [PATCH 3/8] mmc: core: remove BUG_ONs from mmc
>
> BUG_ONs doesn't help anything except for stop the system from running. If it
> occurs, it implies we should deploy proper error handling for that. So this patch is
> gonna discard these meaningless BUG_ONs and deploy error handling if needed.
>
> Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
> ---
>
> drivers/mmc/core/mmc.c | 14 --------------
> drivers/mmc/core/mmc_ops.c | 17 -----------------
> 2 files changed, 31 deletions(-)
>
> diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c index
> e811bd9..4763a35 100644
> --- a/drivers/mmc/core/mmc.c
> +++ b/drivers/mmc/core/mmc.c
> @@ -1464,7 +1464,6 @@ static int mmc_init_card(struct mmc_host *host, u32
> ocr,
> u32 cid[4];
> u32 rocr;
>
> - BUG_ON(!host);
Instead of just removing BUG_ON, it would be worth adding null check and
return from here graciously as you mentioned in patch commit message,
without which next instruction below may crash if host == NULL.
Similar is the case with other removals below.
> WARN_ON(!host->claimed);
>
> /* Set correct bus mode for MMC before attempting init */ @@ -1854,9
> +1853,6 @@ static int mmc_poweroff_notify(struct mmc_card *card, unsigned int
> notify_type)
> */
> static void mmc_remove(struct mmc_host *host) {
> - BUG_ON(!host);
> - BUG_ON(!host->card);
> -
> mmc_remove_card(host->card);
> host->card = NULL;
> }
-----------------------------------------------------------------------------------
This email message is for the sole use of the intended recipient(s) and may contain
confidential information. Any unauthorized review, use, disclosure or distribution
is prohibited. If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.
-----------------------------------------------------------------------------------
next prev parent reply other threads:[~2016-11-02 9:40 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-02 7:24 [PATCH 1/8] mmc: core: remove BUG_ONs from sdio Shawn Lin
2016-11-02 7:24 ` [PATCH 2/8] mmc: debugfs: remove BUG_ON from mmc_ext_csd_open Shawn Lin
2016-11-29 12:41 ` Ulf Hansson
2016-11-02 7:25 ` [PATCH 3/8] mmc: core: remove BUG_ONs from mmc Shawn Lin
2016-11-02 9:40 ` Venu Byravarasu [this message]
2016-11-29 12:41 ` Ulf Hansson
2016-11-02 7:25 ` [PATCH 4/8] mmc: core: remove BUG_ONs from sd Shawn Lin
2016-11-29 12:41 ` Ulf Hansson
2016-11-02 7:26 ` [PATCH 5/8] mmc: core: remove BUG_ONs from core.c Shawn Lin
2016-11-29 12:41 ` Ulf Hansson
2016-11-02 7:26 ` [PATCH 6/8] mmc: sdio_uart: remove meaningless BUG_ON Shawn Lin
2016-11-29 12:41 ` Ulf Hansson
2016-11-02 7:26 ` [PATCH 7/8] mmc: queue: remove BUG_ON for bounce_sg Shawn Lin
2016-11-29 12:41 ` Ulf Hansson
2016-11-02 7:26 ` [PATCH 8/8] mmc: mmc_test: remove BUG_ONs and deploy error handling Shawn Lin
2016-11-29 12:41 ` Ulf Hansson
2016-11-29 12:40 ` [PATCH 1/8] mmc: core: remove BUG_ONs from sdio Ulf Hansson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4a277797476345c7a4db8f1fa12bca08@bgmail103.nvidia.com \
--to=vbyravarasu@nvidia.com \
--cc=linux-mmc@vger.kernel.org \
--cc=shawn.lin@rock-chips.com \
--cc=ulf.hansson@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox