linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] staging: media: as102: replace custom dprintk() with dev_dbg()
@ 2014-05-17 13:16 Martin Kepplinger
  2014-05-17 13:59 ` Antti Palosaari
  0 siblings, 1 reply; 10+ messages in thread
From: Martin Kepplinger @ 2014-05-17 13:16 UTC (permalink / raw)
  To: gregkh; +Cc: m.chehab, linux-media, devel, linux-kernel, Martin Kepplinger

don't reinvent dev_dbg(). use the common kernel coding style.

Signed-off-by: Martin Kepplinger <martink@posteo.de>
---
this applies to next-20140516.

 drivers/staging/media/as102/as102_drv.c |   11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/media/as102/as102_drv.c b/drivers/staging/media/as102/as102_drv.c
index 09d64cd..99c3ed93 100644
--- a/drivers/staging/media/as102/as102_drv.c
+++ b/drivers/staging/media/as102/as102_drv.c
@@ -74,7 +74,8 @@ static void as102_stop_stream(struct as102_dev_t *dev)
 			return;
 
 		if (as10x_cmd_stop_streaming(bus_adap) < 0)
-			dprintk(debug, "as10x_cmd_stop_streaming failed\n");
+			dev_dbg(&dev->bus_adap.usb_dev->dev,
+				"as10x_cmd_stop_streaming failed\n");
 
 		mutex_unlock(&dev->bus_adap.lock);
 	}
@@ -112,14 +113,16 @@ static int as10x_pid_filter(struct as102_dev_t *dev,
 	int ret = -EFAULT;
 
 	if (mutex_lock_interruptible(&dev->bus_adap.lock)) {
-		dprintk(debug, "mutex_lock_interruptible(lock) failed !\n");
+		dev_dbg(&dev->bus_adap.usb_dev->dev,
+			"amutex_lock_interruptible(lock) failed !\n");
 		return -EBUSY;
 	}
 
 	switch (onoff) {
 	case 0:
 		ret = as10x_cmd_del_PID_filter(bus_adap, (uint16_t) pid);
-		dprintk(debug, "DEL_PID_FILTER([%02d] 0x%04x) ret = %d\n",
+		dev_dbg(&dev->bus_adap.usb_dev->dev,
+			"DEL_PID_FILTER([%02d] 0x%04x) ret = %d\n",
 			index, pid, ret);
 		break;
 	case 1:
@@ -131,7 +134,7 @@ static int as10x_pid_filter(struct as102_dev_t *dev,
 		filter.pid = pid;
 
 		ret = as10x_cmd_add_PID_filter(bus_adap, &filter);
-		dprintk(debug,
+		dev_dbg(&dev->bus_adap.usb_dev->dev,
 			"ADD_PID_FILTER([%02d -> %02d], 0x%04x) ret = %d\n",
 			index, filter.idx, filter.pid, ret);
 		break;
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 10+ messages in thread
* Re: [PATCH] staging: media: as102: replace custom dprintk() with dev_dbg()
@ 2014-08-04  9:10 Dan Carpenter
  2014-08-04 10:17 ` [PATCHv2] " Martin Kepplinger
  0 siblings, 1 reply; 10+ messages in thread
From: Dan Carpenter @ 2014-08-04  9:10 UTC (permalink / raw)
  To: Martin Kepplinger; +Cc: gregkh, devel, linux-media, linux-kernel, m.chehab

On Sun, Aug 03, 2014 at 04:54:21PM +0200, Martin Kepplinger wrote:
> @@ -447,6 +457,13 @@ static uint8_t as102_fe_get_code_rate(fe_code_rate_t arg)
>  static void as102_fe_copy_tune_parameters(struct as10x_tune_args *tune_args,
>  			  struct dtv_frontend_properties *params)
>  {
> +	struct dvb_frontend *fe;
> +	struct as102_dev_t *dev;
> +
> +	fe = container_of(params, struct dvb_frontend, dtv_property_cache);
> +	dev = (struct as102_dev_t *) fe->tuner_priv;
> +	if (dev == NULL)
> +		dev_err(&dev->bus_adap.usb_dev->dev, "No device found\n");

NULL dereference in printing error message.  I think smatch or
coccinelle would detect this although I haven't tried either.

This is the typical bug for this kind of patch.

regards,
dan carpenter

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

end of thread, other threads:[~2014-08-04 11:12 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-17 13:16 [PATCH] staging: media: as102: replace custom dprintk() with dev_dbg() Martin Kepplinger
2014-05-17 13:59 ` Antti Palosaari
2014-05-17 16:05   ` [PATCHv2] " Martin Kepplinger
2014-05-17 17:21     ` Antti Palosaari
2014-05-17 17:52       ` Martin Kepplinger
2014-05-17 18:43         ` Gianluca Gennari
2014-05-17 19:22       ` Dan Carpenter
  -- strict thread matches above, loose matches on Subject: below --
2014-08-04  9:10 [PATCH] " Dan Carpenter
2014-08-04 10:17 ` [PATCHv2] " Martin Kepplinger
2014-08-04 10:40   ` Dan Carpenter
2014-08-04 11:12     ` Joe Perches

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).