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: 28044 X-Patchwork-Delegate: laurent.pinchart@ideasonboard.com Received: from mail.tu-berlin.de ([130.149.7.33]) by www.linuxtv.org with esmtp (Exim 4.72) (envelope-from ) id 1YFeCp-0007aD-Jm; Mon, 26 Jan 2015 08:35:31 +0100 X-tubIT-Incoming-IP: 209.132.180.67 Received: from vger.kernel.org ([209.132.180.67]) by mail.tu-berlin.de (exim-4.72/mailfrontend-6) with esmtp id 1YFeCm-00042h-5h; Mon, 26 Jan 2015 08:35:31 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751534AbbAZHfY (ORCPT + 1 other); 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=-0.9 required=5.0 tests=BAYES_00, KHOP_SC_TOP_CIDR8, RDNS_DYNAMIC autolearn=no version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on www.osadl.org Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-PMX-Version: 6.0.0.2142326, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2015.1.26.72420 X-PMX-Spam: Gauge=IIIIIIIII, Probability=9%, Report=' AT_TLD 0.1, MULTIPLE_RCPTS 0.1, HTML_00_01 0.05, HTML_00_10 0.05, BODYTEXTP_SIZE_3000_LESS 0, BODY_SIZE_2000_2999 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, FROM_NAME_PHRASE 0, URI_ENDS_IN_HTML 0, __ANY_URI 0, __CP_MEDIA_BODY 0, __CP_URI_IN_BODY 0, __HAS_FROM 0, __HAS_MSGID 0, __HAS_X_MAILER 0, __HAS_X_MAILING_LIST 0, __MIME_TEXT_ONLY 0, __MULTIPLE_RCPTS_CC_X2 0, __SANE_MSGID 0, __SUBJ_ALPHA_END 0, __TO_MALFORMED_2 0, __URI_NO_WWW 0, __URI_NS ' 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;