From patchwork Wed Oct 23 04:57:40 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: 11205673 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 A60DC112B for ; Wed, 23 Oct 2019 04:57:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 83C892173B for ; Wed, 23 Oct 2019 04:57:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1571806665; bh=5vrDSn4gx5uWB17ZXLelMba+6LXKDNOLUgRmxFZ6nMk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=uQks4BVdnoC7ynEfWxV4S2OOfUhdIWuhElu+o0iMHphW1VFujWqn0IrgYz11pcXMj Pl6VOTm+6wvQUbA+vf9VuCVNWUZAUqW19YRZKVx6nx6kHyrP3xbel6mDTM/DabKwHl 3T5F4YdlRdaPBPCZoii5af7CFMznORacAHmueqvs= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732393AbfJWE5p (ORCPT ); Wed, 23 Oct 2019 00:57:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:60470 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731908AbfJWE5p (ORCPT ); Wed, 23 Oct 2019 00:57:45 -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 369C42173B; Wed, 23 Oct 2019 04:57:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1571806664; bh=5vrDSn4gx5uWB17ZXLelMba+6LXKDNOLUgRmxFZ6nMk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FU1ECglOJpTThrD5PNFGjpyZrB0C98aBTo/Dsi15H5TWAPq6+Ao6U88L9Fh9yrJWQ TEiM1O1loMQrSxulUP/Fgz8GgNIqAl9gUL2QXED7ZrOoNMYCtyRXAdhdzM9dCPAqO8 irgjZhXx8fd8mHZVYEWcfoujqcx8+53o8HYxcUlo= 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 v3 1/5] selftests: proc: Make va_max 1MB Date: Wed, 23 Oct 2019 13:57:40 +0900 Message-Id: <157180666053.17298.15273701201071089765.stgit@devnote2> X-Mailer: git-send-email 2.20.1 In-Reply-To: <157180665007.17298.907392422924029261.stgit@devnote2> References: <157180665007.17298.907392422924029261.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. Also since this value should be enough bigger than vm.mmap_min_addr (64KB or 32KB by default), 1MB should be enough. Make va_max 1MB unconditionally. Signed-off-by: Masami Hiramatsu Cc: Alexey Dobriyan --- Changes in v3: - Make the va_max 1MB unconditionally, according to Alexey's comment. Changes in v2: - Make the va_max 1GB according to Alexey's comment. --- .../selftests/proc/proc-self-map-files-002.c | 6 +++++- 1 file changed, 5 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..e6aa00a183bc 100644 --- a/tools/testing/selftests/proc/proc-self-map-files-002.c +++ b/tools/testing/selftests/proc/proc-self-map-files-002.c @@ -47,7 +47,11 @@ static void fail(const char *fmt, unsigned long a, unsigned long b) int main(void) { const int PAGE_SIZE = sysconf(_SC_PAGESIZE); - const unsigned long va_max = 1UL << 32; + /* + * va_max must be enough bigger than vm.mmap_min_addr, which is + * 64KB/32KB by default. (depends on CONFIG_LSM_MMAP_MIN_ADDR) + */ + const unsigned long va_max = 1UL << 20; unsigned long va; void *p; int fd; From patchwork Wed Oct 23 04:57:49 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: 11205675 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 C16A0112B for ; Wed, 23 Oct 2019 04:57:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A0A8321925 for ; Wed, 23 Oct 2019 04:57:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1571806674; bh=tDjT88ehXn17T4Z8Un3YkEcUnFAmU6vDClRr1XSP4eU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=ZTz7GWP+/QJh+dxUDhlR/rOTHs1f5qtOAccrT6PYNorqX6ltLNVZfWCYub5ErKcWH MZALM2gmXNOK/KidaAN50Ck/tUKYIKoNsw2dTShwAljXjPBm6T+1QyGUCYTK8seHbw 4382doX0AKBY4Fl9e6X4/dEdcehf69xpEFlNRVnA= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388425AbfJWE5y (ORCPT ); Wed, 23 Oct 2019 00:57:54 -0400 Received: from mail.kernel.org ([198.145.29.99]:60564 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731908AbfJWE5y (ORCPT ); Wed, 23 Oct 2019 00:57:54 -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 02ADC2173B; Wed, 23 Oct 2019 04:57:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1571806673; bh=tDjT88ehXn17T4Z8Un3YkEcUnFAmU6vDClRr1XSP4eU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tkk63BgGgN0Sder8DHKsxKpRcaEfyiQZZ91Q0pR/zCwJF7Vmqr1hXcf2XpUkxbrpr U4FKUPRwz6kp32QjsETivadAFxPiSuiMGYE/d8Fw4VjkkBGJFLZTicp/PqGnNHxvpf Q2Pxwjz7NQU5m2w9hokheJyD3kIem+ieYTUBWsQQ= 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 v3 2/5] selftests: vm: Build/Run 64bit tests only on 64bit arch Date: Wed, 23 Oct 2019 13:57:49 +0900 Message-Id: <157180666953.17298.11283933779737949490.stgit@devnote2> X-Mailer: git-send-email 2.20.1 In-Reply-To: <157180665007.17298.907392422924029261.stgit@devnote2> References: <157180665007.17298.907392422924029261.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 Wed Oct 23 04:57:58 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: 11205677 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 888C1112B for ; Wed, 23 Oct 2019 04:58:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 67D4821929 for ; Wed, 23 Oct 2019 04:58:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1571806683; bh=FIUvS515BRyZWWsbgjwGzMabdeFOcPuhq53HL6bR4Bk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=GoFLXlTIqfKC8DFjnKunPLqrvYeanpvnHYDw9CGd8MtgbceQWJovR40kme/kWCJh7 WAJjFjUXuIpqy9IUuMDkbE5Fc8l2dV6SJoDnQeCx9iCfa8sJiBpe79A2+4CJdiQgyb 73VtMuMGErOOljNoAa5nwCGryXbBMOMwpAb877Yw= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388673AbfJWE6D (ORCPT ); Wed, 23 Oct 2019 00:58:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:60648 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388661AbfJWE6C (ORCPT ); Wed, 23 Oct 2019 00:58:02 -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 E686921906; Wed, 23 Oct 2019 04:58:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1571806682; bh=FIUvS515BRyZWWsbgjwGzMabdeFOcPuhq53HL6bR4Bk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Eqqx63IuON9QIIijGLi4L9ePjOEInJNUQ9rkqclGQmOOus5TaFFCPoRVMyL1rzngQ opv32+qCfjn29o+X2GVx6nNbKQ1mBIA/aKSgFxzneyd30kvmGw+e/SlVJ9V/bkK884 EvrzwuZjG2G/HPUsOY7GVwBMeju2oNe4n+g4Vc18= 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 v3 3/5] selftests: net: Use size_t and ssize_t for counting file size Date: Wed, 23 Oct 2019 13:57:58 +0900 Message-Id: <157180667854.17298.10831083001890325403.stgit@devnote2> X-Mailer: git-send-email 2.20.1 In-Reply-To: <157180665007.17298.907392422924029261.stgit@devnote2> References: <157180665007.17298.907392422924029261.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 Wed Oct 23 04:58:07 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: 11205679 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 5AA3D112B for ; Wed, 23 Oct 2019 04:58:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 39BFA21928 for ; Wed, 23 Oct 2019 04:58:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1571806692; bh=84/HqT9rjw/ELPe/YzzmH2eHPW0t/8HjIohY6R+znnM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=exhfAHRlMQ0LnBS8Gz7z64a+P+m9S8rYWguVXj3q8xdm8kfiARULKTFCaah2MCY64 9cSjKmOW7p+a5G8SZpHAc7g0RFjJ62ZFH2FTys8Ah3lG/+btvowLaReelbmltLDsAF d5n2bcJQqGz3XDfsjlHXIPW8LJ/Hsx5bp2dX5KL4= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388661AbfJWE6L (ORCPT ); Wed, 23 Oct 2019 00:58:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:60722 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731908AbfJWE6L (ORCPT ); Wed, 23 Oct 2019 00:58:11 -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 C862421906; Wed, 23 Oct 2019 04:58:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1571806690; bh=84/HqT9rjw/ELPe/YzzmH2eHPW0t/8HjIohY6R+znnM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ASP9CX0TD3l1KfGzBHrNI6gFvGaDEe3CVNIgGcf+YLsPA5gnzZsff6heK1yV2ByPS qO9DBFmk5jd1b55txsNUhIMI1oJPnA/VQDv4MVti3dngYs3s/xyq3GU963b8W+R73/ BEG4qFgCb3mcqPJB3wSvSuC1r0IVk0doe2SjQ2gE= 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 v3 4/5] selftests: net: Fix printf format warnings on arm Date: Wed, 23 Oct 2019 13:58:07 +0900 Message-Id: <157180668734.17298.5861111176598936.stgit@devnote2> X-Mailer: git-send-email 2.20.1 In-Reply-To: <157180665007.17298.907392422924029261.stgit@devnote2> References: <157180665007.17298.907392422924029261.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 Wed Oct 23 04:58:16 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: 11205681 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 933091515 for ; Wed, 23 Oct 2019 04:58:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 717B121929 for ; Wed, 23 Oct 2019 04:58:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1571806701; bh=5UOyBnC5qla2Rd1+pYVADdaJfxPTcdJGTel4r+Yxuog=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=GYNtzcdk5Eh+rIM4N5Ye2TmLGF2D+GLtWeNZ1hk+7ZtiQ9LiM1fvGuOUIbhg47ywI j9G2rDrTssxVTuL+uiQLTwoVmYooqYe+9AErTsK6AGEWZoYrYXBRo9Luq2tU2uTyb4 adO0+ln6n4rDTMtjVjiQ3RZy1Y2dM0pKv+5LynOM= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731554AbfJWE6V (ORCPT ); Wed, 23 Oct 2019 00:58:21 -0400 Received: from mail.kernel.org ([198.145.29.99]:60806 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729233AbfJWE6U (ORCPT ); Wed, 23 Oct 2019 00:58:20 -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 9A44821906; Wed, 23 Oct 2019 04:58:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1571806699; bh=5UOyBnC5qla2Rd1+pYVADdaJfxPTcdJGTel4r+Yxuog=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JsuTaaG9XM9Ddn0hN5C+a4ZVb7VKn3qnj13bReZNJXttymLzG1LXTcl9cz+mVDs7f vZqAzbL/xGREwwF84F+ApA19aMqUGR96YzGMcrq9pRmAeNnikL2xKE+K2jMe3JOFSF OWtt30NcZn5+x71Ybl7QiRU6nzol/IqygQ5RIjkE= 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 v3 5/5] selftests: sync: Fix cast warnings on arm Date: Wed, 23 Oct 2019 13:58:16 +0900 Message-Id: <157180669615.17298.13418495289425106434.stgit@devnote2> X-Mailer: git-send-email 2.20.1 In-Reply-To: <157180665007.17298.907392422924029261.stgit@devnote2> References: <157180665007.17298.907392422924029261.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++;