Received: by 10.223.164.200 with SMTP id h8csp54692wrb; Sun, 5 Nov 2017 02:58:25 -0800 (PST) X-Google-Smtp-Source: ABhQp+RVXfvIXSuIHT3lTkEEnEyoHzhgm/wDNhLbn4cxqN/B+3NJT2OoHo43w1WsM4engFU9Il2E X-Received: by 10.101.81.139 with SMTP id h11mr12161481pgq.233.1509879505824; Sun, 05 Nov 2017 02:58:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1509879505; cv=none; d=google.com; s=arc-20160816; b=g2qsAuJKT9W9LbTI2EH7zaSMmc/dXKoVg1lYF0lNSrfY6SxDLF/XCXciLi6Mvj2tji Vhpekl43ycNegbhcEV8rr6WBY/oB6uD8QsWym4KMI+oB/thP0f7tAOuWnKu93eZ09ERk Su+v7IynZTRFN3aAEg42/lZ/o3zLhB94asbDZVdrxyOzXYZqGDUo2HMr0WHntFNc4rv9 soovV0D5OW4GesL0bOnLyH4dYCOoebEverEjwJ87osAB6+FNgOCSea8fK4WkKFRIpyGm wSnDYwORhphJ803BrENynElez+/8Siiouoa/HjyjJGoYRXyWD/zpvDTKnvHBfNqy/Y+f WgZg== 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 :message-id:date:subject:to:from:arc-authentication-results; bh=/5exNDdo2x9xLJSNat0Ya0HAVLxVYfq6LYQq8frgoyo=; b=0WdE4ukzQUwMl4dFhrteUBb6LGTE/U+RuxprtDLBW4Z8fsRGjyHwIsi+KWwZa0kL8L yo2mVSeYJWPiGyZXuJ+/FyHrhrF8B+IofLRjO14MdzBmuqNZVEamRzwUbdwJLnzbPEx9 VPQHz2xAn6q/DPcXDFavkaAuoSK2rrLqG/lv/SRiV3H/o5wJZE/RA72G/Y25SgVhipjV yUezPnHLXosPiDYUNBSCRxjKtb2tMd17FBgVoGVSMMaAJ2KKTJ4tE/VQCDMuwf7hR/Hc ll/1YkyFdOtVDD/tpTNTiHQUosvrhwXub0FEkqXW/LRr1Hwqaxtr9plu3cVfhh015T4V /k9Q== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b8si10280897pff.141.2017.11.05.02.58.00; Sun, 05 Nov 2017 02:58:25 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752002AbdKEK5H (ORCPT + 96 others); Sun, 5 Nov 2017 05:57:07 -0500 Received: from mail1.windriver.com ([147.11.146.13]:56068 "EHLO mail1.windriver.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750888AbdKEK5F (ORCPT ); Sun, 5 Nov 2017 05:57:05 -0500 Received: from ALA-HCB.corp.ad.wrs.com (ala-hcb.corp.ad.wrs.com [147.11.189.41]) by mail1.windriver.com (8.15.2/8.15.1) with ESMTPS id vA5Av4h6014539 (version=TLSv1 cipher=AES128-SHA bits=128 verify=FAIL); Sun, 5 Nov 2017 02:57:04 -0800 (PST) Received: from pek-lyang0-d1.corp.ad.wrs.com (128.224.163.162) by ALA-HCB.corp.ad.wrs.com (147.11.189.41) with Microsoft SMTP Server id 14.3.361.1; Sun, 5 Nov 2017 02:57:03 -0800 From: Lei Yang To: , , , Subject: [PATCH] selftests: memfd_test.c: fix compilation warning. Date: Sun, 5 Nov 2017 18:56:40 +0800 Message-ID: <1509879400-26061-1-git-send-email-Lei.Yang@windriver.com> X-Mailer: git-send-email 1.9.1 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 Replace '%d' by '%zu' to fix the following compilation warning. memfd_test.c:517:3: warning: format ‘%d’ expects argument of type ‘int’,but argument 2 has type ‘size_t’ [-Wformat=] printf("malloc(%d) failed: %m\n", mfd_def_size * 8); ^ memfd_test.c: In function ‘mfd_fail_grow_write’: memfd_test.c:537:3: warning: format ‘%d’ expects argument of type ‘int’,but argument 2 has type ‘size_t’ [-Wformat=] printf("malloc(%d) failed: %m\n", mfd_def_size * 8); Signed-off-by: Lei Yang --- tools/testing/selftests/memfd/memfd_test.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/memfd/memfd_test.c b/tools/testing/selftests/memfd/memfd_test.c index f94c6d1..95df9e6 100644 --- a/tools/testing/selftests/memfd/memfd_test.c +++ b/tools/testing/selftests/memfd/memfd_test.c @@ -514,7 +514,7 @@ static void mfd_assert_grow_write(int fd) buf = malloc(mfd_def_size * 8); if (!buf) { - printf("malloc(%d) failed: %m\n", mfd_def_size * 8); + printf("malloc(%zu) failed: %m\n", mfd_def_size * 8); abort(); } @@ -534,7 +534,7 @@ static void mfd_fail_grow_write(int fd) buf = malloc(mfd_def_size * 8); if (!buf) { - printf("malloc(%d) failed: %m\n", mfd_def_size * 8); + printf("malloc(%zu) failed: %m\n", mfd_def_size * 8); abort(); } -- 1.9.1 From 1583918308856978839@xxx Mon Nov 13 03:03:30 +0000 2017 X-GM-THRID: 1583918308856978839 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread