All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] staging/cxd2099: cosmetics, checkpatch fixup
@ 2017-12-12 18:46 Daniel Scheller
  2017-12-12 18:46 ` [PATCH 1/3] [media] staging/cxd2099: fix remaining checkpatch-strict issues Daniel Scheller
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Daniel Scheller @ 2017-12-12 18:46 UTC (permalink / raw)
  To: linux-media, mchehab, mchehab; +Cc: jasmin

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

These three small patches make the driver checkpatch-strict clean and
improves a few strings. No functional changes.

Essentially drivers/staging/media/cxd2099/ is now clean, esp.:

$ scripts/checkpatch.pl --strict --file drivers/staging/media/cxd2099/cxd2099.c
  total: 0 errors, 0 warnings, 0 checks, 705 lines checked

$ scripts/checkpatch.pl --strict --file drivers/staging/media/cxd2099/cxd2099.h
  total: 0 errors, 0 warnings, 0 checks, 45 lines checked

The three patches are the outcome of some bigger refactoring WIP.

Daniel Scheller (3):
  [media] staging/cxd2099: fix remaining checkpatch-strict issues
  [media] staging/cxd2099: fix debug message severity
  [media] staging/cxd2099: cosmetics: improve strings

 drivers/staging/media/cxd2099/cxd2099.c | 30 +++++++++++-------------------
 drivers/staging/media/cxd2099/cxd2099.h | 14 +++-----------
 2 files changed, 14 insertions(+), 30 deletions(-)

-- 
2.13.6

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/3] [media] staging/cxd2099: fix remaining checkpatch-strict issues
  2017-12-12 18:46 [PATCH 0/3] staging/cxd2099: cosmetics, checkpatch fixup Daniel Scheller
@ 2017-12-12 18:46 ` Daniel Scheller
  2017-12-12 18:46 ` [PATCH 2/3] [media] staging/cxd2099: fix debug message severity Daniel Scheller
  2017-12-12 18:46 ` [PATCH 3/3] [media] staging/cxd2099: cosmetics: improve strings Daniel Scheller
  2 siblings, 0 replies; 4+ messages in thread
From: Daniel Scheller @ 2017-12-12 18:46 UTC (permalink / raw)
  To: linux-media, mchehab, mchehab; +Cc: jasmin

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

Fix up all remaining cosmetic issues as reported by checkpatch.pl.

Signed-off-by: Daniel Scheller <d.scheller@gmx.net>
Signed-off-by: Jasmin Jessich <jasmin@anw.at>
---
 drivers/staging/media/cxd2099/cxd2099.c | 19 +++++--------------
 drivers/staging/media/cxd2099/cxd2099.h | 14 +++-----------
 2 files changed, 8 insertions(+), 25 deletions(-)

diff --git a/drivers/staging/media/cxd2099/cxd2099.c b/drivers/staging/media/cxd2099/cxd2099.c
index 3e30f4864e2b..21b1c6fcf9bf 100644
--- a/drivers/staging/media/cxd2099/cxd2099.c
+++ b/drivers/staging/media/cxd2099/cxd2099.c
@@ -3,23 +3,14 @@
  *
  * Copyright (C) 2010-2013 Digital Devices GmbH
  *
- *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
  * version 2 only, as published by the Free Software Foundation.
  *
- *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- *
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA
- * Or, point your browser to http://www.gnu.org/copyleft/gpl.html
  */
 
 #include <linux/slab.h>
@@ -59,7 +50,7 @@ struct cxd {
 	int    amem_read;
 
 	int    cammode;
-	struct mutex lock;
+	struct mutex lock; /* device access lock */
 
 	u8     rbuf[1028];
 	u8     wbuf[1028];
@@ -101,7 +92,7 @@ static int i2c_read_reg(struct i2c_adapter *adapter, u8 adr,
 				   .buf = val, .len = 1} };
 
 	if (i2c_transfer(adapter, msgs, 2) != 2) {
-		dev_err(&adapter->dev, "error in i2c_read_reg\n");
+		dev_err(&adapter->dev, "error in %s()\n", __func__);
 		return -1;
 	}
 	return 0;
@@ -116,7 +107,7 @@ static int i2c_read(struct i2c_adapter *adapter, u8 adr,
 				   .buf = data, .len = n} };
 
 	if (i2c_transfer(adapter, msgs, 2) != 2) {
-		dev_err(&adapter->dev, "error in i2c_read\n");
+		dev_err(&adapter->dev, "error in %s()\n", __func__);
 		return -1;
 	}
 	return 0;
@@ -134,7 +125,7 @@ static int read_block(struct cxd *ci, u8 adr, u8 *data, u16 n)
 		while (n) {
 			int len = n;
 
-			if (ci->cfg.max_i2c && (len > ci->cfg.max_i2c))
+			if (ci->cfg.max_i2c && len > ci->cfg.max_i2c)
 				len = ci->cfg.max_i2c;
 			status = i2c_read(ci->i2c, ci->cfg.adr, 1, data, len);
 			if (status)
@@ -591,7 +582,7 @@ static int campoll(struct cxd *ci)
 			}
 		}
 		if ((istat & 8) &&
-		    (ci->slot_stat == DVB_CA_EN50221_POLL_CAM_PRESENT)) {
+		    ci->slot_stat == DVB_CA_EN50221_POLL_CAM_PRESENT) {
 			ci->ready = 1;
 			ci->slot_stat |= DVB_CA_EN50221_POLL_CAM_READY;
 		}
diff --git a/drivers/staging/media/cxd2099/cxd2099.h b/drivers/staging/media/cxd2099/cxd2099.h
index f4b29b1d6eb8..aba803268e94 100644
--- a/drivers/staging/media/cxd2099/cxd2099.h
+++ b/drivers/staging/media/cxd2099/cxd2099.h
@@ -3,23 +3,14 @@
  *
  * Copyright (C) 2010-2011 Digital Devices GmbH
  *
- *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
  * version 2 only, as published by the Free Software Foundation.
  *
- *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- *
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA
- * Or, point your browser to http://www.gnu.org/copyleft/gpl.html
  */
 
 #ifndef _CXD2099_H_
@@ -42,8 +33,9 @@ struct dvb_ca_en50221 *cxd2099_attach(struct cxd2099_cfg *cfg,
 				      void *priv, struct i2c_adapter *i2c);
 #else
 
-static inline struct dvb_ca_en50221 *cxd2099_attach(struct cxd2099_cfg *cfg,
-					void *priv, struct i2c_adapter *i2c)
+static inline struct
+dvb_ca_en50221 *cxd2099_attach(struct cxd2099_cfg *cfg, void *priv,
+			       struct i2c_adapter *i2c)
 {
 	dev_warn(&i2c->dev, "%s: driver disabled by Kconfig\n", __func__);
 	return NULL;
-- 
2.13.6

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/3] [media] staging/cxd2099: fix debug message severity
  2017-12-12 18:46 [PATCH 0/3] staging/cxd2099: cosmetics, checkpatch fixup Daniel Scheller
  2017-12-12 18:46 ` [PATCH 1/3] [media] staging/cxd2099: fix remaining checkpatch-strict issues Daniel Scheller
@ 2017-12-12 18:46 ` Daniel Scheller
  2017-12-12 18:46 ` [PATCH 3/3] [media] staging/cxd2099: cosmetics: improve strings Daniel Scheller
  2 siblings, 0 replies; 4+ messages in thread
From: Daniel Scheller @ 2017-12-12 18:46 UTC (permalink / raw)
  To: linux-media, mchehab, mchehab; +Cc: jasmin

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

Debug messages should go to KERN_DEBUG, thus change the slot_shutdown()
notice from dev_info() to dev_dbg().

Signed-off-by: Daniel Scheller <d.scheller@gmx.net>
Signed-off-by: Jasmin Jessich <jasmin@anw.at>
---
 drivers/staging/media/cxd2099/cxd2099.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/media/cxd2099/cxd2099.c b/drivers/staging/media/cxd2099/cxd2099.c
index 21b1c6fcf9bf..38d43647d4bf 100644
--- a/drivers/staging/media/cxd2099/cxd2099.c
+++ b/drivers/staging/media/cxd2099/cxd2099.c
@@ -518,7 +518,7 @@ static int slot_shutdown(struct dvb_ca_en50221 *ca, int slot)
 {
 	struct cxd *ci = ca->data;
 
-	dev_info(&ci->i2c->dev, "%s\n", __func__);
+	dev_dbg(&ci->i2c->dev, "%s\n", __func__);
 	if (ci->cammode)
 		read_data(ca, slot, ci->rbuf, 0);
 	mutex_lock(&ci->lock);
-- 
2.13.6

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 3/3] [media] staging/cxd2099: cosmetics: improve strings
  2017-12-12 18:46 [PATCH 0/3] staging/cxd2099: cosmetics, checkpatch fixup Daniel Scheller
  2017-12-12 18:46 ` [PATCH 1/3] [media] staging/cxd2099: fix remaining checkpatch-strict issues Daniel Scheller
  2017-12-12 18:46 ` [PATCH 2/3] [media] staging/cxd2099: fix debug message severity Daniel Scheller
@ 2017-12-12 18:46 ` Daniel Scheller
  2 siblings, 0 replies; 4+ messages in thread
From: Daniel Scheller @ 2017-12-12 18:46 UTC (permalink / raw)
  To: linux-media, mchehab, mchehab; +Cc: jasmin

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

Prefix dev_*() I2C address prints with 0x, change CXD2099 to CXD2099AR,
change the MODULE_DESCRIPTION to a proper one and have a better (and
shorter) description for the buffermode modparam.

Signed-off-by: Daniel Scheller <d.scheller@gmx.net>
Signed-off-by: Jasmin Jessich <jasmin@anw.at>
---
 drivers/staging/media/cxd2099/cxd2099.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/media/cxd2099/cxd2099.c b/drivers/staging/media/cxd2099/cxd2099.c
index 38d43647d4bf..227a329f0c6e 100644
--- a/drivers/staging/media/cxd2099/cxd2099.c
+++ b/drivers/staging/media/cxd2099/cxd2099.c
@@ -26,7 +26,7 @@
 
 static int buffermode;
 module_param(buffermode, int, 0444);
-MODULE_PARM_DESC(buffermode, "Enable use of the CXD2099AR buffer mode (default: disabled)");
+MODULE_PARM_DESC(buffermode, "Enable CXD2099AR buffer mode (default: disabled)");
 
 static int read_data(struct dvb_ca_en50221 *ca, int slot, u8 *ebuf, int ecount);
 
@@ -668,7 +668,8 @@ struct dvb_ca_en50221 *cxd2099_attach(struct cxd2099_cfg *cfg,
 	u8 val;
 
 	if (i2c_read_reg(i2c, cfg->adr, 0, &val) < 0) {
-		dev_info(&i2c->dev, "No CXD2099 detected at %02x\n", cfg->adr);
+		dev_info(&i2c->dev, "No CXD2099AR detected at 0x%02x\n",
+			 cfg->adr);
 		return NULL;
 	}
 
@@ -686,7 +687,7 @@ struct dvb_ca_en50221 *cxd2099_attach(struct cxd2099_cfg *cfg,
 	ci->en = en_templ;
 	ci->en.data = ci;
 	init(ci);
-	dev_info(&i2c->dev, "Attached CXD2099AR at %02x\n", ci->cfg.adr);
+	dev_info(&i2c->dev, "Attached CXD2099AR at 0x%02x\n", ci->cfg.adr);
 
 	if (!buffermode) {
 		ci->en.read_data = NULL;
@@ -699,6 +700,6 @@ struct dvb_ca_en50221 *cxd2099_attach(struct cxd2099_cfg *cfg,
 }
 EXPORT_SYMBOL(cxd2099_attach);
 
-MODULE_DESCRIPTION("cxd2099");
+MODULE_DESCRIPTION("CXD2099AR Common Interface controller driver");
 MODULE_AUTHOR("Ralph Metzler");
 MODULE_LICENSE("GPL");
-- 
2.13.6

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-12-12 18:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-12 18:46 [PATCH 0/3] staging/cxd2099: cosmetics, checkpatch fixup Daniel Scheller
2017-12-12 18:46 ` [PATCH 1/3] [media] staging/cxd2099: fix remaining checkpatch-strict issues Daniel Scheller
2017-12-12 18:46 ` [PATCH 2/3] [media] staging/cxd2099: fix debug message severity Daniel Scheller
2017-12-12 18:46 ` [PATCH 3/3] [media] staging/cxd2099: cosmetics: improve strings Daniel Scheller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.