From patchwork Mon Sep 21 08:24:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Shixin X-Patchwork-Id: 67120 X-Patchwork-Delegate: hverkuil@xs4all.nl Received: from vger.kernel.org ([23.128.96.18]) by www.linuxtv.org with esmtp (Exim 4.92) (envelope-from ) id 1kKGhJ-000cOC-Ia; Mon, 21 Sep 2020 07:57:18 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726713AbgIUIDV (ORCPT + 1 other); Mon, 21 Sep 2020 04:03:21 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:13741 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726551AbgIUICZ (ORCPT ); Mon, 21 Sep 2020 04:02:25 -0400 Received: from DGGEMS414-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 558CE626DBA23AF9D5D4; Mon, 21 Sep 2020 16:02:23 +0800 (CST) Received: from huawei.com (10.175.113.32) by DGGEMS414-HUB.china.huawei.com (10.3.19.214) with Microsoft SMTP Server id 14.3.487.0; Mon, 21 Sep 2020 16:02:15 +0800 From: Liu Shixin To: Mauro Carvalho Chehab CC: , , Liu Shixin Subject: [PATCH -next] media: media/pci: simplify the return expression of verify_window_lock Date: Mon, 21 Sep 2020 16:24:39 +0800 Message-ID: <20200921082439.2591565-1-liushixin2@huawei.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Originating-IP: [10.175.113.32] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-LSpam-Score: -2.4 (--) X-LSpam-Report: No, score=-2.4 required=5.0 tests=BAYES_00=-1.9,HEADER_FROM_DIFFERENT_DOMAINS=0.5,MAILING_LIST_MULTI=-1 autolearn=ham autolearn_force=no Simplify the return expression. Signed-off-by: Liu Shixin --- drivers/media/pci/bt8xx/bttv-driver.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/media/pci/bt8xx/bttv-driver.c b/drivers/media/pci/bt8xx/bttv-driver.c index 8c61d292dec1..4f7eaec20dc3 100644 --- a/drivers/media/pci/bt8xx/bttv-driver.c +++ b/drivers/media/pci/bt8xx/bttv-driver.c @@ -2058,7 +2058,6 @@ verify_window_lock(struct bttv_fh *fh, struct v4l2_window *win, { enum v4l2_field field; unsigned int width_mask; - int rc; if (win->w.width < 48) win->w.width = 48; @@ -2111,13 +2110,10 @@ verify_window_lock(struct bttv_fh *fh, struct v4l2_window *win, win->w.width -= win->w.left & ~width_mask; win->w.left = (win->w.left - width_mask - 1) & width_mask; - rc = limit_scaled_size_lock(fh, &win->w.width, &win->w.height, - field, width_mask, - /* width_bias: round down */ 0, - adjust_size, adjust_crop); - if (0 != rc) - return rc; - return 0; + return limit_scaled_size_lock(fh, &win->w.width, &win->w.height, + field, width_mask, + /* width_bias: round down */ 0, + adjust_size, adjust_crop); } static int setup_window_lock(struct bttv_fh *fh, struct bttv *btv,