Received: by 10.192.165.148 with SMTP id m20csp2482534imm; Sun, 22 Apr 2018 07:59:41 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/2HwwlQf9pzCa/u+N1i4M+NrJ1eR2CI7MUqMLYIhxYZFWPeReVFfJAzQsdKDuGjAu7twps X-Received: by 10.101.75.202 with SMTP id p10mr14574747pgr.339.1524409181391; Sun, 22 Apr 2018 07:59:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524409181; cv=none; d=google.com; s=arc-20160816; b=YvA3Bnwz19UMM36kJiLAybfZhZHyjS4/E9WiWMKE/fcMazJj4fC2DM4QF9qtAlmSB1 oMkVKusTBrNU9ofMmAa/vnlComkELrsp2+Ajr+UCVxOSmRRQDzXLpHdIAUrrtCa9+gyk OmixIZXXWDrotc3tpJpBJ7wZbqhdG3ljtDtvhfffhCQVXC0rt2aB02nW7lsnlrOoVMtd UD/WxD0eGbrxfFICMd0ch27m1/E7ydHhGHD4P432FalPFOuWfG1ikCSQ31G3QqR1AE8I 8aqDn1gw23HsmXLe/8DiYAe2+rx59C25kF4klRB2xiDw4KybV7UbUCg4DVvW9CHH8DFI L53w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=SLQ5KUstW/MHwmXpiyvAbpid7TCHx7Qt9WAQkSxms/Q=; b=Xc4JVPJaxv/LwXnA+njJ/WnqgIcS+n94nbPBGnEjAV8C/LYx+QOetSzve7F6OS9P6c Z/r/meILkZZ4NgX0XWLf3/TCt9TgjDFCzXlsG526aUJWMGPPEqXuPK27y/mmbYPgl9v0 I9N9TMfSSCMsV+2yOa6viiUa8DmLAryiAIqUVbt33+UUtV0nz68BsH4yAnwarIAqXkjP 8u4Crktngy2l2OVqKzIi9Cotsx/CKgCicDqYd4jphyyjCl+eHTytMh5tnn0qZit+hP5b YmXqL3tr8DbMEsEfFoZLkeLejGMU6kuAkB0rVy1UTYDZUmtMuHKUr/habKJNyITcT4zn my/g== 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 f1-v6si9680455pld.168.2018.04.22.07.59.27; Sun, 22 Apr 2018 07:59:41 -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; 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 S1756841AbeDVONV (ORCPT + 99 others); Sun, 22 Apr 2018 10:13:21 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:55554 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756810AbeDVONM (ORCPT ); Sun, 22 Apr 2018 10:13:12 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id BAA0BCCE; Sun, 22 Apr 2018 14:13:11 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Andi Kleen , Arnd Bergmann , Geert Uytterhoeven , Stephen Boyd Subject: [PATCH 4.9 53/95] clk: fix false-positive Wmaybe-uninitialized warning Date: Sun, 22 Apr 2018 15:53:22 +0200 Message-Id: <20180422135212.582894376@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180422135210.432103639@linuxfoundation.org> References: <20180422135210.432103639@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Arnd Bergmann commit ce33f284935e08229046b30635e6aadcbab02b53 upstream. 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 Acked-by: Geert Uytterhoeven Signed-off-by: Stephen Boyd Signed-off-by: Greg Kroah-Hartman --- drivers/clk/renesas/clk-sh73a0.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) --- 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_ { 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_ 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)) {