Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp9513786ybi; Wed, 10 Jul 2019 11:37:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqy2NXwZweVMp0yswpfDy7N8PT6savb1+/MV/LkQWsRSV8W2TQe2tzFmdPby/op3vt3wb38X X-Received: by 2002:a63:d755:: with SMTP id w21mr38905639pgi.311.1562783878096; Wed, 10 Jul 2019 11:37:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562783878; cv=none; d=google.com; s=arc-20160816; b=kVHk0qvfANoQfGFWYC0QpusGctIA0TkNYdFO7Bx5mb78Hft1IjHPJon1Rl6IQaSaGY TGbHGYMHQsDz5garGeSwc2D8RsF0xIZKSI+yl1f2/xdrDN1PneeGO8MJ2WCCp4kjiw5D SGc//gROaCEsOAod9AZFc9N93M9fCjf4Do9MzxXxLHtAI7kjfeutDcphVdG2Aj0apuJh 8JnezvDKNvk47yTzy5/NJ7wIdpkG7jMP9xpbvW1IEAYbVPspLIJ0bJwWHRYCrVhiTkc6 /M1dFyOihqad3eL2yYgsMNa1BsXnKuOFnFdaYjUNxYRtaf8A6+RSkJymiUccHhPNmr5S 4/Lg== 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=zAcgUolazA7luBwp8paMkjhRVKLXRJL6TdvFMDHQKzA=; b=h68oxVMmyOVMueVHknQ37izptwTE4JC4zg/vW9/7686zJcWH9bPFzeMeNis4t3yQu1 oQWvS8x04yVgjYNbjO+PJ29KRAOfA2lcPDKD7S3oQ7xxZrdRzfLw7dOaSvQOuKxGQx6J tL1lJssQI3MbriLQhQ1chXI6tSGihMSV5JCyMUX59tx4v+Sy3Sxj3to/Dt0TtxjPxUmI nSRp+nQ15LnrJValV28rjFNoOG7WIbyjPowKiPJs6gPRuB1zkWhYiZE3s4mo4JFOPcnS aYSIAGjp8lvsLc17rGiovrCdjXJohnD4yTCK222xV9iVkUYxXJF+qymLLh4ewpbYT9ju AjJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Kt1bVy3o; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v8si2942107pgg.228.2019.07.10.11.37.42; Wed, 10 Jul 2019 11:37:58 -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=@gmail.com header.s=20161025 header.b=Kt1bVy3o; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727905AbfGJSYG (ORCPT + 99 others); Wed, 10 Jul 2019 14:24:06 -0400 Received: from mail-qt1-f194.google.com ([209.85.160.194]:38324 "EHLO mail-qt1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727460AbfGJSYF (ORCPT ); Wed, 10 Jul 2019 14:24:05 -0400 Received: by mail-qt1-f194.google.com with SMTP id n11so3500994qtl.5 for ; Wed, 10 Jul 2019 11:24:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=zAcgUolazA7luBwp8paMkjhRVKLXRJL6TdvFMDHQKzA=; b=Kt1bVy3oXSYkybEb7FUQPCdO097Dt4isI9Ses2ujAL1YsDGwte6PKN8oQ6YNdAwuSN ZWA8xM1IqoPVmtmjACl8m7STmZpn9rSDaorGYvusAi4iUZQycD4VR3E26NVAQ/DXlaNr 4T49PxWMzreb34xbe+bgLiSrQHJ9hBVn5h1sDRvClBmYRNwC3yCYGLD/D5IKqIR6yW26 g4rnvI96pinGTapFoziC5ozDI++h/b34Drw4qdW9uraNL5a5BnELNTL8FhzRombuLIt6 dTPBJw4syTd15RmDgETe7pRIcm9NloYcxbkNxbuPLNK1D7DciqH0CnZhkCGSXqc8I5k+ iDaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=zAcgUolazA7luBwp8paMkjhRVKLXRJL6TdvFMDHQKzA=; b=BIt5wdm5gHKEY8E03o95+Sd4md1KmXjB2UYV5m04Eiyp54Ycc6WfzEG/jLdTu+PVQi i7ko6BxiWv493uhKI07BDDS6iAbHvJ/XrOZahQOTgxUhlr5zcDhXahooXvRVk1qyKO9Q sldHyxyY9wOEBCBgMy4H/xTCD0bgyx4kBXzR2dZJGykrV6+DbLBHFogsB50zB8WkRTFr vq+fvVhReXXTpg9pSSY5XhkjSrk5IEVVcKsnJM60Ag7SZfKJ1Z4iSg1n7pKO4TjvYICp jwe8IjnP/R/EHIqqxVS96cAawYVwuhiR4Z1xv53GSiE3Ga4CfXl7jwqgzCHUH4iSsSg4 986g== X-Gm-Message-State: APjAAAWiILA/tOoPVWLCQ/ewgsBblJWKDv/1aBw+RsmOQNz/elG9/dKt bP3D2L5SNJJJ3IXu4C04UA== X-Received: by 2002:ac8:374b:: with SMTP id p11mr24711189qtb.316.1562783044890; Wed, 10 Jul 2019 11:24:04 -0700 (PDT) Received: from keyur-pc (modemcable148.230-83-70.mc.videotron.ca. [70.83.230.148]) by smtp.gmail.com with ESMTPSA id f25sm1608616qta.81.2019.07.10.11.24.03 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 10 Jul 2019 11:24:03 -0700 (PDT) Date: Wed, 10 Jul 2019 10:24:06 -0400 From: Keyur Patel To: Greg Kroah-Hartman Cc: devel@driverdev.osuosl.org, Alex Elder , Johan Hovold , David Lin , greybus-dev@lists.linaro.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] staging: greybus: add logging statement when kfifo_alloc fails Message-ID: <20190710142406.GA6669@keyur-pc> References: <20190710122018.2250-1-iamkeyur96@gmail.com> <20190710163538.GA30902@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190710163538.GA30902@kroah.com> 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 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? Sorry, if you're receiving this message again. Thnaks. Keyur Patel