From patchwork Mon Jan 26 07:27:05 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Mc Guire X-Patchwork-Id: 5706971 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.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 15DF8C058D for ; Mon, 26 Jan 2015 07:35:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 55CBB2012E for ; Mon, 26 Jan 2015 07:35:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 570D620123 for ; Mon, 26 Jan 2015 07:35:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751534AbbAZHfY (ORCPT ); Mon, 26 Jan 2015 02:35:24 -0500 Received: from www.osadl.org ([62.245.132.105]:45996 "EHLO www.osadl.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751299AbbAZHfY (ORCPT ); Mon, 26 Jan 2015 02:35:24 -0500 Received: from debian.hofr.at (92-243-35-153.adsl.nanet.at [92.243.35.153] (may be forged)) by www.osadl.org (8.13.8/8.13.8/OSADL-2007092901) with ESMTP id t0Q7YqAO010100; Mon, 26 Jan 2015 08:34:53 +0100 From: Nicholas Mc Guire To: Mauro Carvalho Chehab Cc: Greg Kroah-Hartman , Hans Verkuil , Lad Prabhakar , Jiayi Ye , Tapasweni Pathak , Boris BREZILLON , linux-media@vger.kernel.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, Nicholas Mc Guire Subject: [PATCH RFC] staging: media: davinci_vpfe: drop condition with no effect Date: Mon, 26 Jan 2015 08:27:05 +0100 Message-Id: <1422257225-22037-1-git-send-email-der.herr@hofr.at> X-Mailer: git-send-email 1.7.10.4 X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP As the if and else branch body are identical the condition has no effect and can be dropped. Signed-off-by: Nicholas Mc Guire Acked-by: Lad, Prabhakar --- As the if and the else branch of the inner conditional paths are the same the condition is without effect. Given the comments indicate that the else branch *should* be handling a specific case this may indicate a bug, in which case the below patch is *wrong*. This needs a review by someone that knows the specifics of this driver. If the inner if/else is a placeholder for planed updates then it should be commented so this is clear. Patch was only compile tested with davinci_all_defconfig + CONFIG_STAGING=y CONFIG_STAGING_MEDIA=y, CONFIG_MEDIA_SUPPORT=m, CONFIG_MEDIA_ANALOG_TV_SUPPORT=y, CONFIG_MEDIA_CAMERA_SUPPORT=y CONFIG_MEDIA_CONTROLLER=y, CONFIG_VIDEO_V4L2_SUBDEV_API=y CONFIG_VIDEO_DM365_VPFE=m Patch is against 3.0.19-rc5 -next-20150123 drivers/staging/media/davinci_vpfe/dm365_resizer.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/staging/media/davinci_vpfe/dm365_resizer.c b/drivers/staging/media/davinci_vpfe/dm365_resizer.c index 75e70e1..bf2cb7a 100644 --- a/drivers/staging/media/davinci_vpfe/dm365_resizer.c +++ b/drivers/staging/media/davinci_vpfe/dm365_resizer.c @@ -63,16 +63,11 @@ resizer_calculate_line_length(u32 pix, int width, int height, if (pix == MEDIA_BUS_FMT_UYVY8_2X8 || pix == MEDIA_BUS_FMT_SGRBG12_1X12) { *line_len = width << 1; - } else if (pix == MEDIA_BUS_FMT_Y8_1X8 || - pix == MEDIA_BUS_FMT_UV8_1X8) { - *line_len = width; - *line_len_c = width; - } else { - /* YUV 420 */ - /* round width to upper 32 byte boundary */ + } else { *line_len = width; *line_len_c = width; } + /* adjust the line len to be a multiple of 32 */ *line_len += 31; *line_len &= ~0x1f;