From patchwork Wed Jul 31 06:05:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Rothwell X-Patchwork-Id: 11067131 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C03CF746 for ; Wed, 31 Jul 2019 06:06:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A6916287B5 for ; Wed, 31 Jul 2019 06:06:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 99FEA288B3; Wed, 31 Jul 2019 06:06:17 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 93C86287B5 for ; Wed, 31 Jul 2019 06:06:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender:Content-Type:Cc: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: MIME-Version:Message-ID:Subject:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=Lljf7O4kvbJ+uCDFohAXcgiWuEWTUAG74KPnIWdmaKM=; b=jXM NYXJ8qY0Gf7cWIgLcwiRrk7x/Zt+Oz43FUadGWBeYF+QIexW2IChSIUh9st62bIuWsHyTHYeQxG6E 1Tz/k0kjt8FLAZDBvYzeBWzpqeJNzKSjQ/aRmVw3CA/uNymkaLmUL5ITq33PzCx9t8wRhQltqcTNo xkszIp0k0jWg2+bN1wWx//TTB0vm320uXzQFpSrbvYJ7UMCzk5HCK2G9qCR3W0RF+OheQIiNv/LHX IBmkB4TU+Uasi9Xm5a7weULmNfRNzxzjA/Y/D6xBkVSZuTm1jyN7YwZM+gIUmlc415DzeVaYjG6v7 aGzV8ScjZyDq/oBZG7AYJRkvxhnBUCw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hshkd-0004zz-Oi; Wed, 31 Jul 2019 06:06:15 +0000 Received: from ozlabs.org ([203.11.71.1]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hshkS-0004mr-Kk for linux-arm-kernel@lists.infradead.org; Wed, 31 Jul 2019 06:06:06 +0000 Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 45z2wk3Zllz9sBF; Wed, 31 Jul 2019 16:05:58 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=canb.auug.org.au; s=201702; t=1564553158; bh=G789WvqxZoZpdQOOwYke+JrWvQfQevv9ZWAFnS+sSZA=; h=Date:From:To:Cc:Subject:From; b=ULZcEMP1hbsL5PEMQRd9ipkccZJUqRzkZp64i6ZQ5vtXe2QcvKUtekLFQPvAolbo9 oJvGVBUic1MX6EU2caJ4j9lymGFyd9dAcu+3zr64qlojxOe+0uTj4dVyzsAKC7LZ5p DLwhp+HJS6GxDvZUOMzIlII0ZqBkf9wB/M1WYj66OIilpxUxip10vbZrXrK5Ld4RS/ myT81Db2yteC5mvo+gSefQYdNh1Q7ZLNrqY93qw8gt//QKVreCMM7g8DL3u/BhFxWd Gd2Rrq1lFAWoD36Kg18Iqp3GJ2ejlNRwNA/AQKJz3bxsRuKhy3fOHXFtuFeeSVjo9p bOhNMiTTv6mOQ== Date: Wed, 31 Jul 2019 16:05:57 +1000 From: Stephen Rothwell To: Greg Kroah-Hartman Subject: xilinx_uartps.c: suppress "may be used uninitialised" warning Message-ID: <20190731160557.6a09c3e1@canb.auug.org.au> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190730_230605_146675_D003155A X-CRM114-Status: GOOD ( 13.11 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Michal Simek , Linux Kernel Mailing List , Linux Next Mailing List , Linux Serial List , Jiri Slaby , Linux PPC Development List , Linus ARM List Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From 31753a44c62c4fdf6e8a72994ae6861dbde49c11 Mon Sep 17 00:00:00 2001 From: Stephen Rothwell Date: Wed, 31 Jul 2019 16:00:52 +1000 Subject: [PATCH] xilinx_uartps.c: suppress "may be used uninitialised" warning A powerpc allyesconfig build produces this warning: In file included from include/linux/radix-tree.h:16, from include/linux/idr.h:15, from include/linux/kernfs.h:13, from include/linux/sysfs.h:16, from include/linux/kobject.h:20, from include/linux/device.h:16, from include/linux/platform_device.h:13, from drivers/tty/serial/xilinx_uartps.c:16: drivers/tty/serial/xilinx_uartps.c: In function 'cdns_uart_console_write': include/linux/spinlock.h:288:3: warning: 'flags' may be used uninitialized in this function [-Wmaybe-uninitialized] _raw_spin_unlock_irqrestore(lock, flags); \ ^~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/tty/serial/xilinx_uartps.c:1197:16: note: 'flags' was declared here unsigned long flags; ^~~~~ It looks like gcc just can't track the relationship between "locked" and "flags", and it is obvious that "flags" won't be used when "locked" is zero, so the simplest thing is to initialise flags. Cc: Greg Kroah-Hartman Cc: Jiri Slaby Cc: Michal Simek Signed-off-by: Stephen Rothwell --- drivers/tty/serial/xilinx_uartps.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) This has been like this for a very long time, but this is now one of the few remaining warnings produced by the powerpc allyesconfig build, so it would be good to get rid of it. diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c index f145946f659b..da4563aaaf5c 100644 --- a/drivers/tty/serial/xilinx_uartps.c +++ b/drivers/tty/serial/xilinx_uartps.c @@ -1194,7 +1194,7 @@ static void cdns_uart_console_write(struct console *co, const char *s, unsigned int count) { struct uart_port *port = console_port; - unsigned long flags; + unsigned long flags = 0; unsigned int imr, ctrl; int locked = 1;