Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp10128876ybi; Thu, 11 Jul 2019 00:03:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqyenbr//xpXR7arUBKC1TltYchxpjtPAb9wgtig7k3FCQVR9Vp8Jq9zyknlfYYKok7JTpCl X-Received: by 2002:a63:ee0c:: with SMTP id e12mr2814144pgi.184.1562828622981; Thu, 11 Jul 2019 00:03:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562828622; cv=none; d=google.com; s=arc-20160816; b=KJNCYAqXQApFXwpoUI5jbHb6GQqqkWy3Bv8Jo79xc4fdC02iecHmH7ODRCBNlOJgc8 L5g4OvDfKFqDEcVl1bluAo0h3CzRWQ7qlvI8xM3K4t2hXhu7bPhTqI3TtBnnJuGzKLRI Jrqm8GX4CsqTJnyZZVIgQh06tZhGbNN0zsq8376ThBmdU2FdcwJM8GS1D4qQSxRsytoD 3FfhKXzKS7N23QIgubGSFtdn2J2yrc7853SxlnWegcuOJB/GhOJY0ub0tZQh/3S53qsy T/wZle2KkD6gLNWp1aOkkqmBSeZDci1rYnhgXefvVHFQEQqyIyJJ9KcQc7Y6R/zIiRpn ysBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=bJecxb6aoz/+Td0UyD7/fzRJUw0Z4SQcB2IrP7X6KsI=; b=QhVslgRWPZsKMehf7zWHcp/wbg9KPNvE0SRl6WJTuRlH912HeMuDVAV6mAnS7hBHJE aHhK6ukoTQrlqnHKVpdXi6w3BdFDw3c35C8jJoRDkZ5W4BxHnKT3wvRl2T/wWxRG5VOX R9adBQeD3Ul1d9qfpeSiKBg/Xe1yySfgolpt9NtzBbTL6swXfq04sRwSMpstxqPdOJjv SczZS1CAkZRn9kvraEYxsICJVmLc+kulwWB5wUG6CItClwI7KdchgJXkzbFjrHFeUoeC 9lXgU1CWJLmlZ1x1thtZ2MUZNzwToU7IgPnq/UU5ghg0qpPC0ceSmK8elglDxRoWIWSV 2mSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=iV0jZspR; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g129si4674019pfb.1.2019.07.11.00.03.26; Thu, 11 Jul 2019 00:03:42 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=iV0jZspR; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728147AbfGKHAq (ORCPT + 99 others); Thu, 11 Jul 2019 03:00:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:34202 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725963AbfGKHAq (ORCPT ); Thu, 11 Jul 2019 03:00:46 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1D0D721019; Thu, 11 Jul 2019 07:00:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1562828445; bh=8tYiPo23RhF+zMZps2Ew0kc5pCJq6pKf0897T8FJ+mk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=iV0jZspRmlN9/eN2/iuxb829Lq2LG2suZ25E6HocavImKwEzdEv108DDo4NCerNEm 7kVfWGPvYAKHrpHMGfChBYvD8/+wbDUbvW8+x3gc1HSB8LCF+LSejxETDVJHT3AHlu Y6O63tlyFRfvSFZOZ9Abr7F0aKIkbhep61tYYQ6Q= Date: Thu, 11 Jul 2019 09:00:42 +0200 From: Greg Kroah-Hartman To: Keyur Patel Cc: devel@driverdev.osuosl.org, Alex Elder , Johan Hovold , linux-kernel@vger.kernel.org, greybus-dev@lists.linaro.org, David Lin Subject: Re: [PATCH] staging: greybus: add logging statement when kfifo_alloc fails Message-ID: <20190711070042.GA28487@kroah.com> References: <20190710122018.2250-1-iamkeyur96@gmail.com> <20190710163538.GA30902@kroah.com> <20190710142406.GA6669@keyur-pc> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190710142406.GA6669@keyur-pc> User-Agent: Mutt/1.12.1 (2019-06-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 10, 2019 at 10:24:06AM -0400, Keyur Patel wrote: > On Wed, Jul 10, 2019 at 06:35:38PM +0200, Greg Kroah-Hartman wrote: > > On Wed, Jul 10, 2019 at 08:20:17AM -0400, Keyur Patel wrote: > > > Added missing logging statement when kfifo_alloc fails, to improve > > > debugging. > > > > > > Signed-off-by: Keyur Patel > > > --- > > > drivers/staging/greybus/uart.c | 4 +++- > > > 1 file changed, 3 insertions(+), 1 deletion(-) > > > > > > diff --git a/drivers/staging/greybus/uart.c b/drivers/staging/greybus/uart.c > > > index b3bffe91ae99..86a395ae177d 100644 > > > --- a/drivers/staging/greybus/uart.c > > > +++ b/drivers/staging/greybus/uart.c > > > @@ -856,8 +856,10 @@ static int gb_uart_probe(struct gbphy_device *gbphy_dev, > > > > > > retval = kfifo_alloc(&gb_tty->write_fifo, GB_UART_WRITE_FIFO_SIZE, > > > GFP_KERNEL); > > > - if (retval) > > > + if (retval) { > > > + pr_err("kfifo_alloc failed\n"); > > > goto exit_buf_free; > > > + } > > > > You should have already gotten an error message from the log if this > > fails, from the kmalloc_array() call failing, right? > > > > So why is this needed? We have been trying to remove these types of > > messages and keep them in the "root" place where the failure happens. > > > > thanks, > > > > greg k-h > > Didn't notice that. I agree that this will result only into redundancy. > Quick look over files reveal that there are multiple places > where people are using print statements after memory allocation fails. > Should I go ahead and send patches to remove those > redundant print statements? It all depends on where in the kernel those are. Some subsystems want minor cleanups like this, but most do not. So unless the issue you find is in the drivers/staging/ directory, I would not worry about it. thanks, greg k-h