Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp2139255pxb; Fri, 25 Mar 2022 11:47:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyDOoZ2r7lWhf2W488IlzpCLl1zkPGZA9LA1DEOzY0BP4Cp00UurDA0cOm2JluAtcjIYBmR X-Received: by 2002:a17:903:244b:b0:154:4104:4668 with SMTP id l11-20020a170903244b00b0015441044668mr13236503pls.30.1648234046877; Fri, 25 Mar 2022 11:47:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648234046; cv=none; d=google.com; s=arc-20160816; b=rq+4RVgNERGTpdmejwYRK3Mzzsz/so5iATPUgcq2/q9OY+wXFX7jI6gQLCdTThcbsl j6rJ/4GP3jPSOcVVHqGMPPMjD+U5Z10ey+cfgkoYOe8tkhF8uOk2IjSFXDt9e0XgQTUc 9N3lJqJ11c9+xAJ/7XPVWf5LAMNr5j1Iy730Zbb++9rPb0HyR5h1IO6JkTaK9jmux3LC rrTNQG90F8rlycdLZWNYyyS0rVovAU1PJg9PJNC/GS6vt3uQy+QSfAFCkKLgGXMvrPsT Xc0FohkXEapUHCBM3aAp1UqLENiSuyazNHlbXc4nUA59bwX+AmJfBBAh2wcd/w0m3vZn RgJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=ambKlIizMvkF8yVdBIQzcgDV2R5fWIttjsDbg+TwrvI=; b=cDzUG8isfMZcr3qUGuPz79d2iX2T9i7m77FP8w3pOPXj1VWCHAQyrvP0VD7CO6/Cty GR5+B+tcoJQ72Z12vxiDxn7vSfkTzQb/oX8B+zgFhSBbJ6ryno5O1KElcXzYnNVaIDc4 6Gm9eEx3unenGKMdAWsUslKVkbXQzGc+1faMpuNr0fAhftpcDb/WBzUHtkmcMKACQQeB VGIhLihK0IEWMQxYdtBJT4sJRr6tWEIHOQ9DzGH5iyhj/6xFOEbUrp86HRS+gqOp/on0 WTBDl/cFxRAjM98r1dYK5rPQ9IflXB9YiC4MA01Qkt/GHTjDRefIQEWBI/CHn5SHHChF TTPA== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id p7-20020a639507000000b0038233e5d18dsi3212453pgd.491.2022.03.25.11.47.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Mar 2022 11:47:26 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 2CC2512FF8E; Fri, 25 Mar 2022 11:05:51 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241278AbiCXCKY (ORCPT + 99 others); Wed, 23 Mar 2022 22:10:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60036 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239878AbiCXCKU (ORCPT ); Wed, 23 Mar 2022 22:10:20 -0400 Received: from mail.meizu.com (edge07.meizu.com [112.91.151.210]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A1DF6634F; Wed, 23 Mar 2022 19:08:48 -0700 (PDT) Received: from IT-EXMB-1-125.meizu.com (172.16.1.125) by mz-mail11.meizu.com (172.16.1.15) with Microsoft SMTP Server (TLS) id 14.3.487.0; Thu, 24 Mar 2022 10:08:47 +0800 Received: from meizu.meizu.com (172.16.137.70) by IT-EXMB-1-125.meizu.com (172.16.1.125) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.14; Thu, 24 Mar 2022 10:08:46 +0800 From: Haowen Bai To: , , , , , , , , CC: , , , , Haowen Bai Subject: [PATCH] selftests/bpf: Fix warning comparing pointer to 0 Date: Thu, 24 Mar 2022 10:08:45 +0800 Message-ID: <1648087725-29435-1-git-send-email-baihaowen@meizu.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [172.16.137.70] X-ClientProxiedBy: IT-EXMB-1-125.meizu.com (172.16.1.125) To IT-EXMB-1-125.meizu.com (172.16.1.125) X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Avoid pointer type value compared with 0 to make code clear. Signed-off-by: Haowen Bai --- tools/testing/selftests/bpf/progs/map_ptr_kern.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/bpf/progs/map_ptr_kern.c b/tools/testing/selftests/bpf/progs/map_ptr_kern.c index b64df94..db388f5 100644 --- a/tools/testing/selftests/bpf/progs/map_ptr_kern.c +++ b/tools/testing/selftests/bpf/progs/map_ptr_kern.c @@ -367,7 +367,7 @@ static inline int check_array_of_maps(void) VERIFY(check_default(&array_of_maps->map, map)); inner_map = bpf_map_lookup_elem(array_of_maps, &key); - VERIFY(inner_map != 0); + VERIFY(inner_map != NULL); VERIFY(inner_map->map.max_entries == INNER_MAX_ENTRIES); return 1; @@ -394,7 +394,7 @@ static inline int check_hash_of_maps(void) VERIFY(check_default(&hash_of_maps->map, map)); inner_map = bpf_map_lookup_elem(hash_of_maps, &key); - VERIFY(inner_map != 0); + VERIFY(inner_map != NULL); VERIFY(inner_map->map.max_entries == INNER_MAX_ENTRIES); return 1; -- 2.7.4