Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp109680pxf; Wed, 10 Mar 2021 01:34:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJyaEvnuT4sI2te5ZVPvik4VoYwN1GjC/swJm2kvYM2gOthI1B7k7UKituxPRpgClYV5/muD X-Received: by 2002:aa7:d54c:: with SMTP id u12mr2330468edr.234.1615368848804; Wed, 10 Mar 2021 01:34:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615368848; cv=none; d=google.com; s=arc-20160816; b=fg7I2/5bbeAYTLs9tOsSo1lHOxEJ3lWQlhnV1YHloiPRZALkgE5uIgr1NdBiPmxk+h vVNPmgfqvFtufdqqhTJRv8brZnKGUm5zkwsVBZmXsiKTfeHkOvCLz4s9AXWI9zCuDwKq LqB/9CK+Fht81gz8cuESYGgW2HxezAs9vAZsMqe2K9OwBc1NachXPZlifNoG2KDlBQ5q kqggLLt9/K2tSqpBUF1uVLzd+DyN7bc0ZenrVwzl8w4mtH2X2C01IZvE/tgmLWSVVyd3 Q3f9Mf26QTeJrcZMN/WiSG2QIldaxVWyn4ko3RULVclAlHBbDZJnWkT/9Wv2n4HNEgca 4XTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=a/DGLUjr6IILhrnvlay+wj8znvny6CeX2t2rrG8Z35w=; b=MQitR3VRED7JOtyQ7tpjW8TMR4R8tKAL0gmsQinOJ3Ua+ajeaXSFIYXMQqx41aDePr mWghCpeLYszvkDuxUU2u48Zh5aokhvQUQ0t7dc/5dsP5M0h/qYjpmFi/TUGEopGIiPAM SEFsAZALXlEjDqfzAEidMyZ67wxyDeUwhfcdvtJ1gIXxFHpvTuFjoQwGorTqqc+EKj5q I/ykWKnQfLkyAk0b4v4xbkwc9Vtgx7iImgsa4yT2l2IdDNzEccSn1vrQRkF/VD8w1c6u nlT+ze3QQzB0ll9ZbnoUPjG6ykJBpOBrek35B/PgjJ8xBcZWc2bZNqxhYAdfgRr8nMR5 DTbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ciB9T3xq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ec6si10837019ejb.738.2021.03.10.01.33.44; Wed, 10 Mar 2021 01:34:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ciB9T3xq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229657AbhCJJcq (ORCPT + 99 others); Wed, 10 Mar 2021 04:32:46 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:48132 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231489AbhCJJcQ (ORCPT ); Wed, 10 Mar 2021 04:32:16 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1615368735; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=a/DGLUjr6IILhrnvlay+wj8znvny6CeX2t2rrG8Z35w=; b=ciB9T3xq7P1SFhCuUiVy1do1gcAGm0YIDC38N7Z3jaKajpyyt91ZJxIqfO34q8RYrqhr8Z BGsTsi+vH7EA2U7kiIRsIxpq7Av77NFaFUXrMBBSD93l2iXBBXCcIyvG+q3e4blabI5Aou 1SX4JPNXh64WyUpD4PMXdwCuxWtC61k= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-472-TmGl4S8vMUG9EUTuCIPr2Q-1; Wed, 10 Mar 2021 04:32:13 -0500 X-MC-Unique: TmGl4S8vMUG9EUTuCIPr2Q-1 Received: by mail-wr1-f69.google.com with SMTP id 75so7661230wrl.3 for ; Wed, 10 Mar 2021 01:32:13 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=a/DGLUjr6IILhrnvlay+wj8znvny6CeX2t2rrG8Z35w=; b=TNBOBMawpjryaeWSWnWaJNN6vFfsmfx9ld95zj4xHSZ7mQO4Ft/bqIRh3UnRxkYesa 4kuAPVIVLlIGT8xW+VdFO6GJFvUIwS1tFTavvl1e2JfhR9OTaNgbJoep4LOBNXnc/tFb SMdaAC4rRdeJyRREZmpsPCgypLonYxEijMBGJXsQZD3SwKI1KTqj4lZ0JmuAyigKwIMK azsf0QiFdVB78OBQMQqyAx+aIrVWLcJ4STPiRx0BzZcC6Tvbasjae3SnsgVBy+SjM7+X 1ow+kv0R3HIM0LFGH0tgY2+0u3I1zymqWR8G2brtRV9CUe6XwpCGr099eYZJ7c0pwY2n tB9g== X-Gm-Message-State: AOAM530fhrapJo3rBX7QT3zHQpLNwtOr6IpqpOt/+IIVwyEq1DHu0ROy DCjT0fJxLFVBZ0rmsX4jVxniJIb+Gqx+ZgRXbcH2H+zgDmlSr3BdjGjeHnkIkDLNZgtL34yInGU RzRZ8krsObxk7SbHkHQGsL0jlJfko7sBXoU77rtfx X-Received: by 2002:a1c:9a92:: with SMTP id c140mr2302131wme.167.1615368732287; Wed, 10 Mar 2021 01:32:12 -0800 (PST) X-Received: by 2002:a1c:9a92:: with SMTP id c140mr2302102wme.167.1615368732055; Wed, 10 Mar 2021 01:32:12 -0800 (PST) MIME-Version: 1.0 References: <1615357366-97612-1-git-send-email-jiapeng.chong@linux.alibaba.com> In-Reply-To: <1615357366-97612-1-git-send-email-jiapeng.chong@linux.alibaba.com> From: Yauheni Kaliuta Date: Wed, 10 Mar 2021 11:31:56 +0200 Message-ID: Subject: Re: [PATCH] selftests/bpf: fix warning comparing pointer to 0 To: Jiapeng Chong Cc: shuah , Alexei Starovoitov , Daniel Borkmann , andrii@kernel.org, Martin KaFai Lau , Song Liu , Yonghong Song , john.fastabend@gmail.com, kpsingh@kernel.org, "open list:KERNEL SELFTEST FRAMEWORK" , netdev@vger.kernel.org, bpf , LKML Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 10, 2021 at 8:23 AM Jiapeng Chong wrote: > > Fix the following coccicheck warning: > > ./tools/testing/selftests/bpf/progs/test_global_func10.c:17:12-13: > WARNING comparing pointer to 0. but it's ok from the C standard point of view > > Reported-by: Abaci Robot > Signed-off-by: Jiapeng Chong > --- > tools/testing/selftests/bpf/progs/test_global_func10.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/tools/testing/selftests/bpf/progs/test_global_func10.c b/tools/testing/selftests/bpf/progs/test_global_func10.c > index 61c2ae9..97b7031 100644 > --- a/tools/testing/selftests/bpf/progs/test_global_func10.c > +++ b/tools/testing/selftests/bpf/progs/test_global_func10.c > @@ -14,7 +14,7 @@ struct Big { > > __noinline int foo(const struct Big *big) > { > - if (big == 0) > + if (!big) > return 0; > > return bpf_get_prandom_u32() < big->y; > -- > 1.8.3.1 > -- WBR, Yauheni