mmc: sdhci: Get rid of redundant BUG_ONs
BUG is never the right thing for SDHCI to do. Get rid of BUG_ON in cases it will oops anyway if the pointer is NULL, or if the condition is logically impossible. Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
This commit is contained in:
parent
6bde868181
commit
64ed8dd46b
|
@ -428,8 +428,6 @@ static void sdhci_transfer_pio(struct sdhci_host *host)
|
||||||
{
|
{
|
||||||
u32 mask;
|
u32 mask;
|
||||||
|
|
||||||
BUG_ON(!host->data);
|
|
||||||
|
|
||||||
if (host->blocks == 0)
|
if (host->blocks == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -929,8 +927,6 @@ static void sdhci_finish_data(struct sdhci_host *host)
|
||||||
{
|
{
|
||||||
struct mmc_data *data;
|
struct mmc_data *data;
|
||||||
|
|
||||||
BUG_ON(!host->data);
|
|
||||||
|
|
||||||
data = host->data;
|
data = host->data;
|
||||||
host->data = NULL;
|
host->data = NULL;
|
||||||
|
|
||||||
|
@ -1060,8 +1056,6 @@ static void sdhci_finish_command(struct sdhci_host *host)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
BUG_ON(host->cmd == NULL);
|
|
||||||
|
|
||||||
if (host->cmd->flags & MMC_RSP_PRESENT) {
|
if (host->cmd->flags & MMC_RSP_PRESENT) {
|
||||||
if (host->cmd->flags & MMC_RSP_136) {
|
if (host->cmd->flags & MMC_RSP_136) {
|
||||||
/* CRC is stripped so we need to do some shifting. */
|
/* CRC is stripped so we need to do some shifting. */
|
||||||
|
@ -2279,8 +2273,6 @@ static void sdhci_timeout_timer(unsigned long data)
|
||||||
|
|
||||||
static void sdhci_cmd_irq(struct sdhci_host *host, u32 intmask, u32 *mask)
|
static void sdhci_cmd_irq(struct sdhci_host *host, u32 intmask, u32 *mask)
|
||||||
{
|
{
|
||||||
BUG_ON(intmask == 0);
|
|
||||||
|
|
||||||
if (!host->cmd) {
|
if (!host->cmd) {
|
||||||
pr_err("%s: Got command interrupt 0x%08x even though no command operation was in progress.\n",
|
pr_err("%s: Got command interrupt 0x%08x even though no command operation was in progress.\n",
|
||||||
mmc_hostname(host->mmc), (unsigned)intmask);
|
mmc_hostname(host->mmc), (unsigned)intmask);
|
||||||
|
@ -2361,7 +2353,6 @@ static void sdhci_adma_show_error(struct sdhci_host *host) { }
|
||||||
static void sdhci_data_irq(struct sdhci_host *host, u32 intmask)
|
static void sdhci_data_irq(struct sdhci_host *host, u32 intmask)
|
||||||
{
|
{
|
||||||
u32 command;
|
u32 command;
|
||||||
BUG_ON(intmask == 0);
|
|
||||||
|
|
||||||
/* CMD19 generates _only_ Buffer Read Ready interrupt */
|
/* CMD19 generates _only_ Buffer Read Ready interrupt */
|
||||||
if (intmask & SDHCI_INT_DATA_AVAIL) {
|
if (intmask & SDHCI_INT_DATA_AVAIL) {
|
||||||
|
|
Loading…
Reference in New Issue