From patchwork Tue Feb 9 11:43:11 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 8260341 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 29A9EBEEE5 for ; Tue, 9 Feb 2016 11:44:22 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4F4132025A for ; Tue, 9 Feb 2016 11:44:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 655D120254 for ; Tue, 9 Feb 2016 11:44:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755356AbcBILoT (ORCPT ); Tue, 9 Feb 2016 06:44:19 -0500 Received: from condef003-v.nifty.com ([210.131.4.240]:49460 "EHLO condef003-v.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755261AbcBILoT (ORCPT ); Tue, 9 Feb 2016 06:44:19 -0500 Received: from conuserg011-v.nifty.com ([10.16.229.198])by condef003-v.nifty.com with ESMTP id u19Bgapb028482 for ; Tue, 9 Feb 2016 20:42:36 +0900 Received: from beagle.diag.org (p14090-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.90]) (authenticated) by conuserg011-v.nifty.com with ESMTP id u19BgMDS022707; Tue, 9 Feb 2016 20:42:22 +0900 X-Nifty-SrcIP: [153.142.97.90] From: Masahiro Yamada To: linux-mmc@vger.kernel.org Cc: Masahiro Yamada , Adrian Hunter , linux-kernel@vger.kernel.org, Chaotian Jing , Ulf Hansson Subject: [PATCH] mmc: reduce nesting and join error strings into one line Date: Tue, 9 Feb 2016 20:43:11 +0900 Message-Id: <1455018191-8545-1-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 1.9.1 Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 No reason to use the double "if" nesting. This fix allows to move the nested block to the left and tidy up the error message without 80-col overflow. Signed-off-by: Masahiro Yamada --- drivers/mmc/core/mmc.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c index bf49e44..3789a50 100644 --- a/drivers/mmc/core/mmc.c +++ b/drivers/mmc/core/mmc.c @@ -345,14 +345,14 @@ static int mmc_decode_ext_csd(struct mmc_card *card, u8 *ext_csd) /* Version is coded in the CSD_STRUCTURE byte in the EXT_CSD register */ card->ext_csd.raw_ext_csd_structure = ext_csd[EXT_CSD_STRUCTURE]; - if (card->csd.structure == 3) { - if (card->ext_csd.raw_ext_csd_structure > 2) { - pr_err("%s: unrecognised EXT_CSD structure " - "version %d\n", mmc_hostname(card->host), - card->ext_csd.raw_ext_csd_structure); - err = -EINVAL; - goto out; - } + + if (card->csd.structure == 3 && + card->ext_csd.raw_ext_csd_structure > 2) { + pr_err("%s: unrecognised EXT_CSD structure version %d\n", + mmc_hostname(card->host), + card->ext_csd.raw_ext_csd_structure); + err = -EINVAL; + goto out; } np = mmc_of_find_child_device(card->host, 0);