From patchwork Fri Aug 17 02:39:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jinhui Huang X-Patchwork-Id: 958634 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=lists.linux.it (client-ip=2001:1418:10:5::2; helo=picard.linux.it; envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=cn.fujitsu.com Received: from picard.linux.it (picard.linux.it [IPv6:2001:1418:10:5::2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41s6qP49Stz9s2P for ; Fri, 17 Aug 2018 12:39:45 +1000 (AEST) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id D189A3E64EC for ; Fri, 17 Aug 2018 04:39:42 +0200 (CEST) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-3.smtp.seeweb.it (in-3.smtp.seeweb.it [217.194.8.3]) by picard.linux.it (Postfix) with ESMTP id A50973E64D4 for ; Fri, 17 Aug 2018 04:39:41 +0200 (CEST) Received: from heian.cn.fujitsu.com (mail.cn.fujitsu.com [183.91.158.132]) by in-3.smtp.seeweb.it (Postfix) with ESMTP id EED761A00981 for ; Fri, 17 Aug 2018 04:39:40 +0200 (CEST) X-IronPort-AV: E=Sophos;i="5.43,368,1503331200"; d="scan'208";a="43560672" Received: from unknown (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 17 Aug 2018 10:39:39 +0800 Received: from G08CNEXCHPEKD02.g08.fujitsu.local (unknown [10.167.33.83]) by cn.fujitsu.com (Postfix) with ESMTP id 567594B41EE4; Fri, 17 Aug 2018 10:39:37 +0800 (CST) Received: from localhost.localdomain.localdomain (10.167.220.196) by G08CNEXCHPEKD02.g08.fujitsu.local (10.167.33.89) with Microsoft SMTP Server (TLS) id 14.3.399.0; Fri, 17 Aug 2018 10:39:39 +0800 From: Jinhui huang To: Date: Fri, 17 Aug 2018 10:39:01 +0800 Message-ID: <1534473541-8372-1-git-send-email-huangjh.jy@cn.fujitsu.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <20180816115434.GB6547@rei> References: <20180816115434.GB6547@rei> MIME-Version: 1.0 X-Originating-IP: [10.167.220.196] X-yoursite-MailScanner-ID: 567594B41EE4.AFFB9 X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: huangjh.jy@cn.fujitsu.com X-Spam-Status: No, score=0.0 required=7.0 tests=none autolearn=disabled version=3.4.0 X-Virus-Scanned: clamav-milter 0.99.2 at in-3.smtp.seeweb.it X-Virus-Status: Clean X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on in-3.smtp.seeweb.it Cc: ltp@lists.linux.it Subject: [LTP] [PATCH v2] syscall/signalfd01: Fix compiler warnings X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.18 Precedence: list List-Id: Linux Test Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" Signed-off-by: Jinhui huang --- testcases/kernel/syscalls/signalfd/signalfd01.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/testcases/kernel/syscalls/signalfd/signalfd01.c b/testcases/kernel/syscalls/signalfd/signalfd01.c index 9859524..72901ff 100644 --- a/testcases/kernel/syscalls/signalfd/signalfd01.c +++ b/testcases/kernel/syscalls/signalfd/signalfd01.c @@ -76,7 +76,7 @@ int TST_TOTAL = 1; #endif #ifdef USE_STUB -int main(int argc, char **argv) +int main(void) { tst_brkm(TCONF, NULL, "System doesn't support execution of the test"); } @@ -94,7 +94,7 @@ int signalfd(int fd, const sigset_t * mask, int flags) void cleanup(void); void setup(void); -int do_test1(int ntst, int sig) +int do_test1(uint32_t sig) { int sfd_for_next; int sfd; @@ -145,7 +145,7 @@ int do_test1(int ntst, int sig) if ((s > 0) && (s != sizeof(struct signalfd_siginfo))) { tst_resm(TFAIL, "getting incomplete signalfd_siginfo data: " - "actual-size=%" PRId32 ", expected-size=%" PRId32, + "actual-size=%zd, expected-size=%zu", s, sizeof(struct signalfd_siginfo)); sfd_for_next = -1; close(sfd); @@ -187,7 +187,7 @@ out: return sfd_for_next; } -void do_test2(int ntst, int fd, int sig) +void do_test2(int fd, uint32_t sig) { int sfd; sigset_t mask; @@ -235,7 +235,7 @@ void do_test2(int ntst, int fd, int sig) if ((s > 0) && (s != sizeof(struct signalfd_siginfo))) { tst_resm(TFAIL, "getting incomplete signalfd_siginfo data: " - "actual-size=%" PRId32 ", expected-size= %" PRId32, + "actual-size=%zd, expected-size= %zu", s, sizeof(struct signalfd_siginfo)); goto out; } else if (s < 0) { @@ -285,11 +285,11 @@ int main(int argc, char **argv) for (lc = 0; TEST_LOOPING(lc); lc++) { tst_count = 0; - sfd = do_test1(lc, SIGUSR1); + sfd = do_test1(SIGUSR1); if (sfd < 0) continue; - do_test2(lc, sfd, SIGUSR2); + do_test2(sfd, SIGUSR2); close(sfd); }