From patchwork Mon Oct 21 08:28:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Masami Hiramatsu (Google)" X-Patchwork-Id: 11201529 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 80F2A13B1 for ; Mon, 21 Oct 2019 08:28:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6016B21479 for ; Mon, 21 Oct 2019 08:28:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1571646494; bh=jZhiQuwui5uvdxmSEHpGwDzgWsZOGECYi8YLmpO+wis=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=JyB0Ota3DHa9Rfb/2vcy7jX3gK0jXCy/1txOCrTHr1Arrr054C+SZdT2iSeAP4ZLk zhSKXH6Ch8qQpjgf+FzDvXFdTIfq/FSvnIuXOlvMC2Ja3cytDPuwHW9/R3AOVEJQWz iKYYalviZvh/ikVXJF3b9OBJfl3hnMRfdMv84heY= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726289AbfJUI2O (ORCPT ); Mon, 21 Oct 2019 04:28:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:53662 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726180AbfJUI2N (ORCPT ); Mon, 21 Oct 2019 04:28:13 -0400 Received: from localhost.localdomain (NE2965lan1.rev.em-net.ne.jp [210.141.244.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B1BA62064A; Mon, 21 Oct 2019 08:28:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1571646493; bh=jZhiQuwui5uvdxmSEHpGwDzgWsZOGECYi8YLmpO+wis=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fw3GOsHcrRlnYf6EDWIghgjjk9tJfPhY068ta0VS9094ZZvjMu4oDQBaQVNwc1Xrx rxk1GUJwWwCpcc8CnFg6nQWJLs/BYMEXKhcTeUgej5cLzWIkSf7srtJqqnlJaHwKiT 1Sk3Y3pvUY6uZ2DLQaBMtLmctGm5JsL8uMssQ6pw= From: Masami Hiramatsu To: Shuah Khan Cc: linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, jaswinder.singh@linaro.org, Alexey Dobriyan Subject: [BUGFIX PATCH v2 1/5] selftests: proc: Make va_max 1GB on 32bit arch Date: Mon, 21 Oct 2019 17:28:09 +0900 Message-Id: <157164648909.17692.6080553792829040898.stgit@devnote2> X-Mailer: git-send-email 2.20.1 In-Reply-To: <157164647813.17692.3834082082658965225.stgit@devnote2> References: <157164647813.17692.3834082082658965225.stgit@devnote2> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Sender: linux-kselftest-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org Currently proc-self-map-files-002.c sets va_max (max test address of user virtual address) to 4GB, but it is too big for 32bit arch and 1UL << 32 is overflow on 32bit long. Make va_max 1GB on 32bit arch like i386 and arm. Signed-off-by: Masami Hiramatsu Cc: Alexey Dobriyan --- Changes in v2: - Make the va_max 1GB according to Alexey's comment. --- .../selftests/proc/proc-self-map-files-002.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/proc/proc-self-map-files-002.c b/tools/testing/selftests/proc/proc-self-map-files-002.c index 47b7473dedef..5d372d66d6ad 100644 --- a/tools/testing/selftests/proc/proc-self-map-files-002.c +++ b/tools/testing/selftests/proc/proc-self-map-files-002.c @@ -22,6 +22,7 @@ #include #include #include +#include static void pass(const char *fmt, unsigned long a, unsigned long b) { @@ -44,10 +45,18 @@ static void fail(const char *fmt, unsigned long a, unsigned long b) exit(1); } +#if __BITS_PER_LONG == 32 +# define VA_MAX (1UL << 30) +#elif __BITS_PER_LONG == 64 +# define VA_MAX (1UL << 32) +#else +# define VA_MAX 0 +#endif + int main(void) { const int PAGE_SIZE = sysconf(_SC_PAGESIZE); - const unsigned long va_max = 1UL << 32; + const unsigned long va_max = VA_MAX; unsigned long va; void *p; int fd; From patchwork Mon Oct 21 08:28:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Masami Hiramatsu (Google)" X-Patchwork-Id: 11201531 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 40F9113B1 for ; Mon, 21 Oct 2019 08:28:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1F898214D9 for ; Mon, 21 Oct 2019 08:28:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1571646504; bh=tDjT88ehXn17T4Z8Un3YkEcUnFAmU6vDClRr1XSP4eU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=UiCHmgWtFj2fs4YxGOp63DWDcDRScHLLQEqmgYKXrrOl5FNwwJyXo1cGMGz7r1NiQ bxdDE/DYPu22XFyAJbdnNpvlBzkm3NrlnojN1pm2LDgiryJGLlTs2YiWHj4+jV61TA htbUi4X8j+x4yySN+Hi1CCA0yF959x8zNhEXw3DU= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727700AbfJUI2X (ORCPT ); Mon, 21 Oct 2019 04:28:23 -0400 Received: from mail.kernel.org ([198.145.29.99]:53762 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726180AbfJUI2X (ORCPT ); Mon, 21 Oct 2019 04:28:23 -0400 Received: from localhost.localdomain (NE2965lan1.rev.em-net.ne.jp [210.141.244.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0C0FB2064A; Mon, 21 Oct 2019 08:28:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1571646502; bh=tDjT88ehXn17T4Z8Un3YkEcUnFAmU6vDClRr1XSP4eU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=k/S0BIN6FthMY7nGWZKMDt3knzW5mNoyrW400Rd0XNo9+SBfwIj6EozNtWoMw5/bt Yn2I63Nz/BEAl4XSszrNxHUOvd04KuZEjZAgV3iX4EyedCj8lXlyFa5CRgu3PbAad/ uh3GTf1u26OlTSF+fku0QThJ+L+IsGKIsSF27AmY= From: Masami Hiramatsu To: Shuah Khan Cc: linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, jaswinder.singh@linaro.org, Anshuman Khandual , "Aneesh Kumar K . V" Subject: [BUGFIX PATCH v2 2/5] selftests: vm: Build/Run 64bit tests only on 64bit arch Date: Mon, 21 Oct 2019 17:28:18 +0900 Message-Id: <157164649814.17692.12605711936383924363.stgit@devnote2> X-Mailer: git-send-email 2.20.1 In-Reply-To: <157164647813.17692.3834082082658965225.stgit@devnote2> References: <157164647813.17692.3834082082658965225.stgit@devnote2> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Sender: linux-kselftest-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org Some virtual address range tests requires 64bit address space, and we can not build and run those tests on the 32bit machine. Filter the 64bit architectures in Makefile and run_vmtests, so that those tests are built/run only on 64bit archs. Signed-off-by: Masami Hiramatsu Cc: Anshuman Khandual Cc: Aneesh Kumar K.V --- tools/testing/selftests/vm/Makefile | 5 +++++ tools/testing/selftests/vm/run_vmtests | 10 ++++++++++ 2 files changed, 15 insertions(+) diff --git a/tools/testing/selftests/vm/Makefile b/tools/testing/selftests/vm/Makefile index 9534dc2bc929..7f9a8a8c31da 100644 --- a/tools/testing/selftests/vm/Makefile +++ b/tools/testing/selftests/vm/Makefile @@ -1,5 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 # Makefile for vm selftests +uname_M := $(shell uname -m 2>/dev/null || echo not) +ARCH ?= $(shell echo $(uname_M) | sed -e 's/aarch64.*/arm64/') CFLAGS = -Wall -I ../../../../usr/include $(EXTRA_CFLAGS) LDLIBS = -lrt @@ -16,8 +18,11 @@ TEST_GEN_FILES += on-fault-limit TEST_GEN_FILES += thuge-gen TEST_GEN_FILES += transhuge-stress TEST_GEN_FILES += userfaultfd + +ifneq (,$(filter $(ARCH),arm64 ia64 mips64 parisc64 ppc64 riscv64 s390x sh64 sparc64 x86_64)) TEST_GEN_FILES += va_128TBswitch TEST_GEN_FILES += virtual_address_range +endif TEST_PROGS := run_vmtests diff --git a/tools/testing/selftests/vm/run_vmtests b/tools/testing/selftests/vm/run_vmtests index 951c507a27f7..a692ea828317 100755 --- a/tools/testing/selftests/vm/run_vmtests +++ b/tools/testing/selftests/vm/run_vmtests @@ -58,6 +58,14 @@ else exit 1 fi +#filter 64bit architectures +ARCH64STR="arm64 ia64 mips64 parisc64 ppc64 riscv64 s390x sh64 sparc64 x86_64" +if [ -z $ARCH ]; then + ARCH=`uname -m 2>/dev/null | sed -e 's/aarch64.*/arm64/'` +fi +VADDR64=0 +echo "$ARCH64STR" | grep $ARCH && VADDR64=1 + mkdir $mnt mount -t hugetlbfs none $mnt @@ -189,6 +197,7 @@ else echo "[PASS]" fi +if [ $VADDR64 -ne 0 ]; then echo "-----------------------------" echo "running virtual_address_range" echo "-----------------------------" @@ -210,6 +219,7 @@ if [ $? -ne 0 ]; then else echo "[PASS]" fi +fi # VADDR64 echo "------------------------------------" echo "running vmalloc stability smoke test" From patchwork Mon Oct 21 08:28:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Masami Hiramatsu (Google)" X-Patchwork-Id: 11201533 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D923C13B1 for ; Mon, 21 Oct 2019 08:28:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B7D8A20B7C for ; Mon, 21 Oct 2019 08:28:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1571646513; bh=FIUvS515BRyZWWsbgjwGzMabdeFOcPuhq53HL6bR4Bk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=S0JUR9FHSmInVKOsDqf89uQCk8yIYWddJrWEWDK86SkROb//jL5NM/jpv9by0GMwf ln6vD7qLd0LohrQakFTkjfVJGuh3amPbpz0rkhXetKB3mdqLBLBWSn8cCcLx4ByrKZ Jj/kCnRpg0FXD9kPgrB5uCFoeov41+0RIHX2CGw8= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727739AbfJUI2d (ORCPT ); Mon, 21 Oct 2019 04:28:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:53846 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727731AbfJUI2d (ORCPT ); Mon, 21 Oct 2019 04:28:33 -0400 Received: from localhost.localdomain (NE2965lan1.rev.em-net.ne.jp [210.141.244.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 123D82064A; Mon, 21 Oct 2019 08:28:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1571646512; bh=FIUvS515BRyZWWsbgjwGzMabdeFOcPuhq53HL6bR4Bk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OSeTWBPV7ypd+9HnmaeOdnzJVqJ+IIjjor3H0jTzS8NvBbww+bMKQMmTMYxHaos5Y 1xhKoiwEDk/U7N4cqUuxEi4bRjsw//LDW9M/4p3Bp7GuGy/GPDerlsSIwHbHpUW6PL IlO0tqmpG6oI9nDozdoQBUpqTtXuyxn9dKdko934= From: Masami Hiramatsu To: Shuah Khan Cc: linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, jaswinder.singh@linaro.org, Eric Dumazet , "David S . Miller" Subject: [BUGFIX PATCH v2 3/5] selftests: net: Use size_t and ssize_t for counting file size Date: Mon, 21 Oct 2019 17:28:27 +0900 Message-Id: <157164650777.17692.4048211617331943317.stgit@devnote2> X-Mailer: git-send-email 2.20.1 In-Reply-To: <157164647813.17692.3834082082658965225.stgit@devnote2> References: <157164647813.17692.3834082082658965225.stgit@devnote2> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Sender: linux-kselftest-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org Use size_t and ssize_t correctly for counting send file size instead of unsigned long and long, because long is 32bit on 32bit arch, which is not enough for counting long file size (>4GB). Signed-off-by: Masami Hiramatsu Cc: Eric Dumazet Cc: David S. Miller --- tools/testing/selftests/net/tcp_mmap.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/testing/selftests/net/tcp_mmap.c b/tools/testing/selftests/net/tcp_mmap.c index 31ced79f4f25..33035d1b3f6d 100644 --- a/tools/testing/selftests/net/tcp_mmap.c +++ b/tools/testing/selftests/net/tcp_mmap.c @@ -71,7 +71,7 @@ #define MSG_ZEROCOPY 0x4000000 #endif -#define FILE_SZ (1UL << 35) +#define FILE_SZ (1ULL << 35) static int cfg_family = AF_INET6; static socklen_t cfg_alen = sizeof(struct sockaddr_in6); static int cfg_port = 8787; @@ -155,7 +155,7 @@ void *child_thread(void *arg) socklen_t zc_len = sizeof(zc); int res; - zc.address = (__u64)addr; + zc.address = (__u64)((unsigned long)addr); zc.length = chunk_size; zc.recv_skip_hint = 0; res = getsockopt(fd, IPPROTO_TCP, TCP_ZEROCOPY_RECEIVE, @@ -302,7 +302,7 @@ int main(int argc, char *argv[]) { struct sockaddr_storage listenaddr, addr; unsigned int max_pacing_rate = 0; - unsigned long total = 0; + size_t total = 0; char *host = NULL; int fd, c, on = 1; char *buffer; @@ -417,7 +417,7 @@ int main(int argc, char *argv[]) zflg = 0; } while (total < FILE_SZ) { - long wr = FILE_SZ - total; + ssize_t wr = FILE_SZ - total; if (wr > chunk_size) wr = chunk_size; From patchwork Mon Oct 21 08:28:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Masami Hiramatsu (Google)" X-Patchwork-Id: 11201535 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6B94D1515 for ; Mon, 21 Oct 2019 08:28:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4AF94218AC for ; Mon, 21 Oct 2019 08:28:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1571646530; bh=84/HqT9rjw/ELPe/YzzmH2eHPW0t/8HjIohY6R+znnM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=SSrG8eJ2GwUH9J44qqB2K2iPTRHUfNJwCgYKoc86WcllYFVkvipYI6i1TVffw2hvv HatIlnkGkW+8YtWrSDGLpTtYOq81jeQsERnqoTgYxNc2x+r4iKuZdqt+lKqSaL66BZ oL8yz8y9gkkFm23+Zp1p8clWyA2OmC4/TV4nwOGQ= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727771AbfJUI2n (ORCPT ); Mon, 21 Oct 2019 04:28:43 -0400 Received: from mail.kernel.org ([198.145.29.99]:54058 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727730AbfJUI2n (ORCPT ); Mon, 21 Oct 2019 04:28:43 -0400 Received: from localhost.localdomain (NE2965lan1.rev.em-net.ne.jp [210.141.244.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id ABB622064A; Mon, 21 Oct 2019 08:28:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1571646522; bh=84/HqT9rjw/ELPe/YzzmH2eHPW0t/8HjIohY6R+znnM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NMWor8CBwUXiQh5rncav7Kexi7FfflGraUBi23S3CZOr01iNX1VQLsciMv7n2F+gN ILZ9SLyBk+ytgnkp0cam9uHOQ+dgrEFa6dNOcDlJ00U174pRoAw6WR3NWQh4FrXQb3 lTBvwTflNQadK3FLagX7olED2bSz6EsQgUNfXOG8= From: Masami Hiramatsu To: Shuah Khan Cc: linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, jaswinder.singh@linaro.org, Willem de Bruijn , "David S . Miller" Subject: [BUGFIX PATCH v2 4/5] selftests: net: Fix printf format warnings on arm Date: Mon, 21 Oct 2019 17:28:38 +0900 Message-Id: <157164651785.17692.6080511663250117610.stgit@devnote2> X-Mailer: git-send-email 2.20.1 In-Reply-To: <157164647813.17692.3834082082658965225.stgit@devnote2> References: <157164647813.17692.3834082082658965225.stgit@devnote2> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Sender: linux-kselftest-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org Fix printf format warnings on arm (and other 32bit arch). - udpgso.c and udpgso_bench_tx use %lu for size_t but it should be unsigned long long on 32bit arch. - so_txtime.c uses %ld for int64_t, but it should be unsigned long long on 32bit arch. Signed-off-by: Masami Hiramatsu Cc: Willem de Bruijn Cc: David S. Miller --- tools/testing/selftests/net/so_txtime.c | 4 ++-- tools/testing/selftests/net/udpgso.c | 3 ++- tools/testing/selftests/net/udpgso_bench_tx.c | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/tools/testing/selftests/net/so_txtime.c b/tools/testing/selftests/net/so_txtime.c index 53f598f06647..34df4c8882af 100644 --- a/tools/testing/selftests/net/so_txtime.c +++ b/tools/testing/selftests/net/so_txtime.c @@ -105,8 +105,8 @@ static void do_recv_one(int fdr, struct timed_send *ts) tstop = (gettime_ns() - glob_tstart) / 1000; texpect = ts->delay_us >= 0 ? ts->delay_us : 0; - fprintf(stderr, "payload:%c delay:%ld expected:%ld (us)\n", - rbuf[0], tstop, texpect); + fprintf(stderr, "payload:%c delay:%lld expected:%lld (us)\n", + rbuf[0], (long long)tstop, (long long)texpect); if (rbuf[0] != ts->data) error(1, 0, "payload mismatch. expected %c", ts->data); diff --git a/tools/testing/selftests/net/udpgso.c b/tools/testing/selftests/net/udpgso.c index b8265ee9923f..cab334e51ac1 100644 --- a/tools/testing/selftests/net/udpgso.c +++ b/tools/testing/selftests/net/udpgso.c @@ -448,7 +448,8 @@ static bool __send_one(int fd, struct msghdr *msg, int flags) if (ret == -1) error(1, errno, "sendmsg"); if (ret != msg->msg_iov->iov_len) - error(1, 0, "sendto: %d != %lu", ret, msg->msg_iov->iov_len); + error(1, 0, "sendto: %d != %llu", ret, + (unsigned long long)msg->msg_iov->iov_len); if (msg->msg_flags) error(1, 0, "sendmsg: return flags 0x%x\n", msg->msg_flags); diff --git a/tools/testing/selftests/net/udpgso_bench_tx.c b/tools/testing/selftests/net/udpgso_bench_tx.c index ada99496634a..17512a43885e 100644 --- a/tools/testing/selftests/net/udpgso_bench_tx.c +++ b/tools/testing/selftests/net/udpgso_bench_tx.c @@ -405,7 +405,8 @@ static int send_udp_segment(int fd, char *data) if (ret == -1) error(1, errno, "sendmsg"); if (ret != iov.iov_len) - error(1, 0, "sendmsg: %u != %lu\n", ret, iov.iov_len); + error(1, 0, "sendmsg: %u != %llu\n", ret, + (unsigned long long)iov.iov_len); return 1; } From patchwork Mon Oct 21 08:28:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Masami Hiramatsu (Google)" X-Patchwork-Id: 11201537 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 38D541515 for ; Mon, 21 Oct 2019 08:28:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0C9D7214AE for ; Mon, 21 Oct 2019 08:28:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1571646533; bh=5UOyBnC5qla2Rd1+pYVADdaJfxPTcdJGTel4r+Yxuog=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=QCv7jWPoSWdFF6k1pqhyl7PB8dzD6UgCdeheEnNZHfSWzE5P4jrTG2J+7FGVOZil3 0YH3cyFbfr5+lVHqFnDfFhUNpx7sJw8uXYDcejDKNJZD7ngwdt77bY6PybUyNC0qb1 GwJU3yeLpKP3b4Oo3+G+3bkA6tNSpg6t9k1BGd+A= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727768AbfJUI2w (ORCPT ); Mon, 21 Oct 2019 04:28:52 -0400 Received: from mail.kernel.org ([198.145.29.99]:54242 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727730AbfJUI2w (ORCPT ); Mon, 21 Oct 2019 04:28:52 -0400 Received: from localhost.localdomain (NE2965lan1.rev.em-net.ne.jp [210.141.244.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9A6A220B7C; Mon, 21 Oct 2019 08:28:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1571646531; bh=5UOyBnC5qla2Rd1+pYVADdaJfxPTcdJGTel4r+Yxuog=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DOPtSxlfKJe68UfzwzA1J62LFSHqUxUIij1wLL+OcwzzHCfun3lfi+kwOIksB5aed fzKJDdP80n2pE7Tb8vs1Zvobf2IkmKTTGfxe01e9LnH+xY6Xeb3iQXggjJ7IIIft/e lQASS48XFHg6/kPmhQ5WS3lvdNgXdqtRY+hQaQlU= From: Masami Hiramatsu To: Shuah Khan Cc: linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, jaswinder.singh@linaro.org, =?utf-8?q?Emilio_L=C3=B3pez?= Subject: [BUGFIX PATCH v2 5/5] selftests: sync: Fix cast warnings on arm Date: Mon, 21 Oct 2019 17:28:47 +0900 Message-Id: <157164652761.17692.731770786837445849.stgit@devnote2> X-Mailer: git-send-email 2.20.1 In-Reply-To: <157164647813.17692.3834082082658965225.stgit@devnote2> References: <157164647813.17692.3834082082658965225.stgit@devnote2> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Sender: linux-kselftest-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org Fix warnings on __u64 and pointer translation on arm and other 32bit architectures. Since the pointer is 32bits on those archs, we should not directly cast those types. Signed-off-by: Masami Hiramatsu Cc: Emilio López --- tools/testing/selftests/sync/sync.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/testing/selftests/sync/sync.c b/tools/testing/selftests/sync/sync.c index f3d599f249b9..7741c0518d18 100644 --- a/tools/testing/selftests/sync/sync.c +++ b/tools/testing/selftests/sync/sync.c @@ -109,7 +109,7 @@ static struct sync_file_info *sync_file_info(int fd) return NULL; } - info->sync_fence_info = (uint64_t)fence_info; + info->sync_fence_info = (uint64_t)(unsigned long)fence_info; err = ioctl(fd, SYNC_IOC_FILE_INFO, info); if (err < 0) { @@ -124,7 +124,7 @@ static struct sync_file_info *sync_file_info(int fd) static void sync_file_info_free(struct sync_file_info *info) { - free((void *)info->sync_fence_info); + free((void *)(unsigned long)info->sync_fence_info); free(info); } @@ -152,7 +152,7 @@ int sync_fence_count_with_status(int fd, int status) if (!info) return -1; - fence_info = (struct sync_fence_info *)info->sync_fence_info; + fence_info = (struct sync_fence_info *)(unsigned long)info->sync_fence_info; for (i = 0 ; i < info->num_fences ; i++) { if (fence_info[i].status == status) count++;