From patchwork Sun Jul 13 18:42:53 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sam Ravnborg X-Patchwork-Id: 4541841 Return-Path: X-Original-To: patchwork-linux-kbuild@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id F17919F36A for ; Sun, 13 Jul 2014 18:44:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 32A9E2013D for ; Sun, 13 Jul 2014 18:44:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 55CD32015E for ; Sun, 13 Jul 2014 18:44:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751694AbaGMSno (ORCPT ); Sun, 13 Jul 2014 14:43:44 -0400 Received: from asavdk4.altibox.net ([109.247.116.15]:60661 "EHLO asavdk4.altibox.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751522AbaGMSn2 (ORCPT ); Sun, 13 Jul 2014 14:43:28 -0400 Received: from localhost (localhost [127.0.0.1]) by asavdk4.altibox.net (Postfix) with ESMTP id B2FA2800A8; Sun, 13 Jul 2014 20:43:26 +0200 (CEST) Received: from asavdk4.altibox.net ([127.0.0.1]) by localhost (asavdk4.lysetele.net [127.0.0.1]) (amavisd-new, port 10024) with LMTP id agjiNaQ4yCnW; Sun, 13 Jul 2014 20:43:26 +0200 (CEST) Received: from merkur.lyse.net (unknown [188.228.89.252]) by asavdk4.altibox.net (Postfix) with ESMTP id 1ABBB800A1; Sun, 13 Jul 2014 20:43:26 +0200 (CEST) From: Sam Ravnborg To: Michal Marek , linux-kbuild Cc: lkml , Thierry Reding , Stephen Rothwell , David Herrmann , Jiri Kosina , Sam Ravnborg Subject: [PATCH 5/6] samples: fix warnings in uhid-example Date: Sun, 13 Jul 2014 20:42:53 +0200 Message-Id: <1405276974-17323-5-git-send-email-sam@ravnborg.org> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1405276974-17323-1-git-send-email-sam@ravnborg.org> References: <20140713183636.GA17241@ravnborg.org> <1405276974-17323-1-git-send-email-sam@ravnborg.org> MIME-Version: 1.0 Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Fix following warnings seen when building using i686: uhid-example.c: In function ‘uhid_write’: uhid-example.c:168:4: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 3 has type ‘ssize_t’ [-Wformat=] uhid-example.c:168:4: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 4 has type ‘unsigned int’ [-Wformat=] uhid-example.c: In function ‘event’: uhid-example.c:239:4: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 3 has type ‘ssize_t’ [-Wformat=] uhid-example.c:239:4: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 4 has type ‘unsigned int’ [-Wformat=] Use "%xd" for arguments of type size_t to fix the warnings. Signed-off-by: Sam Ravnborg Cc: David Herrmann Cc: Jiri Kosina --- samples/uhid/uhid-example.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/samples/uhid/uhid-example.c b/samples/uhid/uhid-example.c index 7d58a4b..f25a5ef 100644 --- a/samples/uhid/uhid-example.c +++ b/samples/uhid/uhid-example.c @@ -164,7 +164,7 @@ static int uhid_write(int fd, const struct uhid_event *ev) fprintf(stderr, "Cannot write to uhid: %m\n"); return -errno; } else if (ret != sizeof(*ev)) { - fprintf(stderr, "Wrong size written to uhid: %ld != %lu\n", + fprintf(stderr, "Wrong size written to uhid: %zd != %zd\n", ret, sizeof(ev)); return -EFAULT; } else { @@ -235,7 +235,7 @@ static int event(int fd) fprintf(stderr, "Cannot read uhid-cdev: %m\n"); return -errno; } else if (ret != sizeof(ev)) { - fprintf(stderr, "Invalid size read from uhid-dev: %ld != %lu\n", + fprintf(stderr, "Invalid size read from uhid-dev: %zd != %zd\n", ret, sizeof(ev)); return -EFAULT; }