From patchwork Thu Aug 24 14:22:36 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Boqun Feng X-Patchwork-Id: 9920305 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3214B60349 for ; Thu, 24 Aug 2017 14:27:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2737A28643 for ; Thu, 24 Aug 2017 14:27:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1BDA228927; Thu, 24 Aug 2017 14:27:35 +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=-6.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AC98D28643 for ; Thu, 24 Aug 2017 14:27:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753695AbdHXOWX (ORCPT ); Thu, 24 Aug 2017 10:22:23 -0400 Received: from mail-pg0-f66.google.com ([74.125.83.66]:34088 "EHLO mail-pg0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753008AbdHXOWV (ORCPT ); Thu, 24 Aug 2017 10:22:21 -0400 Received: by mail-pg0-f66.google.com with SMTP id p14so4134926pgd.1; Thu, 24 Aug 2017 07:22:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ObYJ0jn9xLjm2eTycpy3MEQYdDNU1Bi8+ih1LfsSpYk=; b=TXcABK+cfCdx/ifnQBKcWbLvMG8QI8Udsdq1PLkaTFPSWMgJiIN/BjqqPnTbxTuuMl CZzv9aloc5cBDrqbSzIX5n/MGIZne6tMftXhrm4I28IQQZ4LkQqoVDi5c6SLPQ+tsuRq vqQVJb3r7lQ3aQThRcPa5llXV62CvHG3Ov3OvJa90vPeHk00R2hk2yC5uo/NJr3sHPw/ wDUekDlwjO0rDwqAfhBjNFsXP9VtdViP/l4tBvAEm9cKSBrhliHAXE8FiF/LeIsap7LP Te2M7UmWIR5or0kOtfEpE/X5mD5EtTPCChWQSTUtGKEyFeQOV7kkxGYrbQBpHU+NGI2s 10Aw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ObYJ0jn9xLjm2eTycpy3MEQYdDNU1Bi8+ih1LfsSpYk=; b=UhzqBNz55zaIvn3tgkgsBkekIDRnRltLyZXjfZLh8AwlTYMfzGk4bxukmBl/ckDS1M aOslTDYlpSw1sZtR+6eA0igwe+Wo7b/IMmknUr2aKw3aO3aHUSH8eM7X6W5L2XV/ADtt 33/KVI1mTN/uF0XvJwj2vrML3l+Ktu48e4ZhsRB8DifiIDJYDJbYirSjasgjiGnrEj7A RKWv3PC5c6MlyY9PfCR7mcA/O3lltPIirswt5vz4IvHqIEfSiLRRyeiTbZtrgfcgFAez lRK+n5ubAwsx0I3WZbHkf41fqwjAg0sds76FrbypKmhPvBXCfoVEgX+Yt4j8SRiIWuL2 /r3g== X-Gm-Message-State: AHYfb5hmSAHzXXe4ayy7VrDi3WSZLmbV7YFQ1IzFHK7PVpe9IwutvHw8 PliWdOZkC3SQ8N+3htI= X-Received: by 10.98.215.30 with SMTP id b30mr69268pfh.139.1503584540591; Thu, 24 Aug 2017 07:22:20 -0700 (PDT) Received: from localhost ([45.32.52.191]) by smtp.gmail.com with ESMTPSA id n19sm7964162pfi.35.2017.08.24.07.22.19 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 24 Aug 2017 07:22:20 -0700 (PDT) From: Boqun Feng To: linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: Peter Zijlstra , Ingo Molnar , Thomas Gleixner , walken@google.com, Byungchul Park , Arnd Bergmann , Andrew Morton , willy@infradead.org, Nicholas Piggin , kernel-team@lge.com, Boqun Feng , Dan Williams , "Rafael J. Wysocki" , Len Brown , linux-nvdimm@lists.01.org, linux-acpi@vger.kernel.org Subject: [PATCH v2 1/2] nfit: Fix the abuse of COMPLETION_INITIALIZER_ONSTACK() Date: Thu, 24 Aug 2017 22:22:36 +0800 Message-Id: <20170824142239.15178-1-boqun.feng@gmail.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20170823152542.5150-2-boqun.feng@gmail.com> References: <20170823152542.5150-2-boqun.feng@gmail.com> Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP COMPLETION_INITIALIZER_ONSTACK() is supposed to 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 compilations for another fix to reduce stack sizes caused by COMPLETION_INITIALIZER_ONSTACK(), because that fix changes COMPLETION_INITIALIZER_ONSTACK() from rvalue to lvalue, and usage as above will report 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 problem. Signed-off-by: Boqun Feng Acked-by: Dan Williams --- 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 19182d091587..1893e416e7c0 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);