From patchwork Fri Apr 30 15:43:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Piyush Thange X-Patchwork-Id: 430085 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.9 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNWANTED_LANGUAGE_BODY, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 48F2BC433B4 for ; Fri, 30 Apr 2021 15:47:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 07B6D6145D for ; Fri, 30 Apr 2021 15:47:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230167AbhD3PsN (ORCPT ); Fri, 30 Apr 2021 11:48:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36514 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229532AbhD3PsK (ORCPT ); Fri, 30 Apr 2021 11:48:10 -0400 Received: from mail-pf1-x433.google.com (mail-pf1-x433.google.com [IPv6:2607:f8b0:4864:20::433]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6A674C06174A; Fri, 30 Apr 2021 08:47:22 -0700 (PDT) Received: by mail-pf1-x433.google.com with SMTP id i13so1773289pfu.2; Fri, 30 Apr 2021 08:47:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=lffHW6+bJT/jZDB8NYsrRLnITHeQydH7o4/HNDXB/bE=; b=F9b+y7ve5qhrZlKuh1/yt7HQb9WBRvr0iHAHK5ZB1iM1Wb07+SpOX3ly02CaQqMPYw ZvwIKs1KUQRxND3PRLKNVeUOjr6J6sQRpZ0iJ1Sq+aHS6g07NAh2gSkLuMZM0cY+KVij ribE4iNgGTDvpQS8orQFimPuuLd8jdtP7Yx5X68nb/PcuckwhvwyvRGImXOSHX2qm4su ba6h4bU45Lw5FhyTz1NfERNZEkfM6SdygGyNT/uyYrxKWFtJTJX9aGTCWhHJHZMP+5n6 lFViF/YE+eOGH8tFh2Ew4YQI/EAA4SvzAZQx6WwVqWuHXh4J+WQ3Cuji1MWNM2YXlm5c InDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=lffHW6+bJT/jZDB8NYsrRLnITHeQydH7o4/HNDXB/bE=; b=HmMb9yg2xgjZsnb0fr2HP9gi9e8YLldFkXSgEHt38/rqb7YQXwOzgSyg0relaqAu/W VadiKFjJ/qI1q/c10ky1QsHn8ri/aLCTB1+nRoJKjwnpssfE7rODAMC2ZT41t2dlzn0r S9O+hUyCGJsu7A5t/tk3XlwWLHTDbHQ1akyDBVKnapPhzQYiXcqhpnkRTA6HmZ6fxL9K Ps8bRssYu7o1lP1sEmMyJOgaZ1Tmx0fGkbOjfE+Ceh+Y13VL8B/ciSrqq1T13SwkJ0gv ZeTaLa+cVMfgqYEE/qGaaJX6/afq7j3pD2Y4rLFsUi4KS3VggPpgGu7DWZv+CemuFJO0 SkRg== X-Gm-Message-State: AOAM530GG2wpalc8hnYtyM1djqfRFC2yZNW+QS99PicJucmVZkBlzpCn LBxOzc1jcslj2aUtvQalLno= X-Google-Smtp-Source: ABdhPJwfUcD6npZ/WFw2T4e3EQ/gIVuHDruqdpSurSMdWProQoCVwcrieIBymf3rsBRQ+O/iFJihdA== X-Received: by 2002:aa7:97a1:0:b029:27f:aa90:c7a6 with SMTP id d1-20020aa797a10000b029027faa90c7a6mr5672426pfq.10.1619797641772; Fri, 30 Apr 2021 08:47:21 -0700 (PDT) Received: from localhost.localdomain ([2402:8100:30a6:a362:7862:2436:1c0a:c59d]) by smtp.gmail.com with ESMTPSA id o187sm2530591pfb.190.2021.04.30.08.47.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Apr 2021 08:47:21 -0700 (PDT) From: Piyush Thange To: mchehab@kernel.org, leon@kernel.org Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Piyush Thange Subject: [PATCH 1/4] media: usb: cpia2: Fixed coding style issues Date: Fri, 30 Apr 2021 21:13:11 +0530 Message-Id: <20210430154314.3152-1-pthange19@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Fixed coding style issues with spaces for if condition & others statements. Signed-off-by: Piyush Thange --- drivers/media/usb/cpia2/cpia2_v4l.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/media/usb/cpia2/cpia2_v4l.c b/drivers/media/usb/cpia2/cpia2_v4l.c index 69d5c628a797..4b58b1e7847e 100644 --- a/drivers/media/usb/cpia2/cpia2_v4l.c +++ b/drivers/media/usb/cpia2/cpia2_v4l.c @@ -143,7 +143,7 @@ static ssize_t cpia2_v4l_read(struct file *file, char __user *buf, size_t count, int noblock = file->f_flags&O_NONBLOCK; ssize_t ret; - if(!cam) + if (!cam) return -EINVAL; if (mutex_lock_interruptible(&cam->v4l2_lock)) @@ -247,8 +247,8 @@ static int cpia2_querycap(struct file *file, void *fh, struct v4l2_capability *v break; } - if (usb_make_path(cam->dev, vc->bus_info, sizeof(vc->bus_info)) <0) - memset(vc->bus_info,0, sizeof(vc->bus_info)); + if (usb_make_path(cam->dev, vc->bus_info, sizeof(vc->bus_info)) < 0) + memset(vc->bus_info, 0, sizeof(vc->bus_info)); return 0; } @@ -377,7 +377,7 @@ static int cpia2_s_fmt_vid_cap(struct file *file, void *_fh, int err, frame; err = cpia2_try_fmt_vid_cap(file, _fh, f); - if(err != 0) + if (err != 0) return err; cam->pixelformat = f->fmt.pix.pixelformat; @@ -665,13 +665,13 @@ static int cpia2_g_jpegcomp(struct file *file, void *fh, struct v4l2_jpegcompres parms->quality = 80; // TODO: Can this be made meaningful? parms->jpeg_markers = V4L2_JPEG_MARKER_DQT | V4L2_JPEG_MARKER_DRI; - if(!cam->params.compression.inhibit_htables) { + if (!cam->params.compression.inhibit_htables) parms->jpeg_markers |= V4L2_JPEG_MARKER_DHT; - } + parms->APPn = cam->APPn; parms->APP_len = cam->APP_len; - if(cam->APP_len > 0) { + if (cam->APP_len > 0) { memcpy(parms->APP_data, cam->APP_data, cam->APP_len); parms->jpeg_markers |= V4L2_JPEG_MARKER_APP; } From patchwork Fri Apr 30 15:43:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Piyush Thange X-Patchwork-Id: 430084 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.9 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNWANTED_LANGUAGE_BODY, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7187DC433B4 for ; Fri, 30 Apr 2021 15:47:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4627B61469 for ; Fri, 30 Apr 2021 15:47:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231290AbhD3PsU (ORCPT ); Fri, 30 Apr 2021 11:48:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36554 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230195AbhD3PsT (ORCPT ); Fri, 30 Apr 2021 11:48:19 -0400 Received: from mail-pl1-x62f.google.com (mail-pl1-x62f.google.com [IPv6:2607:f8b0:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E3D3EC06174A; Fri, 30 Apr 2021 08:47:30 -0700 (PDT) Received: by mail-pl1-x62f.google.com with SMTP id y1so21168779plg.11; Fri, 30 Apr 2021 08:47:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=+G+f+RqY1tQqQC+A6Uop1YINz7gAicX1/Ug6Ztkf9rA=; b=SW4SMbcBTk22iqiR5nvJwSWwuBxN/4ylhbg5TmV2uePMe721u0dht7zRBFGOvj1WIA 8Qv8UyW3fWS94aF3nlMqigks0J7EO2jgeUeV8scG7XR7PLJ99YT1kMuNJd5Lq4Q7XNmV gc5b23dJHoGZJ2fz9frKJGaeOQypFC9mCtRVecG1pJyRv3RlgGBTyNi3DHOcHYB9eMW3 wotgVBeNnZaCRBpYvhhtf3ApzXLZk+8fr98u2H7rkAKKeplPaYfKKJG1mC+0cuCnKNR1 NB8C4rwQ1gPH1kym7spQi4S50Phce1FRqi0JreFJoMcOKR8i5jLmbkaSKtqD1i1aA3bB JwJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=+G+f+RqY1tQqQC+A6Uop1YINz7gAicX1/Ug6Ztkf9rA=; b=kuQqSj+rDyiXwyYuhs9x5iNtkeLDovcVNJIqbf5uaTAQhAYn9/gOb/wvFHZVArjatw JMl3usQY6tFcDKlFzFyuOeupjPhzwIf65snsn+JOcuZzxEwWMTwj+RqcNO6mPPIlzNmj pBW+/w7F3M5pqXErY2pQFP4+jOXRgpFTyHlbAxvvfzwuNhEogjammJDRHVvVf6jAHCV2 PcOYxlFoTjzwJ/NLOT8f7LeytchZOl0MR1VNgyqhS5n0KiKZwKvHPqhvH+WhqTp7xMa4 rmTfOrMzaB+Ufu+TO1OvTydRquQOnIBoiqXjZDotiG25lWBOzs8ow5+lkIT6gr1J3Onr 5/pA== X-Gm-Message-State: AOAM533jNhfzdLRC+3Cr5hIssuDM94Weq1OfVgp2nhmXQ0jcYGkjaTZy WP8GFx+VkB6/XnNKZp3kXFIrJQB2+kpkuJj8 X-Google-Smtp-Source: ABdhPJxx9yMGJq2pfikQDu2Sz7XYL/7OzCKxW0PckBReOUzlhKVd6ekMHjw8k2FPfUzwIhddbR9iTw== X-Received: by 2002:a17:902:c106:b029:ee:a12b:c097 with SMTP id 6-20020a170902c106b02900eea12bc097mr2839979pli.27.1619797650285; Fri, 30 Apr 2021 08:47:30 -0700 (PDT) Received: from localhost.localdomain ([2402:8100:30a6:a362:7862:2436:1c0a:c59d]) by smtp.gmail.com with ESMTPSA id o187sm2530591pfb.190.2021.04.30.08.47.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Apr 2021 08:47:29 -0700 (PDT) From: Piyush Thange To: mchehab@kernel.org, leon@kernel.org Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Piyush Thange Subject: [PATCH 4/4] media: usb: cpia2: Fixed coding style issues Date: Fri, 30 Apr 2021 21:13:14 +0530 Message-Id: <20210430154314.3152-4-pthange19@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210430154314.3152-1-pthange19@gmail.com> References: <20210430154314.3152-1-pthange19@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Addition of more fixes on coding style. Signed-off-by: Piyush Thange --- drivers/media/usb/cpia2/cpia2_v4l.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/media/usb/cpia2/cpia2_v4l.c b/drivers/media/usb/cpia2/cpia2_v4l.c index 261ced144793..d950f9171208 100644 --- a/drivers/media/usb/cpia2/cpia2_v4l.c +++ b/drivers/media/usb/cpia2/cpia2_v4l.c @@ -883,12 +883,12 @@ static int cpia2_dqbuf(struct file *file, void *fh, struct v4l2_buffer *buf) frame = find_earliest_filled_buffer(cam); - if(frame < 0 && file->f_flags&O_NONBLOCK) + if (frame < 0 && file->f_flags&O_NONBLOCK) return -EAGAIN; - if(frame < 0) { + if (frame < 0) { /* Wait for a frame to become available */ - struct framebuf *cb=cam->curbuff; + struct framebuf *cb = cam->curbuff; mutex_unlock(&cam->v4l2_lock); wait_event_interruptible(cam->wq_stream, !video_is_registered(&cam->vdev) || @@ -970,7 +970,7 @@ static int cpia2_mmap(struct file *file, struct vm_area_struct *area) return -ERESTARTSYS; retval = cpia2_remap_buffer(cam, area); - if(!retval) + if (!retval) cam->stream_fh = file->private_data; mutex_unlock(&cam->v4l2_lock); return retval; @@ -1160,10 +1160,10 @@ void cpia2_unregister_camera(struct camera_data *cam) *****************************************************************************/ static void __init check_parameters(void) { - if(buffer_size < PAGE_SIZE) { + if (buffer_size < PAGE_SIZE) { buffer_size = PAGE_SIZE; LOG("buffer_size too small, setting to %d\n", buffer_size); - } else if(buffer_size > 1024*1024) { + } else if (buffer_size > 1024*1024) { /* arbitrary upper limiit */ buffer_size = 1024*1024; LOG("buffer_size ridiculously large, setting to %d\n", @@ -1173,15 +1173,15 @@ static void __init check_parameters(void) buffer_size &= ~(PAGE_SIZE-1); } - if(num_buffers < 1) { + if (num_buffers < 1) { num_buffers = 1; LOG("num_buffers too small, setting to %d\n", num_buffers); - } else if(num_buffers > VIDEO_MAX_FRAME) { + } else if (num_buffers > VIDEO_MAX_FRAME) { num_buffers = VIDEO_MAX_FRAME; LOG("num_buffers too large, setting to %d\n", num_buffers); } - if(alternate < USBIF_ISO_1 || alternate > USBIF_ISO_6) { + if (alternate < USBIF_ISO_1 || alternate > USBIF_ISO_6) { alternate = DEFAULT_ALT; LOG("alternate specified is invalid, using %d\n", alternate); }