From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756470AbdEMRYm (ORCPT ); Sat, 13 May 2017 13:24:42 -0400 Received: from mga11.intel.com ([192.55.52.93]:15871 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753155AbdEMRYk (ORCPT ); Sat, 13 May 2017 13:24:40 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.38,336,1491289200"; d="scan'208";a="87106907" From: "Winkler, Tomas" To: SF Markus Elfring , "linux-mmc@vger.kernel.org" , Bojan Prtvar , Linus Walleij , Paul Burton , Shawn Lin , Ulf Hansson , Uri Yanai CC: LKML , "kernel-janitors@vger.kernel.org" Subject: RE: [PATCH] mmc: core: Delete an error message for a failed memory allocation in three functions Thread-Topic: [PATCH] mmc: core: Delete an error message for a failed memory allocation in three functions Thread-Index: AQHSy+hMy0R3sAIevkuQVc0YOctmhqHyg5gw Date: Sat, 13 May 2017 17:24:35 +0000 Message-ID: <5B8DA87D05A7694D9FA63FD143655C1B641D7ABC@hasmsx108.ger.corp.intel.com> References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 10.0.102.7 dlp-reaction: no-action x-originating-ip: [10.184.70.10] Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by mail.home.local id v4DHP50r003510 > -----Original Message----- > From: SF Markus Elfring [mailto:elfring@users.sourceforge.net] > Sent: Saturday, May 13, 2017 15:54 > To: linux-mmc@vger.kernel.org; Bojan Prtvar ; Linus > Walleij ; Paul Burton ; > Shawn Lin ; Ulf Hansson > ; Uri Yanai ; Winkler, > Tomas > Cc: LKML ; kernel-janitors@vger.kernel.org > Subject: [PATCH] mmc: core: Delete an error message for a failed memory > allocation in three functions > > From: Markus Elfring > Date: Sat, 13 May 2017 14:40:08 +0200 > > Omit an extra message for a memory allocation failure in these functions. > > This issue was detected by using the Coccinelle software. > > Link: http://events.linuxfoundation.org/sites/events/files/slides/LCJ16- > Refactor_Strings-WSang_0.pdf > Signed-off-by: Markus Elfring Looks, OK to me. Tomas > --- > drivers/mmc/core/sd.c | 16 +++------------- > 1 file changed, 3 insertions(+), 13 deletions(-) > > diff --git a/drivers/mmc/core/sd.c b/drivers/mmc/core/sd.c index > d109634fbfce..1d7542daecbe 100644 > --- a/drivers/mmc/core/sd.c > +++ b/drivers/mmc/core/sd.c > @@ -294,12 +294,8 @@ static int mmc_read_switch(struct mmc_card *card) > err = -EIO; > > status = kmalloc(64, GFP_KERNEL); > - if (!status) { > - pr_err("%s: could not allocate a buffer for " > - "switch capabilities.\n", > - mmc_hostname(card->host)); > + if (!status) > return -ENOMEM; > - } > > /* > * Find out the card's support bits with a mode 0 operation. > @@ -359,11 +355,8 @@ int mmc_sd_switch_hs(struct mmc_card *card) > return 0; > > status = kmalloc(64, GFP_KERNEL); > - if (!status) { > - pr_err("%s: could not allocate a buffer for " > - "switch capabilities.\n", mmc_hostname(card- > >host)); > + if (!status) > return -ENOMEM; > - } > > err = mmc_sd_switch(card, 1, 0, 1, status); > if (err) > @@ -596,11 +589,8 @@ static int mmc_sd_init_uhs_card(struct mmc_card > *card) > return 0; > > status = kmalloc(64, GFP_KERNEL); > - if (!status) { > - pr_err("%s: could not allocate a buffer for " > - "switch capabilities.\n", mmc_hostname(card- > >host)); > + if (!status) > return -ENOMEM; > - } > > /* Set 4-bit bus width */ > if ((card->host->caps & MMC_CAP_4_BIT_DATA) && > -- > 2.12.3