Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S968497AbdD0LEg (ORCPT ); Thu, 27 Apr 2017 07:04:36 -0400 Received: from mail-ve1eur01on0051.outbound.protection.outlook.com ([104.47.1.51]:52478 "EHLO EUR01-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932229AbdD0LC6 (ORCPT ); Thu, 27 Apr 2017 07:02:58 -0400 From: Daniel Baluta To: "arnd@arndb.de" CC: "lgirdwood@gmail.com" , "ckeepax@opensource.wolfsonmicro.com" , "linux-kernel@vger.kernel.org" , "patches@opensource.wolfsonmicro.com" , "broonie@kernel.org" , "tiwai@suse.com" , "alsa-devel@alsa-project.org" Subject: Re: [PATCH v2 1/2] ASoC: codec: wm9860: avoid maybe-uninitialized warning Thread-Topic: [PATCH v2 1/2] ASoC: codec: wm9860: avoid maybe-uninitialized warning Thread-Index: AQHSvo5vaXdBb7uE70uGvaRpJ5+026HY/u6AgAAPlgA= Date: Thu, 27 Apr 2017 11:02:52 +0000 Message-ID: <1493290972.18400.40.camel@nxp.com> References: <1493212192-7930-1-git-send-email-daniel.baluta@nxp.com> <1493212192-7930-2-git-send-email-daniel.baluta@nxp.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: arndb.de; dkim=none (message not signed) header.d=none;arndb.de; dmarc=none action=none header.from=nxp.com; x-originating-ip: [192.88.146.1] x-microsoft-exchange-diagnostics: 1;AM3PR04MB500;7:ucpHjtsCSm72+GTao0b1rJThNkBhYr3zwKEGateGE0kssRSGJH8mWSep5fpisXPY41nVrJFzNf/14VzrJzMtkO0YAAxWpzjN86nLdoqFDQioGRo9Aef47t8PEkxsKxYmvAAgbloAuJ7Ea4yGWc8897K4zx2b/fQklK6/TWY6ATk06/tELpH3o+zTunfZG28f4qTzsc5SIaAoNYcFeRDK15xxi2kGPq/vXb8GJWvgxQjqL1YP8w2efW9pDIiM/8IvTmDvrpaul3vPdL+BB6nXCshV2Y/KPC+0iVVdjy5JRPUj+0o9jUYjSDquu3xQRe7ohZr9QD5nWzOX4Pyw23WzEw== x-ms-office365-filtering-correlation-id: 6b108c50-49f1-4b4a-3f9f-08d48d5cf387 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(2017030254075)(48565401081)(201703131423075)(201703031133081);SRVR:AM3PR04MB500; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(185117386973197); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040450)(601004)(2401047)(8121501046)(5005006)(93006095)(93001095)(10201501046)(3002001)(6055026)(6041248)(20161123560025)(20161123562025)(20161123555025)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(6072148);SRVR:AM3PR04MB500;BCL:0;PCL:0;RULEID:;SRVR:AM3PR04MB500; x-forefront-prvs: 029097202E x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(6009001)(39860400002)(39850400002)(39400400002)(39840400002)(39410400002)(39450400003)(377424004)(24454002)(377454003)(54356999)(6486002)(76176999)(106356001)(54906002)(5640700003)(189998001)(50986999)(81166006)(1730700003)(99286003)(53936002)(8676002)(2900100001)(8936002)(103116003)(5250100002)(3280700002)(4326008)(3846002)(110136004)(6116002)(6512007)(3660700001)(39060400002)(2501003)(66066001)(6306002)(38730400002)(102836003)(2906002)(2950100002)(2351001)(7736002)(25786009)(305945005)(966004)(6246003)(33646002)(6506006)(53546009)(36756003)(5660300001)(229853002)(6916009)(6436002)(86362001);DIR:OUT;SFP:1101;SCL:1;SRVR:AM3PR04MB500;H:AM3PR04MB500.eurprd04.prod.outlook.com;FPR:;SPF:None;MLV:ovrnspm;PTR:InfoNoRecords;LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="utf-8" Content-ID: MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Apr 2017 11:02:52.7606 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM3PR04MB500 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 base64 to 8bit by mail.home.local id v3RB6CUc006738 Content-Length: 1814 Lines: 52 On Jo, 2017-04-27 at 12:07 +0200, Arnd Bergmann wrote: > On Wed, Apr 26, 2017 at 3:09 PM, Daniel Baluta > wrote: > > > > The new PLL configuration code triggers a harmless warning: > > > > sound/soc/codecs/wm8960.c: In function 'wm8960_configure_clocking': > > sound/soc/codecs/wm8960.c:735:3: error: 'best_freq_out' may be used > > uninitialized in this function [-Werror=maybe-uninitialized] > >    wm8960_set_pll(codec, freq_in, best_freq_out); > >    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > sound/soc/codecs/wm8960.c:699:12: note: 'best_freq_out' was > > declared > > here > > > > Fix this by reworking the code such that: > > > > 1) When there is no PLL freq available return -EINVAL and make > > sure *bclk_idx, *dac_idx, *sysclk_idx are initialized with > > invalid values. > > > > 2) When there is a PLL freq available initialize *bclk_idx, > > *dac_idx and *sysclk_idx with correct values and immediately > > return the freq available. > > > > Fixes: 84fdc00d519f ("ASoC: codec: wm9860: Refactor PLL out freq > > search") > > Fixes: 303e8954af8d ("ASoC: codec: wm8960: Stop when a matching PLL > > freq is found") > > Suggested-by: Arnd Bergmann > > Signed-off-by: Daniel Baluta > Looks good to me. Let me know if you need me to test this more > thoroughly > with randconfig builds, otherwise I'll assume it's fine and it will > get tested once > it shows up in linux-next. > > Acked-by: Arnd Bergmann > Hi Arnd,  Thanks for doing this. I wouldn't expect randconfigs builds to show other issues. Anyhow, would like to see if with your compiler there are no warnings for the second patch of the series: http://mailman.alsa-project.org/pipermail/alsa-devel/2017-April/120177.html thanks, Daniel.