Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752209AbdLHUCV (ORCPT ); Fri, 8 Dec 2017 15:02:21 -0500 Received: from office2.cesnet.cz ([195.113.144.244]:32998 "EHLO office2.cesnet.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750947AbdLHUCT (ORCPT ); Fri, 8 Dec 2017 15:02:19 -0500 X-Greylist: delayed 582 seconds by postgrey-1.27 at vger.kernel.org; Fri, 08 Dec 2017 15:02:19 EST From: =?iso-8859-1?Q?Jan_Kundr=E1t?= To: SF Markus Elfring Cc: , Alexander Shiyan , Greg Kroah-Hartman , Jiri Slaby , LKML , Subject: Re: [PATCH] serial: max310x: Delete an error message for a failed =?iso-8859-1?Q?memory_allocation_in_max310x=5Fprobe()?= Date: Fri, 08 Dec 2017 20:52:36 +0100 MIME-Version: 1.0 Message-ID: In-Reply-To: <4153838e-4796-537c-7b7f-98404d4f3481@users.sourceforge.net> References: <4153838e-4796-537c-7b7f-98404d4f3481@users.sourceforge.net> Organization: CESNET User-Agent: Trojita/v0.7-308-g0f39ddfc; Qt/5.9.2; xcb; Linux; Gentoo Base System release 2.3 Content-Type: text/plain; charset=utf-8; format=flowed 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 quoted-printable to 8bit by nfs id vB8K2PZE013129 Content-Length: 1366 Lines: 37 On pátek 8. prosince 2017 20:00:34 CET, SF Markus Elfring wrote: > From: Markus Elfring > Date: Fri, 8 Dec 2017 19:53:10 +0100 > > Omit an extra message for a memory allocation failure in this function. > > This issue was detected by using the Coccinelle software. > > Signed-off-by: Markus Elfring > --- > drivers/tty/serial/max310x.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/drivers/tty/serial/max310x.c b/drivers/tty/serial/max310x.c > index ecb6513a6505..2aad36f402fd 100644 > --- a/drivers/tty/serial/max310x.c > +++ b/drivers/tty/serial/max310x.c > @@ -1102,10 +1102,8 @@ static int max310x_probe(struct device > *dev, struct max310x_devtype *devtype, > /* Alloc port structure */ > s = devm_kzalloc(dev, sizeof(*s) + > sizeof(struct max310x_one) * devtype->nr, GFP_KERNEL); > - if (!s) { > - dev_err(dev, "Error allocating port structure\n"); > + if (!s) > return -ENOMEM; > - } > > clk_osc = devm_clk_get(dev, "osc"); > clk_xtal = devm_clk_get(dev, "xtal"); I'm looking at this patch because I'm also making some modifications to this driver. This patch makes sense; other drivers also simply return ENOMEM. Tested on ARM, Armada 388; the "good" code path still obviously works :). Reviewed-by: Jan Kundrát