From patchwork Sun Jul 23 18:16:26 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Scheller X-Patchwork-Id: 9858545 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 C9F4160393 for ; Sun, 23 Jul 2017 18:17:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C4A37281B7 for ; Sun, 23 Jul 2017 18:17:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B3AB728517; Sun, 23 Jul 2017 18:17:37 +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.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, 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 B39CA2853A for ; Sun, 23 Jul 2017 18:17:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751542AbdGWSQu (ORCPT ); Sun, 23 Jul 2017 14:16:50 -0400 Received: from mail-wr0-f194.google.com ([209.85.128.194]:33365 "EHLO mail-wr0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751461AbdGWSQq (ORCPT ); Sun, 23 Jul 2017 14:16:46 -0400 Received: by mail-wr0-f194.google.com with SMTP id y43so15830893wrd.0 for ; Sun, 23 Jul 2017 11:16:45 -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; bh=2gklVprBpCEecMUpSPkaBqOD8im8hue9aHZK6qsbSmI=; b=GQDvUbTNGSLTrttXEde3m/Yx6uOzdWGVdKW4rSoN7PuE3tyOliqAOFAkiV4jb4XWKm ajqGOP4W3A19Aj1LbZpqFchPclJFbcWaZMupShj3bRiJ5kfELQLLcXEnGlNY0fRekxLZ EwnhtFRuLdICEl8LjN88jxQtEFemYSDnnvDualRUH1UEVC9TcItYwyJAwyErDbL8BS0l w/hd0w0vBYOCJS8fRPpK4KHJvx00ZufIKj+bqoI4ieV3d4ePkDm/xCvjkr92ff8rqQOO 3F4tMcVJZS+8HyEnQkFh2dgydMR/efhw7boJWBqZIaQqJd+QusU1lU/CDTy0wQdLuDK2 O7ZQ== 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; bh=2gklVprBpCEecMUpSPkaBqOD8im8hue9aHZK6qsbSmI=; b=i81LMWVktsAKNO3VacRtZFI9Ic5G8eniXzYWqx2433Whj2HXJYtkUTYdRlQyom8htV iOb3D19octEXtBekO2gofsafEm86D6eCgZTK/crPMaUxVvVgOMSaO5RF72oL2npvGnef +9u9PMkcY2w5V7SlNFpTb/NshoMKTLqiRBd6bYiCcusnIq9ulKLZnECLRawI9EHtiJ+6 EdivbQi2FEM2Kn2vmdm6okGgbbugUn1DCvwslNxLxfuSlydo6+EyZUPTClV2o7B9Vagq RrlQpK80Cu2FdM0PC92ZCyAso73bpkW0Uyw/J8zg2Bkznh9ma+mvv/R733Vvq5u2jLOH bX9g== X-Gm-Message-State: AIVw113NnSa3890wTBXrTwAWuHe7YsrHdiMpsmhauhJAuyHonHsKpxMs sT1As+J5g8lOlMyf X-Received: by 10.223.175.225 with SMTP id y33mr13045373wrd.61.1500833804642; Sun, 23 Jul 2017 11:16:44 -0700 (PDT) Received: from dvbdev.wuest.de (ip-84-118-193-88.unity-media.net. [84.118.193.88]) by smtp.gmail.com with ESMTPSA id 93sm13247338wra.82.2017.07.23.11.16.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 23 Jul 2017 11:16:44 -0700 (PDT) From: Daniel Scheller To: linux-media@vger.kernel.org, mchehab@kernel.org, mchehab@s-opensource.com Cc: r.scobie@clear.net.nz, jasmin@anw.at, d_spingler@freenet.de, Manfred.Knick@t-online.de, rjkm@metzlerbros.de Subject: [PATCH RESEND 10/14] [media] ddbridge: remove unreachable code Date: Sun, 23 Jul 2017 20:16:26 +0200 Message-Id: <20170723181630.19526-11-d.scheller.oss@gmail.com> X-Mailer: git-send-email 2.13.0 In-Reply-To: <20170723181630.19526-1-d.scheller.oss@gmail.com> References: <20170723181630.19526-1-d.scheller.oss@gmail.com> 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 From: Daniel Scheller From smatch: drivers/media/pci/ddbridge/ddbridge-core.c:3490 snr_store() info: ignoring unreachable code. In fact, the function immediately returns zero, so remove it and update ddb_attrs_snr[] to not reference it anymore. Cc: Ralph Metzler Signed-off-by: Daniel Scheller Tested-by: Richard Scobie Tested-by: Jasmin Jessich Tested-by: Dietmar Spingler Tested-by: Manfred Knick --- drivers/media/pci/ddbridge/ddbridge-core.c | 27 ++++----------------------- 1 file changed, 4 insertions(+), 23 deletions(-) diff --git a/drivers/media/pci/ddbridge/ddbridge-core.c b/drivers/media/pci/ddbridge/ddbridge-core.c index 5f8f77c74339..2479cb70743e 100644 --- a/drivers/media/pci/ddbridge/ddbridge-core.c +++ b/drivers/media/pci/ddbridge/ddbridge-core.c @@ -3235,25 +3235,6 @@ static ssize_t snr_show(struct device *device, return sprintf(buf, "%s\n", snr); } - -static ssize_t snr_store(struct device *device, struct device_attribute *attr, - const char *buf, size_t count) -{ - struct ddb *dev = dev_get_drvdata(device); - int num = attr->attr.name[3] - 0x30; - u8 snr[34] = { 0x01, 0x00 }; - - return 0; /* NOE: remove completely? */ - if (count > 31) - return -EINVAL; - if (dev->port[num].type >= DDB_TUNER_XO2) - return -EINVAL; - memcpy(snr + 2, buf, count); - i2c_write(&dev->i2c[num].adap, 0x57, snr, 34); - i2c_write(&dev->i2c[num].adap, 0x50, snr, 34); - return count; -} - static ssize_t bsnr_show(struct device *device, struct device_attribute *attr, char *buf) { @@ -3393,10 +3374,10 @@ static struct device_attribute ddb_attrs_fan[] = { }; static struct device_attribute ddb_attrs_snr[] = { - __ATTR(snr0, 0664, snr_show, snr_store), - __ATTR(snr1, 0664, snr_show, snr_store), - __ATTR(snr2, 0664, snr_show, snr_store), - __ATTR(snr3, 0664, snr_show, snr_store), + __ATTR_MRO(snr0, snr_show), + __ATTR_MRO(snr1, snr_show), + __ATTR_MRO(snr2, snr_show), + __ATTR_MRO(snr3, snr_show), }; static struct device_attribute ddb_attrs_ctemp[] = {