From patchwork Tue Sep 18 12:32:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 10604283 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B486C5A4 for ; Tue, 18 Sep 2018 12:32:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A453F2A85C for ; Tue, 18 Sep 2018 12:32:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 986AA2A860; Tue, 18 Sep 2018 12:32:46 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1D4CF2A85C for ; Tue, 18 Sep 2018 12:32:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729778AbeIRSFH (ORCPT ); Tue, 18 Sep 2018 14:05:07 -0400 Received: from perceval.ideasonboard.com ([213.167.242.64]:56876 "EHLO perceval.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729753AbeIRSFF (ORCPT ); Tue, 18 Sep 2018 14:05:05 -0400 Received: from avalon.bb.dnainternet.fi (dfj612ybrt5fhg77mgycy-3.rev.dnainternet.fi [IPv6:2001:14ba:21f5:5b00:2e86:4862:ef6a:2804]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 102A91C0C; Tue, 18 Sep 2018 14:32:39 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1537273959; bh=kO9FJvBEDFvXOU4pnjLHEYr6wJFDI2ldyOiX5Ji9apo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YJ8HmutBnJAdCW8aCFjT2dAv6fUL33veA0Y5/wJcLVk7dsQRMu0VhjPzOObgsKvK4 G/+sWEtSaEbPu1EUy2csM8TFfWs+ukEOpRu2bHsYMqXAfXkqbygzcQ82ZXXehSIqO/ HmVUAh/Qe9qCmy/vRYN1IcLjQNgp6/qHUrqKdpSE= From: Laurent Pinchart To: linux-usb@vger.kernel.org Cc: kieran.bingham@ideasonboard.com, paul.elder@ideasonboard.com Subject: [PATCH 4/4] usb: gadget: uvc: configfs: Use %u to print unsigned int values Date: Tue, 18 Sep 2018 15:32:47 +0300 Message-Id: <20180918123247.6927-5-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20180918123247.6927-1-laurent.pinchart@ideasonboard.com> References: <20180918123247.6927-1-laurent.pinchart@ideasonboard.com> Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The driver uses the %d format to print unsigned int values. The correct format is %u. Fix it. Signed-off-by: Laurent Pinchart --- drivers/usb/gadget/function/uvc_configfs.c | 32 +++++++++++++++--------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/drivers/usb/gadget/function/uvc_configfs.c b/drivers/usb/gadget/function/uvc_configfs.c index 36f8f03e25e4..bc1e2af566c3 100644 --- a/drivers/usb/gadget/function/uvc_configfs.c +++ b/drivers/usb/gadget/function/uvc_configfs.c @@ -154,7 +154,7 @@ static ssize_t uvcg_control_header_##cname##_show( \ opts = to_f_uvc_opts(opts_item); \ \ mutex_lock(&opts->lock); \ - result = sprintf(page, "%d\n", le##bits##_to_cpu(ch->desc.aname));\ + result = sprintf(page, "%u\n", le##bits##_to_cpu(ch->desc.aname));\ mutex_unlock(&opts->lock); \ \ mutex_unlock(su_mutex); \ @@ -274,7 +274,7 @@ static ssize_t uvcg_default_processing_##cname##_show( \ pd = &opts->uvc_processing; \ \ mutex_lock(&opts->lock); \ - result = sprintf(page, "%d\n", le##bits##_to_cpu(pd->aname)); \ + result = sprintf(page, "%u\n", le##bits##_to_cpu(pd->aname)); \ mutex_unlock(&opts->lock); \ \ mutex_unlock(su_mutex); \ @@ -309,7 +309,7 @@ static ssize_t uvcg_default_processing_bm_controls_show( mutex_lock(&opts->lock); for (result = 0, i = 0; i < pd->bControlSize; ++i) { - result += sprintf(pg, "%d\n", pd->bmControls[i]); + result += sprintf(pg, "%u\n", pd->bmControls[i]); pg = page + result; } mutex_unlock(&opts->lock); @@ -378,7 +378,7 @@ static ssize_t uvcg_default_camera_##cname##_show( \ cd = &opts->uvc_camera_terminal; \ \ mutex_lock(&opts->lock); \ - result = sprintf(page, "%d\n", le##bits##_to_cpu(cd->aname)); \ + result = sprintf(page, "%u\n", le##bits##_to_cpu(cd->aname)); \ mutex_unlock(&opts->lock); \ \ mutex_unlock(su_mutex); \ @@ -421,7 +421,7 @@ static ssize_t uvcg_default_camera_bm_controls_show( mutex_lock(&opts->lock); for (result = 0, i = 0; i < cd->bControlSize; ++i) { - result += sprintf(pg, "%d\n", cd->bmControls[i]); + result += sprintf(pg, "%u\n", cd->bmControls[i]); pg = page + result; } mutex_unlock(&opts->lock); @@ -492,7 +492,7 @@ static ssize_t uvcg_default_output_##cname##_show( \ cd = &opts->uvc_output_terminal; \ \ mutex_lock(&opts->lock); \ - result = sprintf(page, "%d\n", le##bits##_to_cpu(cd->aname)); \ + result = sprintf(page, "%u\n", le##bits##_to_cpu(cd->aname)); \ mutex_unlock(&opts->lock); \ \ mutex_unlock(su_mutex); \ @@ -995,7 +995,7 @@ static ssize_t uvcg_streaming_header_##cname##_show( \ opts = to_f_uvc_opts(opts_item); \ \ mutex_lock(&opts->lock); \ - result = sprintf(page, "%d\n", le##bits##_to_cpu(sh->desc.aname));\ + result = sprintf(page, "%u\n", le##bits##_to_cpu(sh->desc.aname));\ mutex_unlock(&opts->lock); \ \ mutex_unlock(su_mutex); \ @@ -1104,7 +1104,7 @@ static ssize_t uvcg_frame_##cname##_show(struct config_item *item, char *page)\ opts = to_f_uvc_opts(opts_item); \ \ mutex_lock(&opts->lock); \ - result = sprintf(page, "%d\n", f->frame.cname); \ + result = sprintf(page, "%u\n", f->frame.cname); \ mutex_unlock(&opts->lock); \ \ mutex_unlock(su_mutex); \ @@ -1173,7 +1173,7 @@ static ssize_t uvcg_frame_b_frame_index_show(struct config_item *item, opts = to_f_uvc_opts(opts_item); mutex_lock(&opts->lock); - result = sprintf(page, "%d\n", f->frame.b_frame_index); + result = sprintf(page, "%u\n", f->frame.b_frame_index); mutex_unlock(&opts->lock); out: @@ -1210,7 +1210,7 @@ static ssize_t uvcg_frame_dw_frame_interval_show(struct config_item *item, mutex_lock(&opts->lock); for (result = 0, i = 0; i < frm->frame.b_frame_interval_type; ++i) { - result += sprintf(pg, "%d\n", frm->dw_frame_interval[i]); + result += sprintf(pg, "%u\n", frm->dw_frame_interval[i]); pg = page + result; } mutex_unlock(&opts->lock); @@ -1512,7 +1512,7 @@ static ssize_t uvcg_uncompressed_##cname##_show( \ opts = to_f_uvc_opts(opts_item); \ \ mutex_lock(&opts->lock); \ - result = sprintf(page, "%d\n", le##bits##_to_cpu(u->desc.aname));\ + result = sprintf(page, "%u\n", le##bits##_to_cpu(u->desc.aname));\ mutex_unlock(&opts->lock); \ \ mutex_unlock(su_mutex); \ @@ -1537,7 +1537,7 @@ static ssize_t uvcg_uncompressed_##cname##_show( \ opts = to_f_uvc_opts(opts_item); \ \ mutex_lock(&opts->lock); \ - result = sprintf(page, "%d\n", le##bits##_to_cpu(u->desc.aname));\ + result = sprintf(page, "%u\n", le##bits##_to_cpu(u->desc.aname));\ mutex_unlock(&opts->lock); \ \ mutex_unlock(su_mutex); \ @@ -1710,7 +1710,7 @@ static ssize_t uvcg_mjpeg_##cname##_show(struct config_item *item, char *page)\ opts = to_f_uvc_opts(opts_item); \ \ mutex_lock(&opts->lock); \ - result = sprintf(page, "%d\n", le##bits##_to_cpu(u->desc.aname));\ + result = sprintf(page, "%u\n", le##bits##_to_cpu(u->desc.aname));\ mutex_unlock(&opts->lock); \ \ mutex_unlock(su_mutex); \ @@ -1734,7 +1734,7 @@ static ssize_t uvcg_mjpeg_##cname##_show(struct config_item *item, char *page)\ opts = to_f_uvc_opts(opts_item); \ \ mutex_lock(&opts->lock); \ - result = sprintf(page, "%d\n", le##bits##_to_cpu(u->desc.aname));\ + result = sprintf(page, "%u\n", le##bits##_to_cpu(u->desc.aname));\ mutex_unlock(&opts->lock); \ \ mutex_unlock(su_mutex); \ @@ -1886,7 +1886,7 @@ static ssize_t uvcg_default_color_matching_##cname##_show( \ cd = &opts->uvc_color_matching; \ \ mutex_lock(&opts->lock); \ - result = sprintf(page, "%d\n", le##bits##_to_cpu(cd->aname)); \ + result = sprintf(page, "%u\n", le##bits##_to_cpu(cd->aname)); \ mutex_unlock(&opts->lock); \ \ mutex_unlock(su_mutex); \ @@ -2395,7 +2395,7 @@ static ssize_t f_uvc_opts_##cname##_show( \ int result; \ \ mutex_lock(&opts->lock); \ - result = sprintf(page, "%d\n", opts->cname); \ + result = sprintf(page, "%u\n", opts->cname); \ mutex_unlock(&opts->lock); \ \ return result; \