From patchwork Fri Jun 21 11:16:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shivamurthy Shastri X-Patchwork-Id: 13707281 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 E8425C27C4F for ; Fri, 21 Jun 2024 11:16:30 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 77D998D0153; Fri, 21 Jun 2024 07:16:30 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 72D998D00DB; Fri, 21 Jun 2024 07:16:30 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5F5448D0153; Fri, 21 Jun 2024 07:16:30 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 428A58D00DB for ; Fri, 21 Jun 2024 07:16:30 -0400 (EDT) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id E6A7DA0DB3 for ; Fri, 21 Jun 2024 11:16:29 +0000 (UTC) X-FDA: 82254642498.29.C274D7E Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by imf09.hostedemail.com (Postfix) with ESMTP id 4B015140011 for ; Fri, 21 Jun 2024 11:16:28 +0000 (UTC) Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=linutronix.de header.s=2020 header.b=dBvBso8v; dkim=pass header.d=linutronix.de header.s=2020e header.b="8sG/1VoA"; spf=pass (imf09.hostedemail.com: domain of shivamurthy.shastri@linutronix.de designates 193.142.43.55 as permitted sender) smtp.mailfrom=shivamurthy.shastri@linutronix.de; dmarc=pass (policy=none) header.from=linutronix.de ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1718968578; 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=pK4LesHt0Lj5TZzTaC1+kQyCtxKUpIst24nsrRCZsDw=; b=mBKaFMYFj1rk0/wPjD4nOmZ7JTKbe/USzNSycuFXiWZpraCU1av8QjBQ7oh+Wd8tRPSEA2 xa5RHn20Bvw6wicVA6gwetyV1DiQdUrDv48ZOC0hab2JCkczKX43ea7ZhTQyeIeq+o6Hkh TMBdInoudzR6hpiYFyysNR5v4FN2Uo0= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1718968578; a=rsa-sha256; cv=none; b=jku1QPhLVnck20XuLBFVP0uI6tar0uJV7AwbLkrNAYBfOr0us95DrUMVKrFGlGUKwuf4E9 QfjRiz6O7iPF3FoxTjomEDHAmXBRkI6TsoeZEY+tvcvqvBsbNK9xmsVB12G6aGMFf5gTtq z2/uhIMx418sIPG0zoocDPxUu6vIWCk= ARC-Authentication-Results: i=1; imf09.hostedemail.com; dkim=pass header.d=linutronix.de header.s=2020 header.b=dBvBso8v; dkim=pass header.d=linutronix.de header.s=2020e header.b="8sG/1VoA"; spf=pass (imf09.hostedemail.com: domain of shivamurthy.shastri@linutronix.de designates 193.142.43.55 as permitted sender) smtp.mailfrom=shivamurthy.shastri@linutronix.de; dmarc=pass (policy=none) header.from=linutronix.de From: Shivamurthy Shastri DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1718968586; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=pK4LesHt0Lj5TZzTaC1+kQyCtxKUpIst24nsrRCZsDw=; b=dBvBso8vUDQfZrIottnlH76/fXWBZCI93DwstMFZTpm1nmmn3WDJ7t7QABTWRvRk7IrUYe fEqbpvVExILbpfD93opZYMslIpy7fvPAjJJMqk6GAlVHNr01NRXpzpBd9xVlGBVK7uB5ER aoiJjpBQABzeBq2f08NyQukTmeLyoYs/CoahzVBDZ9ZT93O8kfi8L7zHq2b4AVP6ipf90a WpxQsAMhxa8gQ/xL8yirGgo8S80EqFbNw0WqEHgNMF8nq9AG1NVEoUuKWfj81gpMDb1KHU SnhNX3jKs18Z7j2a1hfarBdR24nhMp38+Q289BseAOQx57EmTi1hdlgB9uN9Rw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1718968586; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=pK4LesHt0Lj5TZzTaC1+kQyCtxKUpIst24nsrRCZsDw=; b=8sG/1VoA5CmoCJtREw3YK/ienn75fxYMqmbjxupDSN4kqdSecjlclY+NmZX33ap8PQZkl2 bp2uHECh/LK270Bg== To: linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: akpm@linux-foundation.org, vbabka@suse.cz, willy@infradead.org, hannes@cmpxchg.org, anna-maria@linutronix.de, tglx@linutronix.de, shivamurthy.shastri@linutronix.de Subject: [PATCH] mm/vmstat: Fix -Wenum-enum-conversion warning in vmstat.h Date: Fri, 21 Jun 2024 13:16:04 +0200 Message-Id: <20240621111604.25330-1-shivamurthy.shastri@linutronix.de> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 4B015140011 X-Stat-Signature: 67qqfbcpknm8tfp8f44wiop3herc38co X-HE-Tag: 1718968588-63457 X-HE-Meta: U2FsdGVkX1/TAqWmFRYqtHyskHvYB2HwxofD9lRyR1ol5XSajmUyw91TkVq1bhBOkx7QwMtM060f//MM4eoO2nZUQL47luGpPOx84vEfD2W989snuo4kDcgtI5NFj6T8e8P5WYK3WTYylqq8nQ8Hyq4a7QIvjwHf0tfbR5fZBCTkcKHu5PXXUhQoZVWQ4d0TEELn2e4OREBq+vBxVwrLSPxT0D1ulGj7mF2lMDLcL8FzfdgcsO6bH2OCT+7Q8PFLhqkNFasqA5QHeLgLDsumLqmDlW0ND1KakI2GdYA8e4uxd0qA/v33rq5sS2wp4EU8m8x6pQ/WUYq7KHRWcexmufoJBE235Okg6NCMgwfuwHEjG8CsHV3fNE4hf3HUWrEjlYF3kSgZUGkPdjnHJOmTuJHern2VzcSdYrUOUbpajkJfNO8uRp3yglPSS/dZUQaSU+m+GWrY7QxQX/9esRcltI907NFkw30K3HOIlUrtcEZAElZrWLS1mnXcpJDMQMsqRzO10pBrdR4tQKlyX25LLjvQwl4I9Dl5YO4kItlG7+dScFzFbEbK3D3FXNqZMu3+jnGpEQOX7FWOBt4v8RqVdJAkfLHoMG5sImmCLIr+98b2o0M+ohEHk8sJP3HTLNWt8IoGHjblyPrmgOKfZeYYOpKNY4IzelxGTL60u9QHlyFHmoJCjgfja88WFOgWE5VJS76QYyyQ/cC544g+Cgt8Evu2TdWCB6ZAwsDKQgCNn80qDu0XPE/HAabPS/nHyYxb2LcgRCcvS2qjdC7CWSJ7l0cVV8bYQE7Rd1uuXdnb2l5V9VNRGas77B9gaYBK049KAMbZppPK6tGbuzLAlCFztsyf+rFzp4QALnEF3Yoyf11Dx69leHnsPmtDR4TVYPScx/Cqybiy0BawhLl//TO/G9aoAt4avpQs0YuWbunO1kWK1VUbmRQDQ6muxKcvoucEdBVB3hNS7Fle70h2myP iNTuXF+4 dW9rnOheHng7eduGHbWpYQQN8G29e6M6LBDfvXoqlRXD/JViH8Y2uN/r7a3PbJmAcPDh8Z+HTveZV097pP0T9S/hwlepKNYa1iSWKNzup0+AWuYhUh1loEHDr6Q== 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: List-Subscribe: List-Unsubscribe: A W=1 build with -Wenum-enum-conversion enabled, results in the following build warning due to an arithmetic operation between different enumeration types 'enum node_stat_item' and 'enum lru_list': include/linux/vmstat.h:514:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion] 514 | return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_" | ~~~~~~~~~~~ ^ ~~~ Address this by casting lru to the proper type. Signed-off-by: Shivamurthy Shastri Reviewed-by: Anna-Maria Behnsen --- include/linux/vmstat.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/vmstat.h b/include/linux/vmstat.h index 735eae6e272c..72ecd46fd0c4 100644 --- a/include/linux/vmstat.h +++ b/include/linux/vmstat.h @@ -511,7 +511,7 @@ static inline const char *node_stat_name(enum node_stat_item item) static inline const char *lru_list_name(enum lru_list lru) { - return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_" + return node_stat_name(NR_LRU_BASE + (enum node_stat_item)lru) + 3; // skip "nr_" } static inline const char *writeback_stat_name(enum writeback_stat_item item)