From patchwork Fri Aug 4 01:25:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Zhang X-Patchwork-Id: 13341042 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id EC984C001DB for ; Fri, 4 Aug 2023 01:26:20 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 475AA28022C; Thu, 3 Aug 2023 21:26:15 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 118C82802B0; Thu, 3 Aug 2023 21:26:15 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D9B7F2802AD; Thu, 3 Aug 2023 21:26:14 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id A3C032802AE for ; Thu, 3 Aug 2023 21:26:14 -0400 (EDT) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 617341208CF for ; Fri, 4 Aug 2023 01:26:14 +0000 (UTC) X-FDA: 81084681468.05.6DF293D Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by imf16.hostedemail.com (Postfix) with ESMTP id E1838180017 for ; Fri, 4 Aug 2023 01:26:11 +0000 (UTC) Authentication-Results: imf16.hostedemail.com; dkim=none; spf=pass (imf16.hostedemail.com: domain of zhangpeng362@huawei.com designates 45.249.212.255 as permitted sender) smtp.mailfrom=zhangpeng362@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1691112372; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+8g1b6TftXOVa5lWHV0URGbicYA2jZG3gH15t6nxASc=; b=P82rBK7kulyT7q3uMI0MlXch4QJEGDo3NR6qhW0gTco6aWjifrXcZ6ySMLX2HyoO70ybZU oN6+VcFLsHUo5KaMMj91sJw5lvaeTCvuv5APp9zujQnxSBSCxgxo9HaTeGXgP7VkFBcgFP 2VPgcQwWJls5EVvSfqdzZwWRafzXLsg= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1691112372; a=rsa-sha256; cv=none; b=tY/zHNkKw5Q8JSxKhfle7fi0o/97Gj8A/8iobE/7WyH6omfvEsmKk0IEH44LR/DqSvweXW QSiy7BCSZsGB82pLavPc97GV0o6Gy3cHxN0VOMa6favUk1ybuCtPSuytz09rGM73kC1goH SzNlKKWd2OUDAmkGzRcU2u5iFcg6rIc= ARC-Authentication-Results: i=1; imf16.hostedemail.com; dkim=none; spf=pass (imf16.hostedemail.com: domain of zhangpeng362@huawei.com designates 45.249.212.255 as permitted sender) smtp.mailfrom=zhangpeng362@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com Received: from kwepemm600020.china.huawei.com (unknown [172.30.72.57]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4RH7LR085Qz1KCCk; Fri, 4 Aug 2023 09:25:02 +0800 (CST) Received: from localhost.localdomain (10.175.112.125) by kwepemm600020.china.huawei.com (7.193.23.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Fri, 4 Aug 2023 09:26:06 +0800 From: Peng Zhang To: CC: , , , ZhangPeng Subject: [PATCH 1/7] mm: remove redundant K() macro definition Date: Fri, 4 Aug 2023 09:25:53 +0800 Message-ID: <20230804012559.2617515-2-zhangpeng362@huawei.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230804012559.2617515-1-zhangpeng362@huawei.com> References: <20230804012559.2617515-1-zhangpeng362@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.112.125] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To kwepemm600020.china.huawei.com (7.193.23.147) X-CFilter-Loop: Reflected X-Rspamd-Queue-Id: E1838180017 X-Rspam-User: X-Stat-Signature: w1kim7indzwang19taxncsmwt5mdc4iu X-Rspamd-Server: rspam03 X-HE-Tag: 1691112371-252997 X-HE-Meta: U2FsdGVkX1+TxE/GFpUDBbSqbXS2P52p2ukJOcBbidT1UO8lgTDHc1Xpz9HSb2evEDT31FhjAPlh3lBFWMxM+r0V3q/Uffo0GthevaUMkoxUg7513WrLxpUt2gvms/5USeMDA9ktNfsIk+iYvV0DYcVCZdcXg0M6YfrWj+R5H8X2/ZofSWEmZMR05C/GUkj0z3EszskznvtK8N0jDELFe8c2cWVczPcXY+sKEMyuDYa9n/ovgFbNbteNIKkOrTtqscgNVN384DyMLOg354/srd2UFuEWyC6y4ekvYPpUjj6TQ2ra4SksX7VuqCMja7+pW3+uhXPpOAshG5tVvewFfHbhj+ee6CpRcEZ5Q3xFuqYh+4fnhSdWoPZyfsnLZM1XCs8ERyROZZ5zimXW2D28B6ATEPI3comlpHud7MM24KoCC61oBc2+MWhzgp7J0ehqbmq/VNGueWYyk/OVD3svrTLxz3mbL9dI05QQUkxgbWcNqBE9H1iox0x/6fNwfJdsRIk33EvtbaR/y0tShNOnScS7I1wraSo6bGNujjKWdR1IgjtjENwN/aNWxriTQYGo3U/07eghhQPQhOBOfx2mAN4AOp14RFESbVvM4r0rnJFTLBC/ofLSt6SyVuNHOwgYrnXfUtUxFYoiWDjCeE8DpnSgJhK8sp7stXRHxFLLc30O+QwNOdqCs96+fHDutCqILdqcJj9bPpzcqgZLb2zPtrD47t/qrbLchNBgunxT9VhjJTK1nn+fBs6MgN4ZptLBRIPSU1zxjS4dtA0P60OCB2YiQ8oJWkRDEm2Hyn9XIxR+LogNvQy8VntdNR8ec0Qv0R6wJ5TSGOu84TRLlbIeqbyjzIgdPuSzEWvmqXz5rK+SKT92hMwAXSz9oNOyN9afMVpopaZ5ZrZCaeXH6FCaseO8oNmI0Ck/lFH/PD1qy1jufC38gGnlfD+wpkyFtozuJHkgPwUyA8cUYgWH92M 3bAJX8zU qwouBDZUJDAwSewxUgeaPebVmXn/wddsJGGzapxJaZTU2LbOExUPPREm6vM+UuZEqcDkdf8GJgTHrw79eXjBtHguPAu3YEs9ZEqpXMB2bbe7rq2H6wikUyzOUBCsqKnDPK7Uec36ScQ5oe/o= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: ZhangPeng Since commit eb8589b4f8c1 ("mm: move mem_init_print_info() to mm_init.c"), the K() macro definition has been moved to mm/internal.h. Therefore, the definitions in mm/memcontrol.c, mm/backing-dev.c and mm/oom_kill.c are redundant. Drop redundant definitions. Signed-off-by: ZhangPeng Reviewed-by: David Hildenbrand --- mm/backing-dev.c | 3 +-- mm/memcontrol.c | 1 - mm/oom_kill.c | 2 -- 3 files changed, 1 insertion(+), 5 deletions(-) diff --git a/mm/backing-dev.c b/mm/backing-dev.c index 3ffc3cfa7a14..fc44bfbf785e 100644 --- a/mm/backing-dev.c +++ b/mm/backing-dev.c @@ -16,6 +16,7 @@ #include #include #include +#include "internal.h" struct backing_dev_info noop_backing_dev_info; EXPORT_SYMBOL_GPL(noop_backing_dev_info); @@ -34,8 +35,6 @@ LIST_HEAD(bdi_list); /* bdi_wq serves all asynchronous writeback tasks */ struct workqueue_struct *bdi_wq; -#define K(x) ((x) << (PAGE_SHIFT - 10)) - #ifdef CONFIG_DEBUG_FS #include #include diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 1ff51d8df84a..e290e7ed05f3 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -1626,7 +1626,6 @@ static void memory_stat_format(struct mem_cgroup *memcg, struct seq_buf *s) WARN_ON_ONCE(seq_buf_has_overflowed(s)); } -#define K(x) ((x) << (PAGE_SHIFT-10)) /** * mem_cgroup_print_oom_context: Print OOM information relevant to * memory controller. diff --git a/mm/oom_kill.c b/mm/oom_kill.c index 612b5597d3af..471061a3a0f5 100644 --- a/mm/oom_kill.c +++ b/mm/oom_kill.c @@ -479,8 +479,6 @@ static DECLARE_WAIT_QUEUE_HEAD(oom_victims_wait); static bool oom_killer_disabled __read_mostly; -#define K(x) ((x) << (PAGE_SHIFT-10)) - /* * task->mm can be NULL if the task is the exited group leader. So to * determine whether the task is using a particular mm, we examine all the