From patchwork Tue Jan 7 03:51:41 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kenny Cheng X-Patchwork-Id: 13928183 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 F222FE77198 for ; Tue, 7 Jan 2025 03:52:19 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 824A16B00A2; Mon, 6 Jan 2025 22:52:19 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 7D2256B00B0; Mon, 6 Jan 2025 22:52:19 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 64C046B00B3; Mon, 6 Jan 2025 22:52:19 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 413356B00A2 for ; Mon, 6 Jan 2025 22:52:19 -0500 (EST) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id D4F45806C0 for ; Tue, 7 Jan 2025 03:52:18 +0000 (UTC) X-FDA: 82979283156.01.4AC79D3 Received: from mail-pl1-f176.google.com (mail-pl1-f176.google.com [209.85.214.176]) by imf29.hostedemail.com (Postfix) with ESMTP id 0F2FE120004 for ; Tue, 7 Jan 2025 03:52:16 +0000 (UTC) Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=gUXQWAC7; spf=pass (imf29.hostedemail.com: domain of chao.shun.cheng.tw@gmail.com designates 209.85.214.176 as permitted sender) smtp.mailfrom=chao.shun.cheng.tw@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1736221937; 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-transfer-encoding:content-transfer-encoding: in-reply-to:references:dkim-signature; bh=rybZPDGa7aeomBfiapsYPjWOJP0BhmUMg778ab/RNWg=; b=hxAr0mpwvcgZzNJMcijJa7FJuyzjM5zVbHJSJV7W2ingYbuXlVNBsvRgu/6ut/li1Txc6I MUKkA7vY+v7m3IfSNf6b6iA7lu66o6zsaPetrh/hyXRHmZoO8HtV0tTfY2PtnxxPnnkjTy wjB/fqrR04Q5rE/5aeYeWtgXEqaWDJA= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1736221937; a=rsa-sha256; cv=none; b=e3zgpvHLWwyi7/X/BF1tErkjnu+4KbSCGKuQfBT/O6ikLJ9GSJvrwF1IEdnPK6bnpmhOL6 npDT+5RiTDvICy51dJWAPm/HQVtRjG+HN1EVeQFnyhX3GOItygNUhsltPwa+LuMi/dN4K6 +iNFL52LzAujWn74Q8RFhCyyrIfCHZ8= ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=gUXQWAC7; spf=pass (imf29.hostedemail.com: domain of chao.shun.cheng.tw@gmail.com designates 209.85.214.176 as permitted sender) smtp.mailfrom=chao.shun.cheng.tw@gmail.com; dmarc=pass (policy=none) header.from=gmail.com Received: by mail-pl1-f176.google.com with SMTP id d9443c01a7336-21a1e6fd923so22642285ad.1 for ; Mon, 06 Jan 2025 19:52:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1736221936; x=1736826736; darn=kvack.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=rybZPDGa7aeomBfiapsYPjWOJP0BhmUMg778ab/RNWg=; b=gUXQWAC7qrmCb65Fvp4DB4D9memmLhRPtA5yHRp1tBhVoA0tUdc16PTwbQBsRI3EdX mYV3rwWLbN4GbVDw6iEeOoDDqiArYMJ6QFKsgVG7AOQ4+RAeZKbpk4y9NI8JRASoAGDx qMIsZ6ngUK8mc/roiqUD1C2dBbEyBwa0Fbc2SvqundW0byBrswsFLCZIowOLu6EannzD 8v6z50OdS0dJ8544b7Kb+bqCAl3HYvxKkOqbFhStJo2edEjFxycwbUTLt7hMkTsYV0gM FPrt0YoPG5XliDODG/CE4wCUW+LR/Uo6L0s61T7/foEA0sjoFC2Yq8X5LwRv1wHq3dHI Voig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736221936; x=1736826736; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=rybZPDGa7aeomBfiapsYPjWOJP0BhmUMg778ab/RNWg=; b=K4VatTdB9dWIIM6n98IrtKbWPcWCUm7TcNUHn6CpOLNd/FHtyBIL4krManWMKii1az /+O2rOIExdj6rfnOTQyVxH0GpJWbPd49g5yRuOHz0T9XYZeQCxrGrFV4h+7M4QS/XYMq QEiWWmlKzwTYBVdFzCHbgoqfrKz2DQjnwdey5ppiiUvBeiUHgIoDPUSGEUTZmV8LHQPu vCPZBPNN2vXdtKPrFVfsz622d9dP//m8YaoHixrK7QigHEw6H3MYFwE0fPlVLMuy2dVq UTm9qthGsCRdx903mk8r3w3G11w6hkjwPOtBnJSKaJzjgLNLaT2KCwhXLzDqeVhfUYKK X4ag== X-Forwarded-Encrypted: i=1; AJvYcCWS6vBQRX550929s3+ebr1h9YdGNhrI5F5YPPZy22itx5MgMOc2ENZkcJ/s7Utv38V/DpGy9JBOVw==@kvack.org X-Gm-Message-State: AOJu0YyJ++KGHr+it1bYAUc36Fxi8eiwojNNZFL3p6/OYok9DDBim6jr BVKM47cczQlvFaurUzvwKnUAdoKD2ohhYiaRuIMlw5cXy7N1phqk X-Gm-Gg: ASbGncvAfEcIOo0lhoZ5SKT9SILYvsie2zhLX0J5Z1GKl4gO4ciD/J570Cm8XX7wQXh Yj+A2EDsfyxu/Sjn/MUGhtuk37jzIa+uB/puzsS/qWezqB2rPDDiXMXtvgudBPkFy4u2g1as5A5 3yVIdllRkUI9Rbr3zrB54TS/FJZrJ3nHOFd8D9qBdMhNWnUrCQzHZJ2Hp9zaIEX+zs8/48ogSdP f9c6Q/q9rKW39sc+NjQF6MMywB9fYDlXi2kfcm2z9ZxJrL/8NxC7li4a++r0o5YblIiVCP5ge0+ ojyc1nM7YR9FR0B4kesph4uI8TA= X-Google-Smtp-Source: AGHT+IE7kzSJJggL6Z8KiIHBRhsXBS9mADY4GGN8p4TBnMlDpGNKsc5uJ8wb8XO4YzWO7Ps2FK1ZkA== X-Received: by 2002:a17:903:22c6:b0:216:2474:3c9f with SMTP id d9443c01a7336-219e6f38177mr898724415ad.52.1736221935819; Mon, 06 Jan 2025 19:52:15 -0800 (PST) Received: from mm2dtv09.. (60-251-198-229.hinet-ip.hinet.net. [60.251.198.229]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-219dc9f6251sm293848655ad.207.2025.01.06.19.52.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jan 2025 19:52:15 -0800 (PST) From: Kenny Cheng To: hannes@cmpxchg.org, muchun.song@linux.dev Cc: cgroups@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, c.s.cheng@realtek.com, Kenny Cheng Subject: [PATCH] mm: avoid implicit type conversion Date: Tue, 7 Jan 2025 11:51:41 +0800 Message-Id: <20250107035141.2858582-1-chao.shun.cheng.tw@gmail.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Rspamd-Queue-Id: 0F2FE120004 X-Rspam-User: X-Rspamd-Server: rspam07 X-Stat-Signature: f8jqa5qi38bdkp994751wiigoysf9gqg X-HE-Tag: 1736221936-370146 X-HE-Meta: U2FsdGVkX18VJDvmopxh+9mIAIP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3GQoW9ImXBEFUhKOY+k7n9KErLg+dGC+Artu8JvOZvCd8XBTSCTd+KLF+6AS2C7hcMv+Q50ajOMmpP/TT2xOFISqW6DsbMRu7zwum4aJbPN1ZRLicz5c6Qj2Pq5bUs4Q5HLObcNTwlox1wDF6YohDk69HqEcythPq7c1j+FG/6ndcoOeWrAsTIx9qgZMjNPc1UxfDevy7SbDXr0zUqH1vwgO2RpgMa0rtbStBIqdodbycz7bZIVJCI2681lmi+z1KbLhraPvjvNIioBLZ2X5j5rgoYZIiyL2ajYQ0aOyRgRuMV1QdWzxtIzj3Q/heHpBI2LBXiscK9ZsQcvvKIUY2h0NPRhsjLB1Ogmq+7 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000025, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: The function 'task_in_memcg_oom' returns a 'struct mem_cgroup *' type. If the compiler does not inline this function, a compile error occurs, as shown below: ./include/linux/memcontrol.h:961:9: error: incompatible pointer to integer conversion returning 'struct mem_cgroup *' from a function with result type 'unsigned char' [-Wint-conversion] This patch avoids the implicit type conversion by ensuring the return type is correct. Signed-off-by: Kenny Cheng --- include/linux/memcontrol.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index 5502aa8e138e..47acf1e4f5a7 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h @@ -1826,7 +1826,7 @@ bool mem_cgroup_oom_synchronize(bool wait); static inline bool task_in_memcg_oom(struct task_struct *p) { - return p->memcg_in_oom; + return !!p->memcg_in_oom; } static inline void mem_cgroup_enter_user_fault(void)