From patchwork Fri Nov 15 23:57:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Keren Sun X-Patchwork-Id: 13877412 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 81E1CD68BDD for ; Fri, 15 Nov 2024 23:58:00 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id ECACF9C0019; Fri, 15 Nov 2024 18:57:59 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id E53CD9C0018; Fri, 15 Nov 2024 18:57:59 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CCE5E9C0019; Fri, 15 Nov 2024 18:57:59 -0500 (EST) 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 AA81A9C0018 for ; Fri, 15 Nov 2024 18:57:59 -0500 (EST) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 5564EA0937 for ; Fri, 15 Nov 2024 23:57:59 +0000 (UTC) X-FDA: 82789994658.29.0B34EF2 Received: from mail-yb1-f202.google.com (mail-yb1-f202.google.com [209.85.219.202]) by imf11.hostedemail.com (Postfix) with ESMTP id 8F0C840002 for ; Fri, 15 Nov 2024 23:57:00 +0000 (UTC) Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=d2SAft2j; spf=pass (imf11.hostedemail.com: domain of 3BOA3ZwgKCOMPJWJSXZSLTTLQJ.HTRQNSZc-RRPaFHP.TWL@flex--kerensun.bounces.google.com designates 209.85.219.202 as permitted sender) smtp.mailfrom=3BOA3ZwgKCOMPJWJSXZSLTTLQJ.HTRQNSZc-RRPaFHP.TWL@flex--kerensun.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1731714988; 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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=8v8w47B/bBInLDR9iMbQaYJ5893IHUb3TRGhZ/es2aI=; b=JL8TBm009aFgxrLtikd0+cgF2/7pwo0h3HzkQfLUZELBi9IzdCOGGdvQP/CEizUn1jxG0X OG0epTTVdLulhkcU+2lUTifusKwEnqhRbBxQ/VV6dCF1f4jOinYDhvoBJA/r223Yb9V2ya 0FQnfT9ir18f8t88dOV4KxbYtk/rb30= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1731714988; a=rsa-sha256; cv=none; b=dFGR6V8gubDstT3lnjcyA04uNl4XJrfuZ4OXl/gGDVXBmd9esQ/8G6Tz/8wMnkRfeSMpVn qoPm2hMpJpLWDvd/2bTLv8aH/wtzYtjK6F31EuCTPzv1egv8FBfxbyedvjq5Q4ytnegqce bE8rKYvLmyXwdkH0iRMpTWDYaVGfDF4= ARC-Authentication-Results: i=1; imf11.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=d2SAft2j; spf=pass (imf11.hostedemail.com: domain of 3BOA3ZwgKCOMPJWJSXZSLTTLQJ.HTRQNSZc-RRPaFHP.TWL@flex--kerensun.bounces.google.com designates 209.85.219.202 as permitted sender) smtp.mailfrom=3BOA3ZwgKCOMPJWJSXZSLTTLQJ.HTRQNSZc-RRPaFHP.TWL@flex--kerensun.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com Received: by mail-yb1-f202.google.com with SMTP id 3f1490d57ef6-e30b8fd4ca1so3281272276.3 for ; Fri, 15 Nov 2024 15:57:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1731715076; x=1732319876; darn=kvack.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=8v8w47B/bBInLDR9iMbQaYJ5893IHUb3TRGhZ/es2aI=; b=d2SAft2jBlHM7xlzWJW0LqFwog9WzzLuwi/BRftXtGzYPR+MsTIGMxGUzSHswvVnLg xYlzHLz9UcXQH9hOOb0gwJGratzzXHb4jOnNJocTAe3xTjBh40B/YDn1mv1iLn+0aU9x Ib3YFD61f/Fj2BDcOlVkqC9tY4dO+PN3uBJPwV8EnaOVIZSKcofTz6VLJILFLPyp/290 nDlngA2wDb6iM3ka/+9D9ogUaXbRh8eUpMIgTMcBMogJK5ytqfF8/dJUQKbXveeOxz4A kxcmQFJIgg0L9+JKAD/YTM4EIJ7wgBj9tKIesYHNE8ltxD17XSVuqpvKqIKEwU5yEzs9 EuUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731715076; x=1732319876; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=8v8w47B/bBInLDR9iMbQaYJ5893IHUb3TRGhZ/es2aI=; b=SffkNHhylzoFnzpPoEtCMG7LrVHWLHD67vl3fjQRmFSV5nFG5crFNFWBGmEa6mfd2Q D/Aij+tZxT3gW5+dIk7YX7kdNIAJEmuBtFuOFjlXbF/hbv9BzkXbUyRraNoeKowKVyR0 YAql1OsK0Gfocz+nXr6EnyQmRg4J7oggaZnCKp+YjTqUpwUNZ8vnRhVnZ/90DSKiOd6t zxeX9a+ek27F/tWZWkKj7LPMQkGXSVuftGAFfCB2Y345Ta6YtUgUr9/Vmz3I7ZZfQEE+ rT2HOsxMX970qJViu7++MVpbtZz7UtZAk29W+zK+AfCvWae9/MTes6AFi/jkNoQXEK+k cg+w== X-Forwarded-Encrypted: i=1; AJvYcCXz3nJsnnEs5afPUqWd3cDmVqn+YoGdxBLjftrDz8gxVCY13020EX9H6ze9NhjlgmUtOokNn7Ot7A==@kvack.org X-Gm-Message-State: AOJu0YzFmyQI5yUulRClLkEg0zdBw8iNA09xeF2GzC82azzhYeADA8jg Exo2aEfgxoWFL1MSPEEnZXqNDgGEtwJr5hbnsqPFDmzVcuzQHtBhCSqcynCauf27FDGnTabzqed qA/6JsNzGUw== X-Google-Smtp-Source: AGHT+IH4TgoU+sKXZ0e1vdMN9iVrwBlb5RZLub5gn85SQYiErjlQ2PRdfhYiBYV7ArscR5hQT2dD43dztdIdSA== X-Received: from kerensun.svl.corp.google.com ([2620:15c:2c5:11:f2d6:8e6c:5a90:ef1e]) (user=kerensun job=sendgmr) by 2002:a25:bb0e:0:b0:e38:2136:9482 with SMTP id 3f1490d57ef6-e3826614e75mr3788276.10.1731715076563; Fri, 15 Nov 2024 15:57:56 -0800 (PST) Date: Fri, 15 Nov 2024 15:57:42 -0800 In-Reply-To: <20241115235744.1419580-1-kerensun@google.com> Mime-Version: 1.0 References: <20241115235744.1419580-1-kerensun@google.com> X-Mailer: git-send-email 2.47.0.338.g60cca15819-goog Message-ID: <20241115235744.1419580-2-kerensun@google.com> Subject: [PATCH 1/3] mm: prefer 'unsigned int' to bare use of 'unsigned' From: Keren Sun To: akpm@linux-foundation.org Cc: roman.gushchin@linux.dev, hannes@cmpxchg.org, mhocko@kernel.org, shakeel.butt@linux.dev, muchun.song@linux.dev, cgroups@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Keren Sun X-Rspamd-Server: rspam10 X-Stat-Signature: jmo7dc6sx6dbpzd4sb3wjttd5ksc8xed X-Rspamd-Queue-Id: 8F0C840002 X-Rspam-User: X-HE-Tag: 1731715020-180875 X-HE-Meta: U2FsdGVkX197YYjU/KgjGwFzMb9IlmA66dfbfxCfH4lq21mNAW7UU0G7Ix3kqYBCFnRcH6hxBjF3iztYpL3xjCI5y409HOkE8HAtXD+82VkXPRJq0ttafc9VZv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+eIZZuYdHJLM71T3whtUPzfvqg1dlM9q9NDSTrSNrf/yyLj6DlLDjdpLlAu6r+MFKKU11/N+t/aLSoFau2qmdp4Rh6Guwa7o7bYK1mDKsDF79AEDEMx7j3rkzMPZWjmjlA6IrBnCNL2/jepk4EO3tMXnCfY7v12qc7cOHQYUkALf/Be7Q32q6AovbEWxRsWHfGrtEf2E9PC53unTZWlrJWus8KOC6AfGvqYrfWSdGwiFdr4H5FfEjh0F2lWjJnxrMbwATjvmp/1q6f+pYVHYUDgwDIg2a2/e64rGxq/ksUz3y70b/A6zi1n+8wJxVWfRxuF9JRoeTmYl/SrwSTKDsSHCThyHxp9vZodSmNOLzZUMJfdaQQw== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000078, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Change the param 'mode' from type 'unsigned' to 'unsigned int' in memcg_event_wake() and memcg_oom_wake_function(), and for the param 'nid' in VM_BUG_ON(). Acked-by: Shakeel Butt Signed-off-by: Keren Sun Reviewed-by: Roman Gushchin --- mm/memcontrol-v1.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mm/memcontrol-v1.c b/mm/memcontrol-v1.c index 539ceefa9d2d..465201ef40b7 100644 --- a/mm/memcontrol-v1.c +++ b/mm/memcontrol-v1.c @@ -899,7 +899,7 @@ static void memcg_event_remove(struct work_struct *work) * * Called with wqh->lock held and interrupts disabled. */ -static int memcg_event_wake(wait_queue_entry_t *wait, unsigned mode, +static int memcg_event_wake(wait_queue_entry_t *wait, unsigned int mode, int sync, void *key) { struct mem_cgroup_event *event = @@ -1216,7 +1216,7 @@ struct oom_wait_info { }; static int memcg_oom_wake_function(wait_queue_entry_t *wait, - unsigned mode, int sync, void *arg) + unsigned int mode, int sync, void *arg) { struct mem_cgroup *wake_memcg = (struct mem_cgroup *)arg; struct mem_cgroup *oom_wait_memcg; @@ -1658,7 +1658,7 @@ static unsigned long mem_cgroup_node_nr_lru_pages(struct mem_cgroup *memcg, unsigned long nr = 0; enum lru_list lru; - VM_BUG_ON((unsigned)nid >= nr_node_ids); + VM_BUG_ON((unsigned int)nid >= nr_node_ids); for_each_lru(lru) { if (!(BIT(lru) & lru_mask))