Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp1973929pxb; Sat, 7 Nov 2020 05:10:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJyYCljCg7NnuuuhyijTX9MimxAa379ZHpJT1QcVloD8F/RLGVLeXWdm1Cm0NRtTOrynBhTO X-Received: by 2002:a17:906:1f92:: with SMTP id t18mr6988356ejr.539.1604754624075; Sat, 07 Nov 2020 05:10:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604754624; cv=none; d=google.com; s=arc-20160816; b=N57KQA06nTODlDE5kfHCUFhjH5Q+5UcXjYbiHh2ab1BricqsvoTWjDFU+scPjtBCJc AA9qXSSt/B3sTpmY4/Z7RLUXiqRn5IO7hLNX0fjLh/uI6wIH2ZG49+nM72yq2nwRNXAE eUvv3hAmp9bYhIGG5ZKIzWkuCDHywg56aeiNKQt06kiofUEDCeGpDo6TBA6s9t4ErpYC dEB5B6fp82aKajjLb8DyBD2MrxW/pjd/F3bLqV0g+l55KsF8vZyCU1lhMoY5XgBnW5i5 xarXIgDHb2KUM5yI5jzkyJgIQIPf0wkfLm/Fd+ecbFlEvISb1XHFWwLim5roRg6ABqbP /Fsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:references:cc:to :subject; bh=Q5f4/iOd/keyq+ww/9Jb6NtJlLJdeR/atpfxcnjJyxY=; b=iauMhR7Fzz+CeaN8jEdNpAR6ThACFK84f4wRC2N3fv8USEhh3sh86NZfAVhw/FIMnm +NcTU3Z4enKHfo2bEeMYoCMn6Rx1rposGCBaZaK8pnG4Ei2r2s0q9P29aKDJ3nPRJpld 0taEHoPPR/3LFwK3zr8kvvP5ls90Gm7kvNiqcFGTaOXGmZUXhX5+/e6wIYYK834/jdmh scTmlkSWHYWgJRrNPykHzwXjZ5i6PJdIBo6UXdBKfpgonyPqXfr/+PP//c5gUUXKF4Iy XDS986alPcHbVPtWi29ULyV1S5kZK8Un+DEqKKta8WtO8omEhhKJsAQMSvg1FOE+XM1h XItw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r10si3525853ejc.191.2020.11.07.05.09.58; Sat, 07 Nov 2020 05:10:24 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727866AbgKGNIf (ORCPT + 99 others); Sat, 7 Nov 2020 08:08:35 -0500 Received: from out30-42.freemail.mail.aliyun.com ([115.124.30.42]:35278 "EHLO out30-42.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727084AbgKGNIe (ORCPT ); Sat, 7 Nov 2020 08:08:34 -0500 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R121e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=alimailimapcm10staff010182156082;MF=alex.shi@linux.alibaba.com;NM=1;PH=DS;RN=10;SR=0;TI=SMTPD_---0UEW6ava_1604754510; Received: from IT-FVFX43SYHV2H.lan(mailfrom:alex.shi@linux.alibaba.com fp:SMTPD_---0UEW6ava_1604754510) by smtp.aliyun-inc.com(127.0.0.1); Sat, 07 Nov 2020 21:08:31 +0800 Subject: Re: [PATCH] net/xdp: remove unused macro REG_STATE_NEW To: Jesper Dangaard Brouer Cc: davem@davemloft.net, Jakub Kicinski , Alexei Starovoitov , Daniel Borkmann , Jesper Dangaard Brouer , John Fastabend , netdev@vger.kernel.org, bpf@vger.kernel.org, linux-kernel@vger.kernel.org References: <1604641431-6295-1-git-send-email-alex.shi@linux.alibaba.com> <20201106171352.5c51342d@carbon> From: Alex Shi Message-ID: <3d39a08d-2e50-efeb-214f-0c7c2d1605d7@linux.alibaba.com> Date: Sat, 7 Nov 2020 21:08:12 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: <20201106171352.5c51342d@carbon> Content-Type: text/plain; charset=gbk Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ?? 2020/11/7 ????12:13, Jesper Dangaard Brouer ะด??: > Hmm... REG_STATE_NEW is zero, so it is implicitly set via memset zero. > But it is true that it is technically not directly used or referenced. > > It is mentioned in a comment, so please send V2 with this additional change: Hi Jesper, Thanks a lot for comments. here is the v2: From 2908d25bf2e1c90ad71a83ba056743f45da283e8 Mon Sep 17 00:00:00 2001 From: Alex Shi Date: Fri, 6 Nov 2020 13:41:58 +0800 Subject: [PATCH v2] net/xdp: remove unused macro REG_STATE_NEW To tame gcc warning on it: net/core/xdp.c:20:0: warning: macro "REG_STATE_NEW" is not used [-Wunused-macros] And change related comments as Jesper Dangaard Brouer suggested. Signed-off-by: Alex Shi --- net/core/xdp.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/net/core/xdp.c b/net/core/xdp.c index 48aba933a5a8..0df5ee5682d9 100644 --- a/net/core/xdp.c +++ b/net/core/xdp.c @@ -19,7 +19,6 @@ #include #include -#define REG_STATE_NEW 0x0 #define REG_STATE_REGISTERED 0x1 #define REG_STATE_UNREGISTERED 0x2 #define REG_STATE_UNUSED 0x3 @@ -175,7 +174,7 @@ int xdp_rxq_info_reg(struct xdp_rxq_info *xdp_rxq, return -ENODEV; } - /* State either UNREGISTERED or NEW */ + /* State either UNREGISTERED or zero */ xdp_rxq_info_init(xdp_rxq); xdp_rxq->dev = dev; xdp_rxq->queue_index = queue_index; -- 1.8.3.1