Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp2752686ybh; Mon, 5 Aug 2019 06:18:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqyU5Mhd5o2i87b+LmxpigPMCh42E0PXHduUDne4LFIKsSpij/LIbx7Vn2F+8Bdc/r8I8PGd X-Received: by 2002:a65:6081:: with SMTP id t1mr138267376pgu.9.1565011089833; Mon, 05 Aug 2019 06:18:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565011089; cv=none; d=google.com; s=arc-20160816; b=QI84V4SB/kmz7vVOgkrbclCs7wmCL35QJtq8/qLjGURdkICMty81uzvKZWSGNPukkY otnXY3/xOYupn4iVl8MHXm3lSPCXFRT+6+iKw51l/HUgncwcaz/G1NGJGnrvYXgYEyP1 4FC/WLbumplK6jnB3KJsL5ppcSeteXFtdqHX+IWR/neZyK78Wm2OBgk+XfmZ/IuEC3LJ 7Z4Q2O6r+7gp/cg9M75Hl6XgE9IOIjWJ3J0u4N1mooJdO0AfqSWPwakkQuPD4wdeDZOQ y8D3J7bP/qWsFan+/S3oEk5Pl6Jl0ln3tDW0GDLKrKYwHfnYyEsDAiWH2l4yc9fyB9+w cB/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=vI0HEKEU/Jhnp54mB9zRvzSubWKi8AkH72HoHPfpa14=; b=Z5js2NpB5iOXgHBlCXGla5hkCisJqOrIv+kpNu8Q/m7ij7+k/v4bsPfmbk9C3erAf5 iz8++UWH2lu8V8C0rq+4kz4bfpldBEYzwNynIU8pBH0H7LI7LNYKIx3XMX88jB/H3HD1 ivmaP5l6gcl2yHeOX/ghf3yjbZg3jjhcRVAqiqSDRSk1/rDnvduHytZVH7KnRHny9U7O VAAeJsVUgTZzDoi8u7SP06tSGTsWTzzdNdWslz6vrT8LSUydKjZkSOAUaVrT2zqhl5Ak ow7jC5q/nXrxyBkqCqAPkeU6Yn4zKKkgXhMTt9hfM6yz0DB/3FxqW760e6GI5/+2DrkU pccQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=WIIEmsLd; 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 g127si34599005pgc.128.2019.08.05.06.17.54; Mon, 05 Aug 2019 06:18:09 -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; dkim=pass header.i=@kernel.org header.s=default header.b=WIIEmsLd; 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 S1729303AbfHENF2 (ORCPT + 99 others); Mon, 5 Aug 2019 09:05:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:41446 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729284AbfHENFX (ORCPT ); Mon, 5 Aug 2019 09:05:23 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7725F216F4; Mon, 5 Aug 2019 13:05:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1565010323; bh=kxYrQmdRCtib0t6LmWD86n72w2PuoQG4j+uU0f3cboU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WIIEmsLd7avyOk8dAo61Na8Mh9v2grACSLF7nlWZc3kvw3PJjSccdXeFWTviTGfGe ZGsE+uAJV6yVkKyF0aH1Z2tevM5BtKg7d56icFNyp3BDtXH/4DHkOVOYR7ye/Y+Vor 8xixxGQuPdzwYUbzovnlzViOrsPhrqNXCvQUESS0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Arnd Bergmann , Andy Shevchenko , Nathan Chancellor , "Rafael J. Wysocki" , Sasha Levin Subject: [PATCH 4.9 14/42] ACPI: fix false-positive -Wuninitialized warning Date: Mon, 5 Aug 2019 15:02:40 +0200 Message-Id: <20190805124926.496049277@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190805124924.788666484@linuxfoundation.org> References: <20190805124924.788666484@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit dfd6f9ad36368b8dbd5f5a2b2f0a4705ae69a323 ] clang gets confused by an uninitialized variable in what looks to it like a never executed code path: arch/x86/kernel/acpi/boot.c:618:13: error: variable 'polarity' is uninitialized when used here [-Werror,-Wuninitialized] polarity = polarity ? ACPI_ACTIVE_LOW : ACPI_ACTIVE_HIGH; ^~~~~~~~ arch/x86/kernel/acpi/boot.c:606:32: note: initialize the variable 'polarity' to silence this warning int rc, irq, trigger, polarity; ^ = 0 arch/x86/kernel/acpi/boot.c:617:12: error: variable 'trigger' is uninitialized when used here [-Werror,-Wuninitialized] trigger = trigger ? ACPI_LEVEL_SENSITIVE : ACPI_EDGE_SENSITIVE; ^~~~~~~ arch/x86/kernel/acpi/boot.c:606:22: note: initialize the variable 'trigger' to silence this warning int rc, irq, trigger, polarity; ^ = 0 This is unfortunately a design decision in clang and won't be fixed. Changing the acpi_get_override_irq() macro to an inline function reliably avoids the issue. Signed-off-by: Arnd Bergmann Reviewed-by: Andy Shevchenko Reviewed-by: Nathan Chancellor Signed-off-by: Rafael J. Wysocki Signed-off-by: Sasha Levin --- include/linux/acpi.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/linux/acpi.h b/include/linux/acpi.h index ca2b4c4aec42c..719eb97217a3c 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h @@ -309,7 +309,10 @@ void acpi_set_irq_model(enum acpi_irq_model_id model, #ifdef CONFIG_X86_IO_APIC extern int acpi_get_override_irq(u32 gsi, int *trigger, int *polarity); #else -#define acpi_get_override_irq(gsi, trigger, polarity) (-1) +static inline int acpi_get_override_irq(u32 gsi, int *trigger, int *polarity) +{ + return -1; +} #endif /* * This function undoes the effect of one call to acpi_register_gsi(). -- 2.20.1