From patchwork Fri Jul 20 11:54:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jinhui Huang X-Patchwork-Id: 946841 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 41X8V72xB6z9s7c for ; Fri, 20 Jul 2018 21:55:55 +1000 (AEST) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 6B4D03E77C3 for ; Fri, 20 Jul 2018 13:55:51 +0200 (CEST) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-2.smtp.seeweb.it (in-2.smtp.seeweb.it [IPv6:2001:4b78:1:20::2]) by picard.linux.it (Postfix) with ESMTP id A561E3E66DA for ; Fri, 20 Jul 2018 13:55:49 +0200 (CEST) Received: from heian.cn.fujitsu.com (mail.cn.fujitsu.com [183.91.158.132]) by in-2.smtp.seeweb.it (Postfix) with ESMTP id AAB88601EEF for ; Fri, 20 Jul 2018 13:55:48 +0200 (CEST) X-IronPort-AV: E=Sophos;i="5.43,368,1503331200"; d="scan'208";a="42480366" Received: from unknown (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 20 Jul 2018 19:55:05 +0800 Received: from G08CNEXCHPEKD02.g08.fujitsu.local (unknown [10.167.33.83]) by cn.fujitsu.com (Postfix) with ESMTP id D49494B5CF72 for ; Fri, 20 Jul 2018 19:55:05 +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, 20 Jul 2018 19:55:04 +0800 From: Jinhui huang To: Date: Fri, 20 Jul 2018 19:54:57 +0800 Message-ID: <1532087697-28093-1-git-send-email-huangjh.jy@cn.fujitsu.com> X-Mailer: git-send-email 1.8.3.1 MIME-Version: 1.0 X-Originating-IP: [10.167.220.196] X-yoursite-MailScanner-ID: D49494B5CF72.ADB3A 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-2.smtp.seeweb.it X-Virus-Status: Clean X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on in-2.smtp.seeweb.it Subject: [LTP] [PATCH] syscalls/signalfd01.c: 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 | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/testcases/kernel/syscalls/signalfd/signalfd01.c b/testcases/kernel/syscalls/signalfd/signalfd01.c index 9859524..0c33603 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(int 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" PRId32 ", expected-size=%ld" PRId32, s, sizeof(struct signalfd_siginfo)); sfd_for_next = -1; close(sfd); @@ -170,7 +170,7 @@ int do_test1(int ntst, int sig) goto out; } - if (fdsi.SIGNALFD_PREFIX(signo) == sig) { + if ((int)fdsi.SIGNALFD_PREFIX(signo) == sig) { tst_resm(TPASS, "got expected signal"); sfd_for_next = sfd; goto out; @@ -187,7 +187,7 @@ out: return sfd_for_next; } -void do_test2(int ntst, int fd, int sig) +void do_test2(int fd, int 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" PRId32 ", expected-size= %ld" PRId32, s, sizeof(struct signalfd_siginfo)); goto out; } else if (s < 0) { @@ -254,7 +254,7 @@ void do_test2(int ntst, int fd, int sig) goto out; } - if (fdsi.SIGNALFD_PREFIX(signo) == sig) { + if ((int)fdsi.SIGNALFD_PREFIX(signo) == sig) { tst_resm(TPASS, "got expected signal"); goto out; } else { @@ -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); }