linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Scheller <d.scheller.oss@gmail.com>
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 v3 08/12] [media] ddbridge: remove unreachable code
Date: Wed,  9 Aug 2017 22:31:24 +0200	[thread overview]
Message-ID: <20170809203128.31476-9-d.scheller.oss@gmail.com> (raw)
In-Reply-To: <20170809203128.31476-1-d.scheller.oss@gmail.com>

From: Daniel Scheller <d.scheller@gmx.net>

>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 <rjkm@metzlerbros.de>
Signed-off-by: Daniel Scheller <d.scheller@gmx.net>
Tested-by: Richard Scobie <r.scobie@clear.net.nz>
Tested-by: Jasmin Jessich <jasmin@anw.at>
Tested-by: Dietmar Spingler <d_spingler@freenet.de>
Tested-by: Manfred Knick <Manfred.Knick@t-online.de>
---
 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 2a4bb6ddf3a2..ba2a2d987430 100644
--- a/drivers/media/pci/ddbridge/ddbridge-core.c
+++ b/drivers/media/pci/ddbridge/ddbridge-core.c
@@ -2977,25 +2977,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)
 {
@@ -3135,10 +3116,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[] = {
-- 
2.13.0

  parent reply	other threads:[~2017-08-09 20:31 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-09 20:31 [PATCH v3 00/12] ddbridge: bump to ddbridge-0.9.29 Daniel Scheller
2017-08-09 20:31 ` [PATCH v3 01/12] [media] ddbridge: bump ddbridge code to version 0.9.29 Daniel Scheller
2017-08-09 20:31 ` [PATCH v3 02/12] [media] ddbridge: split I/O related functions off from ddbridge.h Daniel Scheller
2017-08-09 20:31 ` [PATCH v3 03/12] [media] ddbridge: split off IRQ handling Daniel Scheller
2017-08-09 20:31 ` [PATCH v3 04/12] [media] ddbridge: split off hardware definitions and mappings Daniel Scheller
2017-08-09 20:31 ` [PATCH v3 05/12] [media] ddbridge: check pointers before dereferencing Daniel Scheller
2017-08-09 20:31 ` [PATCH v3 06/12] [media] ddbridge: only register frontends in fe2 if fe is not NULL Daniel Scheller
2017-08-09 20:31 ` [PATCH v3 07/12] [media] ddbridge: fix possible buffer overflow in ddb_ports_init() Daniel Scheller
2017-08-09 20:31 ` Daniel Scheller [this message]
2017-08-09 20:31 ` [PATCH v3 09/12] [media] ddbridge: fix impossible condition warning Daniel Scheller
2017-08-09 20:31 ` [PATCH v3 10/12] [media] ddbridge: fix dereference before check Daniel Scheller
2017-08-09 20:31 ` [PATCH v3 11/12] [media] ddbridge: Kconfig option to control the MSI modparam default Daniel Scheller
2017-08-09 20:31 ` [PATCH v3 12/12] [media] MAINTAINERS: add entry for ddbridge Daniel Scheller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170809203128.31476-9-d.scheller.oss@gmail.com \
    --to=d.scheller.oss@gmail.com \
    --cc=Manfred.Knick@t-online.de \
    --cc=d_spingler@freenet.de \
    --cc=jasmin@anw.at \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=mchehab@s-opensource.com \
    --cc=r.scobie@clear.net.nz \
    --cc=rjkm@metzlerbros.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).