From patchwork Tue May 22 17:09:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Gustavo A. R. Silva" X-Patchwork-Id: 10419219 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 34A226053B for ; Tue, 22 May 2018 17:11:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 20B9D28E36 for ; Tue, 22 May 2018 17:11:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1565E28EB6; Tue, 22 May 2018 17:11:39 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DFEFF28E36 for ; Tue, 22 May 2018 17:11:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751304AbeEVRLg (ORCPT ); Tue, 22 May 2018 13:11:36 -0400 Received: from gateway24.websitewelcome.com ([192.185.50.45]:34542 "EHLO gateway24.websitewelcome.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751268AbeEVRLf (ORCPT ); Tue, 22 May 2018 13:11:35 -0400 Received: from cm15.websitewelcome.com (cm15.websitewelcome.com [100.42.49.9]) by gateway24.websitewelcome.com (Postfix) with ESMTP id A6DE1216364 for ; Tue, 22 May 2018 12:09:37 -0500 (CDT) Received: from gator4166.hostgator.com ([108.167.133.22]) by cmsmtp with SMTP id LAn3f7gyzbXuJLAn3fPRQS; Tue, 22 May 2018 12:09:37 -0500 X-Authority-Reason: nr=8 Received: from [187.192.46.223] (port=37896 helo=embeddedor) by gator4166.hostgator.com with esmtpa (Exim 4.89_1) (envelope-from ) id 1fLAn1-003JSO-5q; Tue, 22 May 2018 12:09:37 -0500 Date: Tue, 22 May 2018 12:09:22 -0500 From: "Gustavo A. R. Silva" To: Devin Heitmueller , Mauro Carvalho Chehab Cc: Linux Media Mailing List , Linux Kernel , "Gustavo A. R. Silva" Subject: [PATCH] au8522: remove duplicate code Message-ID: <20180522170922.GA30834@embeddedor.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator4166.hostgator.com X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - embeddedor.com X-BWhitelist: no X-Source-IP: 187.192.46.223 X-Source-L: No X-Exim-ID: 1fLAn1-003JSO-5q X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: (embeddedor) [187.192.46.223]:37896 X-Source-Auth: gustavo@embeddedor.com X-Email-Count: 3 X-Source-Cap: Z3V6aWRpbmU7Z3V6aWRpbmU7Z2F0b3I0MTY2Lmhvc3RnYXRvci5jb20= X-Local-Domain: yes 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 This code has been there for nine years now, and it has been working "good enough" since then [1]. Remove duplicate code by getting rid of the if-else statement. [1] https://marc.info/?l=linux-kernel&m=152693550225081&w=2 Cc: Devin Heitmueller Signed-off-by: Gustavo A. R. Silva Reviewed-by: Devin Heitmueller --- drivers/media/dvb-frontends/au8522_decoder.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/drivers/media/dvb-frontends/au8522_decoder.c b/drivers/media/dvb-frontends/au8522_decoder.c index 343dc92..f285096 100644 --- a/drivers/media/dvb-frontends/au8522_decoder.c +++ b/drivers/media/dvb-frontends/au8522_decoder.c @@ -280,14 +280,12 @@ static void setup_decoder_defaults(struct au8522_state *state, bool is_svideo) AU8522_TOREGAAGC_REG0E5H_CVBS); au8522_writereg(state, AU8522_REG016H, AU8522_REG016H_CVBS); - if (is_svideo) { - /* Despite what the table says, for the HVR-950q we still need - to be in CVBS mode for the S-Video input (reason unknown). */ - /* filter_coef_type = 3; */ - filter_coef_type = 5; - } else { - filter_coef_type = 5; - } + /* + * Despite what the table says, for the HVR-950q we still need + * to be in CVBS mode for the S-Video input (reason unknown). + */ + /* filter_coef_type = 3; */ + filter_coef_type = 5; /* Load the Video Decoder Filter Coefficients */ for (i = 0; i < NUM_FILTER_COEF; i++) {