From patchwork Mon Mar 13 05:39:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kefeng Wang X-Patchwork-Id: 68635 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp1013581wrd; Sun, 12 Mar 2023 22:32:55 -0700 (PDT) X-Google-Smtp-Source: AK7set+UffqFYGS7yM6X4Da0fDGzoGJU7pLWAxq28b3nZSPDUe4omBFJG8NO6KbLSBC5mTGOD6wG X-Received: by 2002:a17:902:b20d:b0:1a0:4046:23f2 with SMTP id t13-20020a170902b20d00b001a0404623f2mr2505364plr.56.1678685575238; Sun, 12 Mar 2023 22:32:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1678685575; cv=none; d=google.com; s=arc-20160816; b=kdL1QWhjMgajzNK0k56ooImAbymZtAR4xxbHIiG6d3Rrtk6TfTCVkggvO6PRIIEII1 HGo/sINSqCmb3WrI7NyKUr0U5ox+V4msxzzbslcdUIzqFfL7rI4zBL6z8Be4++YmpUhr RL++CzuNXvAahBJB4CTHfsJirNPC4ID81x8Mn23lokjS/bvQ3dQyUU4op4IqOmM3DGH8 ZqC6Z84f9PQdT+sV+/nzGQzk47O4nvzcF7OF61rZkIU2biEJdM6p1AQpXgm+mChiZXKT b6wRiDTfueySB+3N8UQ7czVHaU9FQCA0lPsv25XYJFlg11kqtV+sMUDlwFj99zhl4mnG eOuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=Qc+7l53T2AmwSlpMmFCb7oHAq0dzbh4QTSbD/vU/8Fw=; b=L7zC47LjnS6O2iTtirkxp5Db3XIa8W3OnrXTQj+0CGYem9aJmHHe5V3jsLZ5Xf1pVG sLPbizN+Sc9DpZ9oJQE5jAwHK4KyQbJInD/2gu4f5mvOvvyhE2BWjcHEPqZTNFnx6owb iJatWr3vrKnHro0OsXw4xsB+yRGy/ddTQm64h4LBu9iiltLlnqN3DWklQbm8SjQlDwn5 MZslp0o+dlAw10i7PM4ol7zt57yisK7Zd9fRpwrBD3zBgMCVsUGwfiGakJIe1wXtht1M JmefS0xuOzPBpXNNyXavojPPP48K8S5aFv5MhB6wb7Z3wmGr+NftgRbdcXGR27ZaEYBF bWBA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p24-20020a1709028a9800b0019f28f4a6c3si4690445plo.478.2023.03.12.22.32.37; Sun, 12 Mar 2023 22:32:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229642AbjCMFTL (ORCPT + 99 others); Mon, 13 Mar 2023 01:19:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35178 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229552AbjCMFTK (ORCPT ); Mon, 13 Mar 2023 01:19:10 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9EB3D3BDA7 for ; Sun, 12 Mar 2023 22:19:09 -0700 (PDT) Received: from dggpemm500001.china.huawei.com (unknown [172.30.72.54]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4PZlHG5nrzzSkZh; Mon, 13 Mar 2023 13:15:54 +0800 (CST) Received: from localhost.localdomain.localdomain (10.175.113.25) by dggpemm500001.china.huawei.com (7.185.36.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21; Mon, 13 Mar 2023 13:19:06 +0800 From: Kefeng Wang To: Naoya Horiguchi , Andrew Morton , CC: Miaohe Lin , , Kefeng Wang , David Hildenbrand Subject: [PATCH v2] mm: memory-failure: directly use IS_ENABLED(CONFIG_HWPOISON_INJECT) Date: Mon, 13 Mar 2023 13:39:29 +0800 Message-ID: <20230313053929.84607-1-wangkefeng.wang@huawei.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20230310133843.76883-1-wangkefeng.wang@huawei.com> References: <20230310133843.76883-1-wangkefeng.wang@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.113.25] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To dggpemm500001.china.huawei.com (7.185.36.107) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1760229406089130762?= X-GMAIL-MSGID: =?utf-8?q?1760229406089130762?= It's more clear and simple to just use IS_ENABLED(CONFIG_HWPOISON_INJECT) to check whether or not to enable HWPoison injector module instead of CONFIG_HWPOISON_INJECT/CONFIG_HWPOISON_INJECT_MODULE. Reviewed-by: David Hildenbrand Acked-by: Naoya Horiguchi Signed-off-by: Kefeng Wang --- v2: - add Ack/Rb, also update the suject/changelog suggested by Andrew mm/memory-failure.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/memory-failure.c b/mm/memory-failure.c index fae9baf3be16..f761704d27d7 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -168,7 +168,7 @@ static bool page_handle_poison(struct page *page, bool hugepage_or_freepage, boo return true; } -#if defined(CONFIG_HWPOISON_INJECT) || defined(CONFIG_HWPOISON_INJECT_MODULE) +#if IS_ENABLED(CONFIG_HWPOISON_INJECT) u32 hwpoison_filter_enable = 0; u32 hwpoison_filter_dev_major = ~0U;