From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755056AbcIOVpw (ORCPT ); Thu, 15 Sep 2016 17:45:52 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:53497 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753951AbcIOVpv (ORCPT ); Thu, 15 Sep 2016 17:45:51 -0400 DMARC-Filter: OpenDMARC Filter v1.3.1 smtp.codeaurora.org ADEC86126D Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=pass smtp.mailfrom=sboyd@codeaurora.org Subject: Re: [PATCH] PM / OPP: avoid maybe-uninitialized warning To: Arnd Bergmann , Viresh Kumar , Nishanth Menon References: <20160915153917.3001855-1-arnd@arndb.de> Cc: "Rafael J. Wysocki" , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org From: Stephen Boyd Message-ID: <1289252d-4af8-4ffb-051b-6d2f460dd69f@codeaurora.org> Date: Thu, 15 Sep 2016 14:45:49 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <20160915153917.3001855-1-arnd@arndb.de> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09/15/2016 08:38 AM, Arnd Bergmann wrote: > When CONFIG_OPTIMIZE_INLINING is set and we are building with -Wmaybe-uninitialized > enabled, we can get a warning for the opp core driver: > > drivers/base/power/opp/core.c: In function 'dev_pm_opp_set_rate': > drivers/base/power/opp/core.c:560:8: warning: 'ou_volt_min' may be used uninitialized in this function [-Wmaybe-uninitialized] > > This has only now appeared as a result of commit 797da5598f3a ("PM / devfreq: > Add COMPILE_TEST for build coverage"), which makes the driver visible in > some configurations that didn't have it before. > > The warning is a false positive that I got with gcc-6.1.1, but there is > a simple workaround in removing the local variables that we get warnings > for (all three are affected depending on the configuration). This also > makes the code easier to read. > > Signed-off-by: Arnd Bergmann Reviewed-by: Stephen Boyd -- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project