From patchwork Wed Mar 9 16:03:17 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonio Ospite X-Patchwork-Id: 8547241 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 0A3419F38C for ; Wed, 9 Mar 2016 16:03:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B994920295 for ; Wed, 9 Mar 2016 16:03:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CC57B202AE for ; Wed, 9 Mar 2016 16:03:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933160AbcCIQDg (ORCPT ); Wed, 9 Mar 2016 11:03:36 -0500 Received: from smtp205.alice.it ([82.57.200.101]:1578 "EHLO smtp205.alice.it" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933151AbcCIQDb (ORCPT ); Wed, 9 Mar 2016 11:03:31 -0500 Received: from jcn (87.3.192.69) by smtp205.alice.it (8.6.060.28) id 56332F71207C8958; Wed, 9 Mar 2016 17:03:29 +0100 Received: from ao2 by jcn with local (Exim 4.86_2) (envelope-from ) id 1adga8-00030f-19; Wed, 09 Mar 2016 17:03:28 +0100 From: Antonio Ospite To: Linux Media Cc: Hans de Goede , Hans Verkuil , Antonio Ospite Subject: [PATCH 3/7] [media] gspca: rename wxh_to_mode() to wxh_to_nearest_mode() Date: Wed, 9 Mar 2016 17:03:17 +0100 Message-Id: <1457539401-11515-4-git-send-email-ao2@ao2.it> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1457539401-11515-1-git-send-email-ao2@ao2.it> References: <1457539401-11515-1-git-send-email-ao2@ao2.it> X-Face: z*RaLf`X<@C75u6Ig9}{oW$H; 1_\2t5)({*|jhM/Vb; ]yA5\I~93>J<_`<4)A{':UrE 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 The name wxh_to_nearest_mode() reflects better what the function does. Signed-off-by: Antonio Ospite --- drivers/media/usb/gspca/gspca.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/media/usb/gspca/gspca.c b/drivers/media/usb/gspca/gspca.c index 9c8990f..1bb7901 100644 --- a/drivers/media/usb/gspca/gspca.c +++ b/drivers/media/usb/gspca/gspca.c @@ -991,7 +991,7 @@ static void gspca_set_default_mode(struct gspca_dev *gspca_dev) v4l2_ctrl_handler_setup(gspca_dev->vdev.ctrl_handler); } -static int wxh_to_mode(struct gspca_dev *gspca_dev, +static int wxh_to_nearest_mode(struct gspca_dev *gspca_dev, int width, int height) { int i; @@ -1125,8 +1125,8 @@ static int try_fmt_vid_cap(struct gspca_dev *gspca_dev, PDEBUG_MODE(gspca_dev, D_CONF, "try fmt cap", fmt->fmt.pix.pixelformat, w, h); - /* search the closest mode for width and height */ - mode = wxh_to_mode(gspca_dev, w, h); + /* search the nearest mode for width and height */ + mode = wxh_to_nearest_mode(gspca_dev, w, h); /* OK if right palette */ if (gspca_dev->cam.cam_mode[mode].pixelformat @@ -1233,7 +1233,7 @@ static int vidioc_enum_frameintervals(struct file *filp, void *priv, struct v4l2_frmivalenum *fival) { struct gspca_dev *gspca_dev = video_drvdata(filp); - int mode = wxh_to_mode(gspca_dev, fival->width, fival->height); + int mode = wxh_to_nearest_mode(gspca_dev, fival->width, fival->height); __u32 i; if (gspca_dev->cam.mode_framerates == NULL ||