From patchwork Thu Jan 9 17:38:38 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muhammad Usama Anjum X-Patchwork-Id: 13933060 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 88CA6E77197 for ; Thu, 9 Jan 2025 17:40:09 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1E9E96B0083; Thu, 9 Jan 2025 12:40:09 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 19A056B00A7; Thu, 9 Jan 2025 12:40:09 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 03A926B00A8; Thu, 9 Jan 2025 12:40:08 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 9BCA26B0083 for ; Thu, 9 Jan 2025 12:40:08 -0500 (EST) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 4A5611A02FB for ; Thu, 9 Jan 2025 17:40:08 +0000 (UTC) X-FDA: 82988626896.04.9922530 Received: from sender4-pp-f112.zoho.com (sender4-pp-f112.zoho.com [136.143.188.112]) by imf08.hostedemail.com (Postfix) with ESMTP id 588DD160020 for ; Thu, 9 Jan 2025 17:40:06 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=collabora.com header.s=zohomail header.b="JO/5voGX"; arc=pass ("zohomail.com:s=zohoarc:i=1"); spf=pass (imf08.hostedemail.com: domain of usama.anjum@collabora.com designates 136.143.188.112 as permitted sender) smtp.mailfrom=usama.anjum@collabora.com; dmarc=pass (policy=none) header.from=collabora.com ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1736444406; 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:in-reply-to:references:references:dkim-signature; bh=rFE3LTCLLZcWDz1roRpcEOSHGmZKQ3KY8sj8JWlAwYo=; b=1tG78llIZAknGcSB9s7Q3W8tzjmR9XqqOovmFVwP6hmWsj7qJ4QzNbNtIWwD3t+Gt58go/ hhK5q/hZu7nC6uHkCiKCh1yvfCl5SRFptyOxS54moy2OL51E6HDqSlmmv5l6MQWy9FrPd7 OMYXDGV7MyQa7idALpfvvC4cqNhuBNQ= ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1736444406; a=rsa-sha256; cv=pass; b=KdGaGbys9ehOOMNG+pSZVEMEZYSQcC5JrP882+ECleEjgj+zij0x21r9LQHHtAeezgLMpZ P1oQAyhnqklASuReTUigXSqS5YaLJFSnM15NE4WE+P1EAEjff0xnnUinyVMi8PhOA7S9vK lZKOq0G4VQr0B1BXM7mNvmhGNfiZR2U= ARC-Authentication-Results: i=2; imf08.hostedemail.com; dkim=pass header.d=collabora.com header.s=zohomail header.b="JO/5voGX"; arc=pass ("zohomail.com:s=zohoarc:i=1"); spf=pass (imf08.hostedemail.com: domain of usama.anjum@collabora.com designates 136.143.188.112 as permitted sender) smtp.mailfrom=usama.anjum@collabora.com; dmarc=pass (policy=none) header.from=collabora.com ARC-Seal: i=1; a=rsa-sha256; t=1736444390; cv=none; d=zohomail.com; s=zohoarc; b=FI2ZpYM2l2lhH4e/ZoKt+g/s4GJCa4puWKr6Q/8iqSEeXqL8P3ua7YLIb98EGDrUsPuTYuAFMxzPMnVnZiXRSId0OdrQGPVH1Qeh43IuFdtrS9FMxClLFXMWYf1gQIOF+nzHlFRF5KL4Zv6ty7BwwLofHU+QCcsU3eG/m+gBzCc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1736444390; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; bh=rFE3LTCLLZcWDz1roRpcEOSHGmZKQ3KY8sj8JWlAwYo=; b=JzZW+JZQeRsw6idAdw7Xnes1PyvMbbgbY3zN2DJn/SntKedZYSeCT+VE7qyPOy/lpiWeW5Ci+Hcgy1LXw6g74SPtPbmP2OUBKvSBl4q/Jb51UKXKEipl8oEP6zh0BoWeU8ruLTqtUNFnLhxUJavNp4UsIkdCuaDxfTcWMDKz5Hk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=collabora.com; spf=pass smtp.mailfrom=usama.anjum@collabora.com; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1736444390; s=zohomail; d=collabora.com; i=usama.anjum@collabora.com; h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-Id:Message-Id:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Reply-To; bh=rFE3LTCLLZcWDz1roRpcEOSHGmZKQ3KY8sj8JWlAwYo=; b=JO/5voGX2w0I8SSOy2/ZpKge+LyWYMK4YtdngTqOXAwJ7JdherhUWOJQy/V4sb+6 cyh55owN4fMOGxrGEXdV5nu6nIQdCz9KtvBOvDboghRYJN7AOTVWsOepSOjBmLsj1hy BTGrO39cuFi69MUD1212zJdAsZAaDSPOLSJrvGUc= Received: by mx.zohomail.com with SMTPS id 1736444388075563.3499694648385; Thu, 9 Jan 2025 09:39:48 -0800 (PST) From: Muhammad Usama Anjum To: Kees Cook , Andy Lutomirski , Will Drewry , Shuah Khan , Andrew Morton , =?utf-8?b?SsOpcsO0bWUgR2xpc3Nl?= , linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: Muhammad Usama Anjum , kernel@collabora.com Subject: [PATCH 12/16] selftests/mm: khugepaged: Fix type mismatch warnings Date: Thu, 9 Jan 2025 22:38:38 +0500 Message-Id: <20250109173842.1142376-13-usama.anjum@collabora.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250109173842.1142376-1-usama.anjum@collabora.com> References: <20250109173842.1142376-1-usama.anjum@collabora.com> MIME-Version: 1.0 X-ZohoMailClient: External X-Rspamd-Queue-Id: 588DD160020 X-Rspam-User: X-Rspamd-Server: rspam07 X-Stat-Signature: 1pr9abgwztn6tcxr88egjwd9tmcinx4f X-HE-Tag: 1736444406-98673 X-HE-Meta: U2FsdGVkX1/eiMfrREhv/Ng/HsGLir1UuIAheaiycU3LHeOo5OdQnXshwq2hRBur6IVrMLhy3zelpbt+i1M/hEg3UDzcfcnF381uUYG1x5yxCUCbdlqBbDReRcqwU+LwSbmSyKKV2CBJ7TqR9auDVmSoHIi64NIzyxk2H1ZXSTHohJUPz2rtSLAOGaRWtbFx84m7DqHi/o+neY/cdllcEl3wwXJeOfLZ/L1TGvsgFookTvM+qsrNxe10V6mFjjOHBQIAblq1RBZLn8JWe0ForRQncNuafBQ0P/C+lwFnbV17zwoG/luR5Sa6ggj2hio4et4bb+9vVoCTagkzMJVtKg3SI9csqmLVjrWrxfbfFZIA6GKVQLHeDBn6ZGFy+zitMsLgZ27z9ad6X5ke7DFqgBidtb1nH5iw6dzresJBwlTZzvqcKWcdHimHvwZRKRMKpxrwYNmWcbUinjBGciMq9YylQ04Akvauy7wgPJagzEB4f0/KCVjZxJkDUbN5DP7/jpttwHEd5moEvvkdxCp+VmTLqBUu3E2Wk8wK+ZbmkAah5Je+B/GVh2XLUFWEI30h4+cycBfzcsBlAPN1CL1tQz6/V2JVDOf1F4dYXiWCtLQANr7HbOWVRyPdzi6UV4hhf6aZT+HGHNvwGiZkbSttjZ5wrLdoKlSeyVr9MIsW7Fbsc/25ot1dKEyr60qvJOA82FAQxNUPkWoixEQUBNsQ3nDWGBFXtXA6OGQX85ecX7DUrao9Fn1lyETItAh2og/2Z8UKzTpxnd1CvAFJCLAsMnpRjhO5yJEyrn+X+WxDkykCcWgFUA0ELW2oZFL806FnnhO6+CP1T8sCOkkZxPlsJNUfdcDWrG2Qk8zFO1m1RqYfatvFVbPUiDSLE2oKs2Dj7LuRGS+Y3RbGAk9IeKMwmZ8nI12MZfU+PNBrD+50ys04KigW/x8bjDY9gObDiZiIRleOZp2vIfzqiP9EBkF EnWybx64 Osd40S7qoyLlIwZvzC641DS9i1YLB9OBELJrmPS1lH0kKVUIO3zZhR3H543qrL+4zAWAu2A0kW3nhbjjdPCIQoS02m25h4D1JTklzPK2Hr0zhpMJzm/ggFvOArYw4N1PMG84wI+eqjRL5KOjfSLIwDM+hCeBXnixzlxGDchhbgjzrwlevkENAbK2QbbiejLnp+vojXLF0t6acJgRgRxsrRPJgNegWzpVGAzLB9XAo0FXBR6cLK5eTFe/1a++KFqwnpusfNM6J6qtSB/MNl79E+cEFt7IgxGe+g1c/X/GRD9IOVEWCoBGQ28ODYrrGqRV/O9D2 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: Fix type mismatch warnings. Signed-off-by: Muhammad Usama Anjum --- tools/testing/selftests/mm/khugepaged.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tools/testing/selftests/mm/khugepaged.c b/tools/testing/selftests/mm/khugepaged.c index 8a4d34cce36b2..dde7c7fbbac2c 100644 --- a/tools/testing/selftests/mm/khugepaged.c +++ b/tools/testing/selftests/mm/khugepaged.c @@ -140,7 +140,7 @@ static void get_finfo(const char *dir) exit(EXIT_FAILURE); } if (snprintf(finfo.path, sizeof(finfo.path), "%s/" TEST_FILE, - finfo.dir) >= sizeof(finfo.path)) { + finfo.dir) >= (signed int)sizeof(finfo.path)) { printf("%s: Pathname is too long\n", __func__); exit(EXIT_FAILURE); } @@ -155,7 +155,7 @@ static void get_finfo(const char *dir) /* Find owning device's queue/read_ahead_kb control */ if (snprintf(path, sizeof(path), "/sys/dev/block/%d:%d/uevent", major(path_stat.st_dev), minor(path_stat.st_dev)) - >= sizeof(path)) { + >= (signed int)sizeof(path)) { printf("%s: Pathname is too long\n", __func__); exit(EXIT_FAILURE); } @@ -169,7 +169,7 @@ static void get_finfo(const char *dir) sizeof(finfo.dev_queue_read_ahead_path), "/sys/dev/block/%d:%d/queue/read_ahead_kb", major(path_stat.st_dev), minor(path_stat.st_dev)) - >= sizeof(finfo.dev_queue_read_ahead_path)) { + >= (signed int)sizeof(finfo.dev_queue_read_ahead_path)) { printf("%s: Pathname is too long\n", __func__); exit(EXIT_FAILURE); } @@ -197,7 +197,7 @@ static void get_finfo(const char *dir) if (snprintf(finfo.dev_queue_read_ahead_path, sizeof(finfo.dev_queue_read_ahead_path), "/sys/block/%s/queue/read_ahead_kb", - str) >= sizeof(finfo.dev_queue_read_ahead_path)) { + str) >= (signed int)sizeof(finfo.dev_queue_read_ahead_path)) { printf("%s: Pathname is too long\n", __func__); exit(EXIT_FAILURE); } @@ -271,7 +271,7 @@ static void *alloc_mapping(int nr) static void fill_memory(int *p, unsigned long start, unsigned long end) { - int i; + unsigned int i; for (i = start / page_size; i < end / page_size; i++) p[i * page_size / sizeof(*p)] = i + 0xdead0000; @@ -333,10 +333,10 @@ static void *alloc_hpage(struct mem_ops *ops) static void validate_memory(int *p, unsigned long start, unsigned long end) { - int i; + unsigned int i; for (i = start / page_size; i < end / page_size; i++) { - if (p[i * page_size / sizeof(*p)] != i + 0xdead0000) { + if ((unsigned int)p[i * page_size / sizeof(*p)] != i + 0xdead0000) { printf("Page %d is corrupted: %#x\n", i, p[i * page_size / sizeof(*p)]); exit(EXIT_FAILURE); @@ -537,7 +537,7 @@ static void madvise_collapse(const char *msg, char *p, int nr_hpages, static bool wait_for_scan(const char *msg, char *p, int nr_hpages, struct mem_ops *ops) { - int full_scans; + unsigned int full_scans; int timeout = 6; /* 3 seconds */ /* Sanity check */