From patchwork Sat May 9 21:44:51 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 6370681 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 4289D9F32B for ; Sat, 9 May 2015 21:45:33 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6B1E420386 for ; Sat, 9 May 2015 21:45:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 87E6F2013D for ; Sat, 9 May 2015 21:45:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752054AbbEIVpa (ORCPT ); Sat, 9 May 2015 17:45:30 -0400 Received: from mail-qc0-f170.google.com ([209.85.216.170]:33359 "EHLO mail-qc0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751975AbbEIVpa (ORCPT ); Sat, 9 May 2015 17:45:30 -0400 Received: by qcvo8 with SMTP id o8so29058253qcv.0 for ; Sat, 09 May 2015 14:45:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=tQWev+o0eyB0LEqz+Rms5GyMnu52h5IvEyWdj7DBWbU=; b=XLM+rjb+f12t+OTI6NUvAZtb6b/5g+7kxl80sL/EbyX0OOaYyiwTn2CM9dvJRX7LUk lpRPPFOL2Jk4mjjqNrVgUHraqZCrVOGAPFLkQ8vu5oxkusc9SrGCWCt7XYXbk+Wahj9+ HpEoCRJ2tTCtqjC3OuBxKnDze9A/yNEIw2LEEL7vsy042/otMDYZ37UbNCdxmpTLIa6X tlOtlGSO6uAOYmTs7S/4iHKtCvZ+vnRCoykLiXSnpPioz2DdWlqey7Hzd/Buw6uZ14mg JUGA/xTJEeE5LGq35qxz5t2BEUU5IcGpAxpoGqanlT4zEZhnhbsrg6ZZnaLYqzMeVHE5 UgfQ== X-Received: by 10.140.202.20 with SMTP id x20mr5460623qha.101.1431207929584; Sat, 09 May 2015 14:45:29 -0700 (PDT) Received: from localhost.localdomain ([186.207.90.56]) by mx.google.com with ESMTPSA id z198sm6578389qhd.44.2015.05.09.14.45.26 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 09 May 2015 14:45:28 -0700 (PDT) From: Fabio Estevam To: ulf.hansson@linaro.org Cc: linux-mmc@vger.kernel.org, Fabio Estevam Subject: [PATCH 3/3] mmc: host: sdhci: Use BUG_ON() Date: Sat, 9 May 2015 18:44:51 -0300 Message-Id: <1431207891-21448-3-git-send-email-festevam@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1431207891-21448-1-git-send-email-festevam@gmail.com> References: <1431207891-21448-1-git-send-email-festevam@gmail.com> Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Fabio Estevam Use BUG_ON() instead of an 'if' condition followed by BUG(). The semantic patch that makes this change is available in scripts/coccinelle/misc/bugon.cocci. More information about semantic patching is available at http://coccinelle.lip6.fr/ Signed-off-by: Fabio Estevam --- drivers/mmc/host/sdhci.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index c80287a..8d97fe0 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -328,8 +328,7 @@ static void sdhci_read_block_pio(struct sdhci_host *host) local_irq_save(flags); while (blksize) { - if (!sg_miter_next(&host->sg_miter)) - BUG(); + BUG_ON(!sg_miter_next(&host->sg_miter)); len = min(host->sg_miter.length, blksize); @@ -374,8 +373,7 @@ static void sdhci_write_block_pio(struct sdhci_host *host) local_irq_save(flags); while (blksize) { - if (!sg_miter_next(&host->sg_miter)) - BUG(); + BUG_ON(!sg_miter_next(&host->sg_miter)); len = min(host->sg_miter.length, blksize);