Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp5665573imb; Thu, 7 Mar 2019 22:46:36 -0800 (PST) X-Google-Smtp-Source: APXvYqxHjvDYLSjYHoTskMtyMxeAQh/ln98xbhtNaOciu7sLipvKw9UQTDI5bc7dSbJ8g9vCqtcP X-Received: by 2002:a17:902:6a4:: with SMTP id 33mr17226766plh.140.1552027595999; Thu, 07 Mar 2019 22:46:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1552027595; cv=none; d=google.com; s=arc-20160816; b=oRcWOctFumYEhZHUl8pb4NoD8dmkxY8UgO70ghi1/Z3LJPJQck+Kj3pgsWq5WJKNuo 1j7rDQ2Mq7fArtJZLE75QxAcWZ2Mm2azUUJaGjeM8Ta99k9lVMf3A5YyYTdYv3HoMlhT TtJpPts56wfgt5uQS3cw89DAKU0zn5nZ7PsWphZqsPtBcW4geS3lrRXVt5n+1AGfmsHr sP22bQQNfHP7vfmcbfqSTvVpYRAqpiP7l9luOFy79R8ZanvQ1EbWTG9NMHV94bNI/j8I H73bYy31yXWhiyJq9xmQBhR7oScUNCTnFNHPKYXesyGmXzgZvevGSAjTzsAOwdHTmJjp XX+g== 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=N/qtDf5fnqM9VoWDcwIOX2JbfjPFNVEEncbZjpulgtI=; b=Uw72+wbgZjY9yTii31G8/M1Fa006Qf5qwRmBRrtqmNzVjihxESFbAxfY8grRPa13N9 N472H/Eud7D7sjHGRFWwGOX3kskc6JxGiAJkC2X/XVPPpa9KJJZ4roqoUrjl2f+msFes 4HwIZysyKuoeGVqzxdlVY0SBjBb2x+v6fSRiKAdMGLwWv3efkgMhsPF8u2PwUnoi5wXW dwcQ12XvGeMqkQd12LJ+BwHnz8TpXamiaP3iM8PnIuhjvLH1J4V/3AhV0hXuIfQoy1lG qWAmzCLJijwQu7ZTJbxsmPTxJBxkNHwoSgv2dNaePXifqH8YlwmPUoUssSOFimay17K6 PFVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Oium6+NZ; 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 f23si6779455pfa.228.2019.03.07.22.46.20; Thu, 07 Mar 2019 22:46:35 -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=Oium6+NZ; 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 S1726429AbfCHGp7 (ORCPT + 99 others); Fri, 8 Mar 2019 01:45:59 -0500 Received: from mail-yw1-f68.google.com ([209.85.161.68]:39449 "EHLO mail-yw1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725776AbfCHGp7 (ORCPT ); Fri, 8 Mar 2019 01:45:59 -0500 Received: by mail-yw1-f68.google.com with SMTP id z191so15502998ywa.6; Thu, 07 Mar 2019 22:45:58 -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=N/qtDf5fnqM9VoWDcwIOX2JbfjPFNVEEncbZjpulgtI=; b=Oium6+NZkouHu57X10Chbvt6YdngPWL0x8Non/LDqmpvO699UxmHknIpfkvVUCr0H7 fMVEAmWGrTxB9tE23eiLXH0bPoWHEYnJolSI8V6g4hOLKo2JC3nXmnN/TiP46ah6pF8Z /kjz7SRy0YopGqK3+5T5Z++gHnIglpPmkssBNlBssZi2+DSvkLcP+MzVyni51wdlnOYg MoBf4vO5c/ttkfSRmyvIdewMP0OBnfJwE9T5hp2bsJnen4/1zl39JcLppeT57sTYOAJc HrfhM/CPhGU84oq/6Ro6OnQnWlzDt7KRGQ+3J5fWp4wzUaRfGZw+/305/pUi4FhJL9n6 VuLg== 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=N/qtDf5fnqM9VoWDcwIOX2JbfjPFNVEEncbZjpulgtI=; b=dqAQqG98zge6mG9guPDof1L0PWmkGsZujtOjtSGEB0nDp3mYJhdGQcTMDwNTGPINL9 tPx58u4NwDMHfkuXUpJ8j4py0cgTI+yyu4FR56YkJ+2dPmPjKsNH8BDs9Z9gWoooq0GG Y+gY0qZWod8wJZw+h67T2qSrbxIrdvxLm4PRsxYtJFFo6KIOy0PLogX9E/oCR2MgAYVx 0VpvG2v/KyQb4htU8GsJ1cVk0Ggl4AYUdlaV7xwoAzVJAsaI5t0N/SJzetjWY4y235U9 S7HRb0daLFNhFy071gu14JF78wyGCUsrWYIq+iASQnvg3oTLi53uwVXzPv1pDOcOMK3U JH5w== X-Gm-Message-State: APjAAAXYhf6WGMbFOCTWbvn91Y8rZXkzbCknsgeJdaY+d91bBNfEufo7 Qb57cdp4xrN2mEK5ab8GQ2Q= X-Received: by 2002:a5b:42:: with SMTP id e2mr9964922ybp.141.1552027557907; Thu, 07 Mar 2019 22:45:57 -0800 (PST) Received: from localhost.localdomain ([191.101.9.198]) by smtp.gmail.com with ESMTPSA id 186sm2408540ywi.104.2019.03.07.22.45.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 Mar 2019 22:45:57 -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 V3] bpf: fix warning about using plain integer as NULL Date: Fri, 8 Mar 2019 01:45:51 -0500 Message-Id: <20190308064551.17437-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 --- V3: put fix tag all in a line 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