Message ID | 20230817160033.90079-1-tuananhlfc@gmail.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> 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 28D24C3DA4D for <linux-mm@archiver.kernel.org>; Thu, 17 Aug 2023 16:00:54 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 11DF394003F; Thu, 17 Aug 2023 12:00:54 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0CD54940009; Thu, 17 Aug 2023 12:00:54 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EFE2D94003F; Thu, 17 Aug 2023 12:00:53 -0400 (EDT) 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 E0780940009 for <linux-mm@kvack.org>; Thu, 17 Aug 2023 12:00:53 -0400 (EDT) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 96BDD16103C for <linux-mm@kvack.org>; Thu, 17 Aug 2023 16:00:53 +0000 (UTC) X-FDA: 81134059986.23.C82DECA Received: from mail-pf1-f182.google.com (mail-pf1-f182.google.com [209.85.210.182]) by imf04.hostedemail.com (Postfix) with ESMTP id 658594006B for <linux-mm@kvack.org>; Thu, 17 Aug 2023 16:00:39 +0000 (UTC) Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=gmail.com header.s=20221208 header.b=VmNUeJRQ; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf04.hostedemail.com: domain of tuananhlfc@gmail.com designates 209.85.210.182 as permitted sender) smtp.mailfrom=tuananhlfc@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1692288040; 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=zlT9fFwxzSwTM1kaYJgDOCQu0UvIzKLj9qZMmOR6x28=; b=u4w5e/SUkpafnFfWoYIysD/+gsVJrToJ4JnjZu5bAfcCS2cqmB6LpzfLW9RYljsQJXlTEA ZzyaoP0sVZnucnxkdEYmGqfZr1XBKWqZDHwb9YXqurJapF3SIvH4zJp3RnZAIF03RbYIZi bSgXn1Pnmyp00TbrCp3FjVpGUmMsETc= ARC-Authentication-Results: i=1; imf04.hostedemail.com; dkim=pass header.d=gmail.com header.s=20221208 header.b=VmNUeJRQ; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf04.hostedemail.com: domain of tuananhlfc@gmail.com designates 209.85.210.182 as permitted sender) smtp.mailfrom=tuananhlfc@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1692288040; a=rsa-sha256; cv=none; b=R4fgO1udJJ2Y7sAzsoDBSAS2VMUWZX50SX4C1zojXu6i873JZ3gaHgoqqA5SwfcxwYK1tb pxYRxM/ujKhDjZ9JZqE9UhRbQS0D9r4NN3JooWmGOP48rsl24JHg/PxaJ43G5rG3aV3pzv SwAQLtBc5lAVq9vvnA/xsvEG/C8ote8= Received: by mail-pf1-f182.google.com with SMTP id d2e1a72fcca58-689e6fce70dso824913b3a.1 for <linux-mm@kvack.org>; Thu, 17 Aug 2023 09:00:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1692288038; x=1692892838; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=zlT9fFwxzSwTM1kaYJgDOCQu0UvIzKLj9qZMmOR6x28=; b=VmNUeJRQXAVcshDfrSK3Et1LD6PprjNbVNeGttwgD+xwqPFRoSJiXV01a/6kluD9I+ qRytK1na28nWsFpvtf2Th9yg9VI9aY+xddy856SeQyHAmS7Pn5YZd6d/soyTyTnk7WAw +5uIgH9MEcHinqYXrTCmkmGrkBK/dXuP/vrYAP+rOfJmEudxia9o73P9cwDKq0nErq5A GVWrQHGqkJETkGsiHFGLFJZoIcNFHgzm7Ma2oBaiPjLF0mmHAOZKkjhkMfBFJ8XfTiLk 8Txue3l0eRnHlah7YJAo4+8nXL/DsAAUE8Sw1+StyynHrx9pIuEsBBHRTfgF8IFfBkHu YcKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692288038; x=1692892838; 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=zlT9fFwxzSwTM1kaYJgDOCQu0UvIzKLj9qZMmOR6x28=; b=kUKQx4p3xP1XeFePr/T5a6gc6sJmnzGHHyU8UZ9EiC3dvH89kAgyK3J9CJ4Fo15UP6 yvei2U1dAwUpDzBn/v8ACk8RjJa2/JEaNksD27VTas/3k4G6dE3j/wuBwtUVCvUVLUQ2 5nu0gYMvdpXQW+D4itr+Mci42tSdQcVaHIZzay7t45b/QIvUi654hzZT0RzQve9vsr4n 52b8OCYHsskResy0IKaA//dUF11A7PQe28U7puWeYD5sdOPhvSpXfELcwUiQA+8Wfeai PFAa9Fn1AFHiCS00rPF3rnT1nqHwgiji5CF/KBOUcfj8aaqi18YBs0fDWAibMZwOiLh6 268w== X-Gm-Message-State: AOJu0YyQwdNticBXYMBzxogjvBv4MGToNfzcfmrpsP9HZC650JquAPR1 V3wQs73gfiJy/MDdUQ1hwz4= X-Google-Smtp-Source: AGHT+IFbJG9KVcf0ORQF/w7iO7Nxg7X/MOZC4YGa5PCrSmP+GBVynwoW31tJgL6Bs6PF1VubX6ZEtw== X-Received: by 2002:a05:6a00:850:b0:689:f586:4add with SMTP id q16-20020a056a00085000b00689f5864addmr810149pfk.31.1692288038267; Thu, 17 Aug 2023 09:00:38 -0700 (PDT) Received: from fanta-System-Product-Name.. ([222.252.65.171]) by smtp.gmail.com with ESMTPSA id s24-20020aa78298000000b00666b3706be6sm13018779pfm.107.2023.08.17.09.00.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Aug 2023 09:00:37 -0700 (PDT) From: Anh Tuan Phan <tuananhlfc@gmail.com> To: akpm@linux-foundation.org, shuah@kernel.org Cc: Anh Tuan Phan <tuananhlfc@gmail.com>, linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel-mentees@lists.linuxfoundation.org Subject: [PATCH v1] selftests/mm: Fix WARNING comparing pointer to 0 Date: Thu, 17 Aug 2023 23:00:33 +0700 Message-Id: <20230817160033.90079-1-tuananhlfc@gmail.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 658594006B X-Stat-Signature: 5raabcrmb76aghw4up83ysesfmuzg731 X-HE-Tag: 1692288039-718413 X-HE-Meta: U2FsdGVkX1+3Fo5IiSwKTZlk1sYj6ISXzNfARc5NNTGQdbShBYZnfhCsoqDrYPaA9pRhCIMxblmeiIfUVFPkYVoMTB4+L/UrqOB8bBW7D8pBCFC21wjMcP20s7UdXCu/0Q4PdV71tt5LoEJjJNNMKcCGyZfXt8wQhDtt+jduHiHBrTyB3Bao75ZUcMzRH4w1ca1ClblrSX4bDghWsQLQZWxQnNhdL5c7u2GxgxLn0ttHyG8SIT3haW0SkYzqYrn9kc1Ju8um+va/1szsSObdHWap1Z7ZcvM4f4VIeV0/gs4EvcYG9cVuDUMrk1GbQIjtUlv6rS6I4n8RYPzFUAKl0FL/oQajfmLiX3fvRoeZw8OG5jDBfx9zBxdoR7Yu4Vvqfimm0ft8Iz/dX1xkV7Itx+8aoZvLjPDFDqMQEH7MbSZG8FAsMh1xBa26a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kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: <linux-mm.kvack.org> |
Series |
[v1] selftests/mm: Fix WARNING comparing pointer to 0
|
expand
|
diff --git a/tools/testing/selftests/mm/map_populate.c b/tools/testing/selftests/mm/map_populate.c index 240f2d9dae7a..7945d0754875 100644 --- a/tools/testing/selftests/mm/map_populate.c +++ b/tools/testing/selftests/mm/map_populate.c @@ -77,7 +77,7 @@ int main(int argc, char **argv) unsigned long *smap; ftmp = tmpfile(); - BUG_ON(ftmp == 0, "tmpfile()"); + BUG_ON(!ftmp, "tmpfile()"); ret = ftruncate(fileno(ftmp), MMAP_SZ); BUG_ON(ret, "ftruncate()");
Remove comparing pointer to 0 to avoid this warning from coccinelle: ./tools/testing/selftests/mm/map_populate.c:80:16-17: WARNING comparing pointer to 0, suggest !E ./tools/testing/selftests/mm/map_populate.c:80:16-17: WARNING comparing pointer to 0 Signed-off-by: Anh Tuan Phan <tuananhlfc@gmail.com> --- tools/testing/selftests/mm/map_populate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)