From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754302AbdH2O3a (ORCPT ); Tue, 29 Aug 2017 10:29:30 -0400 Received: from terminus.zytor.com ([65.50.211.136]:49765 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753445AbdH2O32 (ORCPT ); Tue, 29 Aug 2017 10:29:28 -0400 Date: Tue, 29 Aug 2017 07:24:19 -0700 From: tip-bot for Boqun Feng Message-ID: Cc: boqun.feng@gmail.com, torvalds@linux-foundation.org, arnd@arndb.de, dan.j.williams@intel.com, linux-kernel@vger.kernel.org, akpm@linux-foundation.org, hpa@zytor.com, rjw@rjwysocki.net, lenb@kernel.org, peterz@infradead.org, mingo@kernel.org, npiggin@gmail.com, byungchul.park@lge.com, tglx@linutronix.de Reply-To: rjw@rjwysocki.net, hpa@zytor.com, akpm@linux-foundation.org, arnd@arndb.de, dan.j.williams@intel.com, boqun.feng@gmail.com, torvalds@linux-foundation.org, linux-kernel@vger.kernel.org, mingo@kernel.org, byungchul.park@lge.com, npiggin@gmail.com, tglx@linutronix.de, peterz@infradead.org, lenb@kernel.org In-Reply-To: <20170824142239.15178-1-boqun.feng@gmail.com> References: <20170824142239.15178-1-boqun.feng@gmail.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:locking/core] acpi/nfit: Fix COMPLETION_INITIALIZER_ONSTACK() abuse Git-Commit-ID: 1c322ac06d9af7ea259098ae5dc977855207d335 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 1c322ac06d9af7ea259098ae5dc977855207d335 Gitweb: http://git.kernel.org/tip/1c322ac06d9af7ea259098ae5dc977855207d335 Author: Boqun Feng AuthorDate: Thu, 24 Aug 2017 22:22:36 +0800 Committer: Ingo Molnar CommitDate: Tue, 29 Aug 2017 15:14:38 +0200 acpi/nfit: Fix COMPLETION_INITIALIZER_ONSTACK() abuse COMPLETION_INITIALIZER_ONSTACK() is supposed to be used as an initializer, in other words, it should only be used in assignment expressions or compound literals. So the usage in drivers/acpi/nfit/core.c: COMPLETION_INITIALIZER_ONSTACK(flush.cmp); ... is inappropriate. Besides, this usage could also break the build for another fix that reduces stack sizes caused by COMPLETION_INITIALIZER_ONSTACK(), because that fix changes COMPLETION_INITIALIZER_ONSTACK() from rvalue to lvalue, and usage as above will report the following error: drivers/acpi/nfit/core.c: In function 'acpi_nfit_flush_probe': include/linux/completion.h:77:3: error: value computed is not used [-Werror=unused-value] (*({ init_completion(&work); &work; })) This patch fixes this by replacing COMPLETION_INITIALIZER_ONSTACK() with init_completion() in acpi_nfit_flush_probe(), which does the same initialization without any other problems. Signed-off-by: Boqun Feng Signed-off-by: Peter Zijlstra (Intel) Acked-by: Dan Williams Acked-by: Arnd Bergmann Cc: Andrew Morton Cc: Byungchul Park Cc: Len Brown Cc: Linus Torvalds Cc: Nicholas Piggin Cc: Peter Zijlstra Cc: Rafael J. Wysocki Cc: Thomas Gleixner Cc: walken@google.com Cc: willy@infradead.org Link: http://lkml.kernel.org/r/20170824142239.15178-1-boqun.feng@gmail.com Signed-off-by: Ingo Molnar --- drivers/acpi/nfit/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/acpi/nfit/core.c b/drivers/acpi/nfit/core.c index 19182d0..1893e41 100644 --- a/drivers/acpi/nfit/core.c +++ b/drivers/acpi/nfit/core.c @@ -2884,7 +2884,7 @@ static int acpi_nfit_flush_probe(struct nvdimm_bus_descriptor *nd_desc) * need to be interruptible while waiting. */ INIT_WORK_ONSTACK(&flush.work, flush_probe); - COMPLETION_INITIALIZER_ONSTACK(flush.cmp); + init_completion(&flush.cmp); queue_work(nfit_wq, &flush.work); mutex_unlock(&acpi_desc->init_mutex);