From patchwork Wed Nov 27 10:15:27 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 3247191 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 18766C045B for ; Wed, 27 Nov 2013 10:15:50 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B1B1D20583 for ; Wed, 27 Nov 2013 10:15:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8F1EC20398 for ; Wed, 27 Nov 2013 10:15:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752602Ab3K0KPi (ORCPT ); Wed, 27 Nov 2013 05:15:38 -0500 Received: from perceval.ideasonboard.com ([95.142.166.194]:52329 "EHLO perceval.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752121Ab3K0KPh (ORCPT ); Wed, 27 Nov 2013 05:15:37 -0500 Received: from avalon.ideasonboard.com (189-151-5-188.mobileinternet.proximus.be [188.5.151.189]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 2A7C535A6A; Wed, 27 Nov 2013 11:14:52 +0100 (CET) From: Laurent Pinchart To: linux-sh@vger.kernel.org Cc: Guennadi Liakhovetski , Mauro Carvalho Chehab , linux-media@vger.kernel.org Subject: [PATCH v2] v4l: sh_vou: Fix warnings due to improper casts and printk formats Date: Wed, 27 Nov 2013 11:15:27 +0100 Message-Id: <1385547327-13657-1-git-send-email-laurent.pinchart+renesas@ideasonboard.com> X-Mailer: git-send-email 1.8.3.2 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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=ham 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 Use the %zu printk specifier to print size_t variables, and cast pointers to uintptr_t instead of unsigned int where applicable. This fixes warnings on platforms where pointers and/or dma_addr_t have a different size than int. Cc: Guennadi Liakhovetski Cc: Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org Signed-off-by: Laurent Pinchart --- drivers/media/platform/sh_vou.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) Changes compared to v1: - Cast to uintptr_t instead of unsigned long diff --git a/drivers/media/platform/sh_vou.c b/drivers/media/platform/sh_vou.c index 4f30341..69e2125 100644 --- a/drivers/media/platform/sh_vou.c +++ b/drivers/media/platform/sh_vou.c @@ -286,7 +286,7 @@ static int sh_vou_buf_prepare(struct videobuf_queue *vq, vb->size = vb->height * bytes_per_line; if (vb->baddr && vb->bsize < vb->size) { /* User buffer too small */ - dev_warn(vq->dev, "User buffer too small: [%u] @ %lx\n", + dev_warn(vq->dev, "User buffer too small: [%zu] @ %lx\n", vb->bsize, vb->baddr); return -EINVAL; } @@ -302,9 +302,9 @@ static int sh_vou_buf_prepare(struct videobuf_queue *vq, } dev_dbg(vou_dev->v4l2_dev.dev, - "%s(): fmt #%d, %u bytes per line, phys 0x%x, type %d, state %d\n", + "%s(): fmt #%d, %u bytes per line, phys 0x%lx, type %d, state %d\n", __func__, vou_dev->pix_idx, bytes_per_line, - videobuf_to_dma_contig(vb), vb->memory, vb->state); + (uintptr_t)videobuf_to_dma_contig(vb), vb->memory, vb->state); return 0; }