Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5645156imu; Mon, 26 Nov 2018 03:27:45 -0800 (PST) X-Google-Smtp-Source: AFSGD/Xqr7VOWzT4rTAdmQo9tdh40y9zXYXab4SfIbJJu8vaB5mZ2IMYJ9BajceKJGa6VT+9MjKk X-Received: by 2002:a62:931a:: with SMTP id b26mr21760564pfe.65.1543231665172; Mon, 26 Nov 2018 03:27:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543231665; cv=none; d=google.com; s=arc-20160816; b=ngsq1D1wEaQNMy5ptUn7THwXoSTx2IpsPL7aViW/1wpeF/p0tc32/mbOaCmuU/qNUs AY/d6AXk2F6OIGlVxGGUfz5J5e+zghfehJXgsLnT/CM3Mzbp5uSlXEYaTYxkh3r+bzY2 Ze5lIM0qDyBegi9a32V/qS8+3xvkjLzoy2PfPFx8aaCEWUAPRgg3uOXWRmL6oZ+b3FBC aYE39tQBfT3PT0qZubrioQbEe1S+xmhCrLqKE7I5KazAHKEhfZLmybBC4VDympnGacUL sqOMqSNdxfjZfYu34MpRwaBbtrWCzB+D41wGldJYQ05Y/a+qmp/rswW+xWvnO/Ff4/j8 amGQ== 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=zI7191hAikGv36smyquY7fwQXowmXa7n7oIexhRYjmM=; b=mZDjXXxI/ECW7zBt4SCXwwUBBI1nUVAqy5bl3FLioUua+KiI64llxu4xOierPwyySn IZl3bX7i3TWfZQjumU/e2nmTJ/mWB3DE8dpE9U+pnWtTixv9QcLd3liTYmT8+L+LaRU1 C/QW0V0qTfUTHV4uhwjIKdwJVjx0tpVK1uwy3v/B7YHDTVK5fOzIuvEUxmFZut5KydxP /tmTAYGaCPXbx2R4Bf3Chg/fL72hBqrUpBoDOh+PdqHnHzaNfmXKjFKGq+XZ5qnYjnAf fxMrYw5DAGvrp5kAGREdTIerImGHHRUNvWC67bkaEWrt4V14ck/UELn67y7d8mbjeN/7 zNRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=uNPMeN1X; 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 9si45725plc.40.2018.11.26.03.27.21; Mon, 26 Nov 2018 03:27:45 -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; dkim=pass header.i=@kernel.org header.s=default header.b=uNPMeN1X; 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 S1727447AbeKZVsL (ORCPT + 99 others); Mon, 26 Nov 2018 16:48:11 -0500 Received: from mail.kernel.org ([198.145.29.99]:56608 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726254AbeKZVsK (ORCPT ); Mon, 26 Nov 2018 16:48:10 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.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 DE79021104; Mon, 26 Nov 2018 10:54:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1543229666; bh=gdH0QmvCJ5Nja+lqUc04m4IcGbDxoULBnYVU6GxJ5DY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uNPMeN1X43Q9Rkn9OpAsR3i8A1VYmXXL72YpEyo9jNBCmDSPm8ZTlxHFRKEY5Oag+ Ew8WeMP1a9GdVsYzUNY8DHB8KMj2yG6OZcaHPlUrlHAHYiuCPW5vtHmuOfRHzvztCD 44I7bx1Ke2FXsC8XjJ+TqVH2j2svaMP9br6G3jmg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Prasad Sodagudi , Masahiro Yamada , Nathan Chancellor Subject: [PATCH 4.4 25/70] kbuild: clang: disable unused variable warnings only when constant Date: Mon, 26 Nov 2018 11:50:40 +0100 Message-Id: <20181126105049.227591290@linuxfoundation.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181126105046.722096341@linuxfoundation.org> References: <20181126105046.722096341@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review 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 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Sodagudi Prasad commit 0a5f41767444cc3b4fc5573921ab914b4f78baaa upstream. Currently, GCC disables -Wunused-const-variable, but not -Wunused-variable, so warns unused variables if they are non-constant. While, Clang does not warn unused variables at all regardless of the const qualifier because -Wno-unused-const-variable is implied by the stronger option -Wno-unused-variable. Disable -Wunused-const-variable instead of -Wunused-variable so that GCC and Clang work in the same way. Signed-off-by: Prasad Sodagudi Signed-off-by: Masahiro Yamada Signed-off-by: Nathan Chancellor Signed-off-by: Greg Kroah-Hartman --- Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) --- a/Makefile +++ b/Makefile @@ -706,7 +706,6 @@ KBUILD_CFLAGS += $(stackp-flag) ifeq ($(cc-name),clang) KBUILD_CPPFLAGS += $(call cc-option,-Qunused-arguments,) -KBUILD_CFLAGS += $(call cc-disable-warning, unused-variable) KBUILD_CFLAGS += $(call cc-disable-warning, format-invalid-specifier) KBUILD_CFLAGS += $(call cc-disable-warning, gnu) KBUILD_CFLAGS += $(call cc-disable-warning, address-of-packed-member) @@ -724,9 +723,9 @@ else # These warnings generated too much noise in a regular build. # Use make W=1 to enable them (see scripts/Makefile.extrawarn) KBUILD_CFLAGS += $(call cc-disable-warning, unused-but-set-variable) -KBUILD_CFLAGS += $(call cc-disable-warning, unused-const-variable) endif +KBUILD_CFLAGS += $(call cc-disable-warning, unused-const-variable) ifdef CONFIG_FRAME_POINTER KBUILD_CFLAGS += -fno-omit-frame-pointer -fno-optimize-sibling-calls else