From patchwork Fri Feb 16 15:27:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 128601 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp681854ljc; Fri, 16 Feb 2018 07:28:23 -0800 (PST) X-Google-Smtp-Source: AH8x224tmME836A5YpLFEn3i5Q1Sshx6PuK346O0OqOSAcjQ/ZU2j8+J5NiVX4+Y6DY4ZxYZH9it X-Received: by 10.99.183.68 with SMTP id w4mr5507992pgt.221.1518794903088; Fri, 16 Feb 2018 07:28:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518794903; cv=none; d=google.com; s=arc-20160816; b=UEVCAyUoqmFqwbqFYOZ/l3Cn9gdnrCcI1CtKY/qYLwWCDL7ctDSlvS4J9yrXCHeIY5 NtwO4pWpdj+rBAMCTOYZcaZwDoTwGfcQwVqHQiGk1vHPwJRrJlvia4uEu6/Z7543lDr0 x+uyknSCld1bmw5KEqKxmVIHEhcg+sbbYjNx7q+nkgT8d4E7V63FNsdzAcgmi9fQ7NZS oo/rDFUeilC7FKGxldzI8tCb65K1/2zg3QLgQDEV8gian1HZ8jxmLMfsgJUZv7XlZgHa i1w7X4Fe9QMdSn+wVM+tLyBQrElTMNrl8AV8Y/0zHQHsEvKcvBcyib4Jy68366amyRGD 386g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=4/82fOTzvgyAaCDpFwIp3PFX3p9i0yon9pl9Gd+y+Jc=; b=QRxDTfLRV6wAmasdRLydaCg671rdl069AnmBzjS8n0uCcTVAW9WoDU+E5FVj3O8lUB 9SEx4x60jqF2/lB9/Eqw54MYn9Z03Q+MGV3Mr5pEwEfMyC66O7RW2wziNdPqwPzgFreg a9ZBuhmFl+EcnX6Mus3hrz4rp16TzIvd4gNiD+XhPyneZ3qH+uenFP4txlPJY42NfdcQ n4blMEEaOEapiP6VRsOjbvJU/+4uyhMtx7HrkHX20NSxRfeJbF20r30oxlOJ9DZU5wBw trp8F1mzuBJJB+JOxxA4gmX9IZp4N1p6qxjI6bQm7blq17AcHjHZ1iTfgwdMzKmTtjU0 DvwQ== ARC-Authentication-Results: i=1; mx.google.com; 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 d4si2333223pfh.196.2018.02.16.07.28.22; Fri, 16 Feb 2018 07:28:23 -0800 (PST) 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; 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 S1030359AbeBPP2U (ORCPT + 28 others); Fri, 16 Feb 2018 10:28:20 -0500 Received: from mout.kundenserver.de ([212.227.126.135]:38491 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030266AbeBPP2R (ORCPT ); Fri, 16 Feb 2018 10:28:17 -0500 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue001 [212.227.15.129]) with ESMTPA (Nemesis) id 0MHQEF-1ezaFG2jdT-00E7M6; Fri, 16 Feb 2018 16:28:09 +0100 From: Arnd Bergmann To: Geert Uytterhoeven , Michael Turquette , Stephen Boyd Cc: Arnd Bergmann , stable@vger.kernel.org, Andi Kleen , linux-renesas-soc@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] clk: fix false-positive Wmaybe-uninitialized warning Date: Fri, 16 Feb 2018 16:27:47 +0100 Message-Id: <20180216152807.1629038-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:iyeRScIsRZi3vjs/r63vmKfKEw2frPNzKJNNqp7CYyFbeikwvaQ AeLiS+KmOY6f2us7oV8cgCj7vJvSylqLgMzWIKE/82az7OoVNZIaAopfxVyW0C544QsuzVR PkrB7ydPw33c1VCuSrVjIhp/qnzArdzl9epu8KU24PHMagNOG10oSnUpVpQcKZxkICkiAcy 5p2HxkvDxTCbSo0w2ZfQQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:14G+KML9F6A=:s0AfaDwiN+uxF0LriP3hiy RfaAU/mzWR4FvjDFU6cbZxdqWDnbTfEBr6Zz/51EyknUy1ymU6HkzFzyQj8DdMme6bxPniGvA Jp0WklubgX8BX5O2Yk2rTNy8cd00BsN5oC6fLPwqyyWSRuJkNFNiFoJztC+5UCvb6uXI3aPTV n/mz282oDzkDmsjx1pZUJnNfyGQ/y/ZSOipd7313z8+EYk0Ivhx/XUg1X7eC0tV4DM8NFE0kR VSdNN0bcRLDHXR12A3Gu2B2c2uhbBtG9fvzWtY/JriUmOh7tKdSEyTBs1l0PijYXpuBqOIVq9 bGlRdpDpmqQxZZ8VtmRv/6q4jIXnNEfw6jYli6W3diiBKFg9mrZgdW+aa1GWen0A34VYhTQNx 1gQKO/nP5tKhx2wljpAOw68tXDQfSe6pL+LZlhqtZxH+z3qght+KHvP0ifyEEAcPsPA5UI6vh lKtK2fMDKaiARJukvJJeleWeveSjX8Vv9Js86+OuiYO/Au4LErtLyefTpuOVdD3bpmAlEb2ng 5wr/0j7+bWBgAMHqcDAM+he1P0kTnOWOM1JLLifWFa+qiBgxQxqdx/a4KpOgRYoF4SQFkbkfK uAnv+5quTSqp0cLgzCIoa15LpImeZxZyZ9kx0ty1oe7HQWMWODTl5188Gh+3nyFtzn18S4q+Q m8dHoG5L/Fvcc8TQMYa4OMRRe+7JwgBWBIWtBox1UdCuroa/3ayPUH5NK1e5aK/fYou2Q35a0 j3Jxotfw5kr6jxbDhbWGUOlwW01dsosXexAVmg== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When we build this driver with on x86-32, gcc produces a false-positive warning: drivers/clk/renesas/clk-sh73a0.c: In function 'sh73a0_cpg_clocks_init': drivers/clk/renesas/clk-sh73a0.c:155:10: error: 'parent_name' may be used uninitialized in this function [-Werror=maybe-uninitialized] return clk_register_fixed_factor(NULL, name, parent_name, 0, We can work around that warning by adding a fake initialization, I tried and failed to come up with any better workaround. This is currently one of few remaining warnings for a 4.14.y randconfig build, so it would be good to also have it backported at least to that version. Older versions have more randconfig warnings, so we might not care. I had not noticed this earlier, because one patch in my randconfig test tree removes the '-ffreestanding' option on x86-32, and that avoids the warning. The -ffreestanding flag was originally global but moved into arch/i386 by Andi Kleen in commit 6edfba1b33c7 ("[PATCH] x86_64: Don't define string functions to builtin") as a 'temporary workaround'. Like many temporary hacks, this turned out to be rather long-lived, from all I can tell we still need a simple fix to asm/string_32.h before it can be removed, but I'm not sure about how to best do that. Cc: stable@vger.kernel.org Cc: Andi Kleen Signed-off-by: Arnd Bergmann --- drivers/clk/renesas/clk-sh73a0.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- 2.9.0 diff --git a/drivers/clk/renesas/clk-sh73a0.c b/drivers/clk/renesas/clk-sh73a0.c index eea38f6ea77e..3892346c4fcc 100644 --- a/drivers/clk/renesas/clk-sh73a0.c +++ b/drivers/clk/renesas/clk-sh73a0.c @@ -46,7 +46,7 @@ struct div4_clk { unsigned int shift; }; -static struct div4_clk div4_clks[] = { +static const struct div4_clk div4_clks[] = { { "zg", "pll0", CPG_FRQCRA, 16 }, { "m3", "pll1", CPG_FRQCRA, 12 }, { "b", "pll1", CPG_FRQCRA, 8 }, @@ -79,7 +79,7 @@ sh73a0_cpg_register_clock(struct device_node *np, struct sh73a0_cpg *cpg, { const struct clk_div_table *table = NULL; unsigned int shift, reg, width; - const char *parent_name; + const char *parent_name = NULL; unsigned int mult = 1; unsigned int div = 1; @@ -135,7 +135,7 @@ sh73a0_cpg_register_clock(struct device_node *np, struct sh73a0_cpg *cpg, shift = 24; width = 5; } else { - struct div4_clk *c; + const struct div4_clk *c; for (c = div4_clks; c->name; c++) { if (!strcmp(name, c->name)) {