Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2450140yba; Fri, 17 May 2019 17:52:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqxGTA321rzEnLvnoajZYh9T3ld1IiwGW5o53Kim+KD2lENd6foHw4PvbfA267dG0VdQuXHI X-Received: by 2002:a17:902:bd06:: with SMTP id p6mr28573437pls.112.1558140771340; Fri, 17 May 2019 17:52:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558140771; cv=none; d=google.com; s=arc-20160816; b=PbLnMgphvt+ny0RJGVhR2nWiXi4fEsOYvxZU5WaG2qUbh6nGq8SWQi0p+asDeU3Mxy pSA6kJcu5c6cHGDc5oMMk4HHUBAMsHXogsEehaQQnEa86SM6KIGTl0Dj3ulcR9SV8Ddn bYbs5c8wlWG3ABhJAmNY8mKWuFFjKt2f9Dc4Wqg9PQ+ypqZ3BVflzOUtcBqFf6xUGDKX boUK1MD0LiiUb27Emjg4a7bC7JAeoPt8DovMDQDLwfsTXXcmNC3/kZF+3+GECXrfx8I/ wXCz+CL33W+YyZh2aPd+/LgwU4qhRaSM6xAyNN1OVP1zEE5VkUdNLWELzD1uXNPubJ4W uslg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=ztONs/ilpqhABMMCgDjaDAIxaMOKsVQPs5VxFfPZ+L4=; b=EDAe4ukJ9dMhvAT9VFTO08wZi1fqYRKZLP1l+asUgH3Pa0pRgdEZl/9YtB9nyXlREE Xn331Goysp3TF/x0CRFhO3ogNqRUrVfB73tbk6ta+gaKc1989ryr6ZsMIcUrNcJ0ax2T NI5eUwA4GD1YuNoytcC7mK//CY8nn3ZYjhnMHf32YIDFXm6L5ZDJUebV+gRG9W1Xepef ypVUjvLpLNtzVmVMSEYOGqlUTMAFU6wr56enTR7SWQgk9nsuedgSDp+UGuF8NezdQzTJ gxJB3cv868AN0QEhOpsnp88CS3ablUGYx0tQmkE7HIw3/KkHMJpms9jxwjmORECXnEck jsyA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o70si10316660pfa.33.2019.05.17.17.52.36; Fri, 17 May 2019 17:52:51 -0700 (PDT) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729262AbfERArI (ORCPT + 99 others); Fri, 17 May 2019 20:47:08 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:37873 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728099AbfERArI (ORCPT ); Fri, 17 May 2019 20:47:08 -0400 Received: by mail-wr1-f68.google.com with SMTP id e15so8798798wrs.4 for ; Fri, 17 May 2019 17:47:07 -0700 (PDT) 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=ztONs/ilpqhABMMCgDjaDAIxaMOKsVQPs5VxFfPZ+L4=; b=pv2Dk+adj3qJwxUOJEKgmcKBxA01cgPFr2y+57+YMmPAjIwhObt0SK0gzRkcl5Z/1S Urb5v+AAhzlmfwS8gdF4DbQ2g0SzN8PaLuG/EWz1/POrJ+wyJ5T6gXv527XIMoCR5CCr xbC2vvHZKk9Q2E1MrjXBGTQUvQ68mV3Vzqi2wBWdtFVeDpRiB6u+aEXcQghHv1ymjiLD kIABND4ffzE7VgBLna1lU4pwNUGy79vM8I/l0PumulIIYTzvgQwy90KLJnMSvo8zPGDO OFaaDvkQlaK5HNCZOJE+TxH0sCq0y4OwFf7i7aZq2JZcPdyE9eUt41HXxhR+prHhlzPq jHkg== X-Gm-Message-State: APjAAAUodDxYC9NHiD/XoWbJCqOwWHW4iLM8yIuwHaTU4xib58oVzN+U 0SteTwrT5OT2/rSXEFVe1JCM0A== X-Received: by 2002:adf:fe49:: with SMTP id m9mr35001659wrs.73.1558140426607; Fri, 17 May 2019 17:47:06 -0700 (PDT) Received: from raver.teknoraver.net (net-47-53-225-211.cust.vodafonedsl.it. [47.53.225.211]) by smtp.gmail.com with ESMTPSA id v184sm13126356wma.6.2019.05.17.17.47.05 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 17 May 2019 17:47:05 -0700 (PDT) From: Matteo Croce To: xdp-newbies@vger.kernel.org, bpf@vger.kernel.org Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org, Alexei Starovoitov , Daniel Borkmann Subject: [PATCH 3/5] samples/bpf: fix xdpsock_user build error Date: Sat, 18 May 2019 02:46:37 +0200 Message-Id: <20190518004639.20648-3-mcroce@redhat.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190518004639.20648-1-mcroce@redhat.com> References: <20190518004639.20648-1-mcroce@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Remove duplicate typedef, and use PRIu64 to be both 32 and 64 bit aware. Fix the following error: samples/bpf/xdpsock_user.c:52:15: error: conflicting types for ‘u64’ 52 | typedef __u64 u64; | ^~~ In file included from ./tools/include/linux/compiler.h:87, from ./tools/include/asm/barrier.h:2, from samples/bpf/xdpsock_user.c:4: ./tools/include/linux/types.h:30:18: note: previous declaration of ‘u64’ was here 30 | typedef uint64_t u64; | ^~~ make[2]: *** [scripts/Makefile.host:109: samples/bpf/xdpsock_user.o] Error 1 make[1]: *** [Makefile:1763: samples/bpf/] Error 2 Signed-off-by: Matteo Croce --- samples/bpf/xdpsock_user.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/samples/bpf/xdpsock_user.c b/samples/bpf/xdpsock_user.c index d08ee1ab7bb4..a4cd42c2f0b0 100644 --- a/samples/bpf/xdpsock_user.c +++ b/samples/bpf/xdpsock_user.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include @@ -49,9 +50,6 @@ #define DEBUG_HEXDUMP 0 #define MAX_SOCKS 8 -typedef __u64 u64; -typedef __u32 u32; - static unsigned long prev_time; enum benchmark_type { @@ -243,7 +241,7 @@ static void hex_dump(void *pkt, size_t length, u64 addr) if (!DEBUG_HEXDUMP) return; - sprintf(buf, "addr=%llu", addr); + sprintf(buf, "addr=%" PRIu64, addr); printf("length = %zu\n", length); printf("%s | ", buf); while (length-- > 0) { -- 2.21.0