Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S942413AbcJSOcJ (ORCPT ); Wed, 19 Oct 2016 10:32:09 -0400 Received: from mail-lf0-f54.google.com ([209.85.215.54]:32792 "EHLO mail-lf0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932674AbcJSOcF (ORCPT ); Wed, 19 Oct 2016 10:32:05 -0400 Date: Wed, 19 Oct 2016 13:52:12 +0100 From: Peter Griffin To: Arnd Bergmann Cc: Vinod Koul , Patrice Chotard , Dan Williams , Ludovic Barre , linux-arm-kernel@lists.infradead.org, kernel@stlinux.com, dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] dmaengine: st_fdma: fix uninitialized variable access Message-ID: <20161019125212.GA32299@griffinp-ThinkPad-X1-Carbon-2nd> References: <20161019120927.3251235-1-arnd@arndb.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161019120927.3251235-1-arnd@arndb.de> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 996 Lines: 28 Hi Arnd, On Wed, 19 Oct 2016, Arnd Bergmann wrote: > The newly added st_fdma driver introduces a build warning for > allmodconfig when we add '-Wmaybe-uninitialized': > > drivers/dma/st_fdma.c: In function 'st_fdma_probe': > drivers/dma/st_fdma.c:777:5: error: 'ret' may be used uninitialized in this function [-Werror=maybe-uninitialized] > > The warning is correct, though this can't happen in practice > as the check is redundant (we don't get to this function if > the pointer is NULL). Even if the function were called with a > NULL of_node, the check is not needed because of_property_read_u32 > can deal with a NULL argument by returning an error. > > Removing the unnecessary code simplifies the function and avoids > the condition that we get the warning for. > > Fixes: 6b4cd727eaf1 ("dmaengine: st_fdma: Add STMicroelectronics FDMA engine driver support") > Signed-off-by: Arnd Bergmann > --- Acked-by: Peter Griffin regards, Peter.