Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp5647018imb; Thu, 7 Mar 2019 22:12:04 -0800 (PST) X-Google-Smtp-Source: APXvYqwDxqUMEE9RplkgWgWY1Wt1X/8UnekAIHIAgmraYJCxgGq2bY+Zpa9G3tYl+6pO9XeRFlYF X-Received: by 2002:a17:902:e50b:: with SMTP id ck11mr17347892plb.25.1552025524312; Thu, 07 Mar 2019 22:12:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1552025524; cv=none; d=google.com; s=arc-20160816; b=i1YHxbS+z0W+7fiUrm0vsClrMl5A8Kjn+3Ma7EXi/N736FWYYegohLnbNkxvEnnX1C ZTvxL+ev/03tLdJBsIajkoEkAERCv1R0ojRgjHNxvZiEtkpMpPwfNFqr2s5A8LjXWSZ0 v/00859u3nO4ruqtmGi7IykJJspiH8ljw1UxDM+efNvVyen47xx3ty0pmnLpXr0uUN9l p++5oWdTryQR+NcaRV08LdjUx0nIZYnomf0DaOoTmfMzU9BbJt6xwyAbB+/+jGZMexxf EtlGQEd7WwyduigMudjbtw0CwmKr78ADrVSnl6uqCgb3qQWKu3AsWy1NktcfhAk32M++ +A7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=EoYCz66ft2NTt/PnS2Fszn3JHSWf44OPbEFuS+P6CWA=; b=lAwmxpNy/Wq8SskTc0Dd4rECTjN1mrjeW5PQN567dNRxEjddxELoSIUmhQy7+rwbcQ d093f/Ub4Ch/n49507f9CJlELkxTtrN+Rs/aS0gzwCa1GWIgvnIxAAo5JxNJ0pX2x19B aX2jmPQ+ToCfc+3Zp9J6YkQGmIzY0YZeYAHWC2TfZSOyjlEtSKVXm0nht/ABRJFVBFsY czphG/RqQsC7NXlKQMDbe1t/otJnmzj6BggNpthFTgNVwdzVGdm+z6Bf558OYd78lbRr 2MtP6NdeNcEaWunR2RXBOml2caztqtL0WljIZLEQfq7fpH3goHjXQQvXZhiAFvgE7GyS Di9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=GT5lBK7j; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s139si6713250pfs.56.2019.03.07.22.11.35; Thu, 07 Mar 2019 22:12:04 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=GT5lBK7j; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726358AbfCHGJr (ORCPT + 99 others); Fri, 8 Mar 2019 01:09:47 -0500 Received: from mail-yw1-f65.google.com ([209.85.161.65]:39223 "EHLO mail-yw1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726039AbfCHGJq (ORCPT ); Fri, 8 Mar 2019 01:09:46 -0500 Received: by mail-yw1-f65.google.com with SMTP id z191so15452840ywa.6; Thu, 07 Mar 2019 22:09:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=EoYCz66ft2NTt/PnS2Fszn3JHSWf44OPbEFuS+P6CWA=; b=GT5lBK7jcxiBo1mdUIhPLQ77v+xpOIRYaRVJP23+lECYhMWp4+EUK5XeTW5gL+CWi2 yViBkvp+NI2+//OTDorQeDrlhoRmze15rF1X7gTNDxUV5cbcSKsUty2sgc3py9NGmF7v z3lsA87yrsuRmIXYDwABWwbbZiKLR95TnALBZW+srnX4kFISQWxGVRXWxw43KO7LnN91 tecvml5XX3RkWYUrKI+2sbmDwWwF6ejdEQCtcaABmoyH9xCtKqzlUnhJX8djyrqKPWdT qkU/jRh0ubk3/DGwjP9GMiWl9ECluKzZS4pxxiNaR/9i36Kg21WQjwdNN2/gtV4tmUUR owFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=EoYCz66ft2NTt/PnS2Fszn3JHSWf44OPbEFuS+P6CWA=; b=PRIcY9Nkv2EmHZdF4BbBHBROS1XWg0bSsD19K4DWw3W/MNsuIahltBp7AOjPz+pSu8 4Ujz+pnHlLeg1bMk7xFbDzazSkQ726tJB9t53Nd/j5GpcSJfxEwwdL/4Fa2/yQHJsbK7 QSM+qSTkAf1b+2O/mGl5scTWJ0dGL59Xtcb3ME8qudVKQaJW9zjyfXlC8hDmdz1ryUtN +nJHvzh9BJYclXg83zGVeJVLb3YCEAEicJKBzAcduk+Ug6TKETB+SNhYI6qwYxWMLI+l Y2leBVssYaPCMsqLXvZyiQPrQ43a1oF/AEueaMPVog87citKMek2+2/IMPWT03oNKnKE cXQA== X-Gm-Message-State: APjAAAX4L9Co1G0W/+ORHgawHxVCgSF60L9lBXYTc5U25M0G+QJIH6WJ 5LhgWEG2Y5Q2ClYDBwHbF/4= X-Received: by 2002:a0d:c544:: with SMTP id h65mr13252955ywd.35.1552025385446; Thu, 07 Mar 2019 22:09:45 -0800 (PST) Received: from localhost.localdomain ([191.101.9.198]) by smtp.gmail.com with ESMTPSA id s5sm2436205ywg.108.2019.03.07.22.09.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 Mar 2019 22:09:45 -0800 (PST) From: Bo YU To: ast@kernel.org, daniel@iogearbox.net, kafai@fb.com, ongliubraving@fb.com, yhs@fb.com, davem@davemloft.net Cc: Bo YU , netdev@vger.kernel.org, bpf@vger.kernel.org, linux-kernel@vger.kernel.org, yuzibode@126.com Subject: [PATCH V2] bpf: fix warning about using plain integer as NULL Date: Fri, 8 Mar 2019 01:09:38 -0500 Message-Id: <20190308060938.17305-1-tsu.yubo@gmail.com> X-Mailer: git-send-email 2.11.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Sparse warning below: sudo make C=2 CF=-D__CHECK_ENDIAN__ M=net/bpf/ CHECK net/bpf//test_run.c net/bpf//test_run.c:19:77: warning: Using plain integer as NULL pointer ./include/linux/bpf-cgroup.h:295:77: warning: Using plain integer as NULL pointer Fixes: 8bad74f9840f ("bpf: extend cgroup bpf core to allow multiple cgroup storage types") Acked-by: Yonghong Song Signed-off-by: Bo YU --- V2: Add fix-up tag from Yonghong --- include/linux/bpf-cgroup.h | 2 +- net/bpf/test_run.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/linux/bpf-cgroup.h b/include/linux/bpf-cgroup.h index 695b2a880d9a..a4c644c1c091 100644 --- a/include/linux/bpf-cgroup.h +++ b/include/linux/bpf-cgroup.h @@ -292,7 +292,7 @@ static inline int bpf_cgroup_storage_assign(struct bpf_prog *prog, static inline void bpf_cgroup_storage_release(struct bpf_prog *prog, struct bpf_map *map) {} static inline struct bpf_cgroup_storage *bpf_cgroup_storage_alloc( - struct bpf_prog *prog, enum bpf_cgroup_storage_type stype) { return 0; } + struct bpf_prog *prog, enum bpf_cgroup_storage_type stype) { return NULL; } static inline void bpf_cgroup_storage_free( struct bpf_cgroup_storage *storage) {} static inline int bpf_percpu_cgroup_storage_copy(struct bpf_map *map, void *key, diff --git a/net/bpf/test_run.c b/net/bpf/test_run.c index da7051d62727..fab142b796ef 100644 --- a/net/bpf/test_run.c +++ b/net/bpf/test_run.c @@ -16,7 +16,7 @@ static int bpf_test_run(struct bpf_prog *prog, void *ctx, u32 repeat, u32 *retval, u32 *time) { - struct bpf_cgroup_storage *storage[MAX_BPF_CGROUP_STORAGE_TYPE] = { 0 }; + struct bpf_cgroup_storage *storage[MAX_BPF_CGROUP_STORAGE_TYPE] = { NULL }; enum bpf_cgroup_storage_type stype; u64 time_start, time_spent = 0; int ret = 0; -- 2.11.0