linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch v3 1/2] video/saa7134: change dprintk() to i2cdprintk()
@ 2010-05-25  9:19 Dan Carpenter
  2010-05-26 12:43 ` Jean Delvare
  0 siblings, 1 reply; 3+ messages in thread
From: Dan Carpenter @ 2010-05-25  9:19 UTC (permalink / raw)
  To: Jean Delvare
  Cc: Mauro Carvalho Chehab, Beholder Intl. Ltd. Dmitry Belimov,
	hermann pitton, Douglas Schilling Landgraf, linux-media,
	kernel-janitors

The problem is that dprintk() dereferences "dev" which is null here.
The i2cdprintk() uses "ir" so that's OK.

Signed-off-by: Dan Carpenter <error27@gmail.com>
---
v2: Jean Delvare suggested that I use i2cdprintk() instead of modifying
dprintk().
v3: V2 had a bonus cleanup that I removed from v3

diff --git a/drivers/media/video/saa7134/saa7134-input.c b/drivers/media/video/saa7134/saa7134-input.c
index e5565e2..7691bf2 100644
--- a/drivers/media/video/saa7134/saa7134-input.c
+++ b/drivers/media/video/saa7134/saa7134-input.c
@@ -141,8 +141,8 @@ static int get_key_flydvb_trio(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw)
 	struct saa7134_dev *dev = ir->c->adapter->algo_data;
 
 	if (dev == NULL) {
-		dprintk("get_key_flydvb_trio: "
-			 "gir->c->adapter->algo_data is NULL!\n");
+		i2cdprintk("get_key_flydvb_trio: "
+			   "gir->c->adapter->algo_data is NULL!\n");
 		return -EIO;
 	}
 
@@ -195,8 +195,8 @@ static int get_key_msi_tvanywhere_plus(struct IR_i2c *ir, u32 *ir_key,
 	/* <dev> is needed to access GPIO. Used by the saa_readl macro. */
 	struct saa7134_dev *dev = ir->c->adapter->algo_data;
 	if (dev == NULL) {
-		dprintk("get_key_msi_tvanywhere_plus: "
-			"gir->c->adapter->algo_data is NULL!\n");
+		i2cdprintk("get_key_msi_tvanywhere_plus: "
+			   "gir->c->adapter->algo_data is NULL!\n");
 		return -EIO;
 	}
 


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

* Re: [patch v3 1/2] video/saa7134: change dprintk() to i2cdprintk()
  2010-05-25  9:19 [patch v3 1/2] video/saa7134: change dprintk() to i2cdprintk() Dan Carpenter
@ 2010-05-26 12:43 ` Jean Delvare
  2010-05-26 14:58   ` [patch v4 " Dan Carpenter
  0 siblings, 1 reply; 3+ messages in thread
From: Jean Delvare @ 2010-05-26 12:43 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Mauro Carvalho Chehab, Beholder Intl. Ltd. Dmitry Belimov,
	hermann pitton, Douglas Schilling Landgraf, linux-media,
	kernel-janitors

Hi Dan,

On Tue, 25 May 2010 11:19:53 +0200, Dan Carpenter wrote:
> The problem is that dprintk() dereferences "dev" which is null here.
> The i2cdprintk() uses "ir" so that's OK.
> 
> Signed-off-by: Dan Carpenter <error27@gmail.com>
> ---
> v2: Jean Delvare suggested that I use i2cdprintk() instead of modifying
> dprintk().
> v3: V2 had a bonus cleanup that I removed from v3
> 
> diff --git a/drivers/media/video/saa7134/saa7134-input.c b/drivers/media/video/saa7134/saa7134-input.c
> index e5565e2..7691bf2 100644
> --- a/drivers/media/video/saa7134/saa7134-input.c
> +++ b/drivers/media/video/saa7134/saa7134-input.c
> @@ -141,8 +141,8 @@ static int get_key_flydvb_trio(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw)
>  	struct saa7134_dev *dev = ir->c->adapter->algo_data;
>  
>  	if (dev == NULL) {
> -		dprintk("get_key_flydvb_trio: "
> -			 "gir->c->adapter->algo_data is NULL!\n");
> +		i2cdprintk("get_key_flydvb_trio: "
> +			   "gir->c->adapter->algo_data is NULL!\n");

Sorry for noticing only now, but "gir->" in the comment is odd. As seen
in the code above, it's actually "ir->". Maybe you want to fix this, as
you are already touching that line anyway.


Other than this, this patch is:

Acked-by: Jean Delvare <khali@linux-fr.org>

>  		return -EIO;
>  	}
>  
> @@ -195,8 +195,8 @@ static int get_key_msi_tvanywhere_plus(struct IR_i2c *ir, u32 *ir_key,
>  	/* <dev> is needed to access GPIO. Used by the saa_readl macro. */
>  	struct saa7134_dev *dev = ir->c->adapter->algo_data;
>  	if (dev == NULL) {
> -		dprintk("get_key_msi_tvanywhere_plus: "
> -			"gir->c->adapter->algo_data is NULL!\n");
> +		i2cdprintk("get_key_msi_tvanywhere_plus: "
> +			   "gir->c->adapter->algo_data is NULL!\n");
>  		return -EIO;
>  	}
>  
> 


-- 
Jean Delvare

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

* [patch v4 1/2] video/saa7134: change dprintk() to i2cdprintk()
  2010-05-26 12:43 ` Jean Delvare
@ 2010-05-26 14:58   ` Dan Carpenter
  0 siblings, 0 replies; 3+ messages in thread
From: Dan Carpenter @ 2010-05-26 14:58 UTC (permalink / raw)
  To: Jean Delvare
  Cc: Mauro Carvalho Chehab, Beholder Intl. Ltd. Dmitry Belimov,
	hermann pitton, Douglas Schilling Landgraf, linux-media,
	kernel-janitors

The problem is that dprintk() dereferences "dev" which is null here.
The i2cdprintk() uses "ir" so that's OK.

Also Jean Delvare pointed out a typo in the comment so we may as well
fix that.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Acked-by: Jean Delvare <khali@linux-fr.org>
---
v2: Jean Delvare suggested that I use i2cdprintk() instead of modifying
dprintk().
v3: V2 had a bonus cleanup that I removed from v3
v4: Fixed typo in the comment.

diff --git a/drivers/media/video/saa7134/saa7134-input.c b/drivers/media/video/saa7134/saa7134-input.c
index e5565e2..7691bf2 100644
--- a/drivers/media/video/saa7134/saa7134-input.c
+++ b/drivers/media/video/saa7134/saa7134-input.c
@@ -141,8 +141,8 @@ static int get_key_flydvb_trio(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw)
 	struct saa7134_dev *dev = ir->c->adapter->algo_data;
 
 	if (dev == NULL) {
-		dprintk("get_key_flydvb_trio: "
-			 "gir->c->adapter->algo_data is NULL!\n");
+		i2cdprintk("get_key_flydvb_trio: "
+			   "ir->c->adapter->algo_data is NULL!\n");
 		return -EIO;
 	}
 
@@ -195,8 +195,8 @@ static int get_key_msi_tvanywhere_plus(struct IR_i2c *ir, u32 *ir_key,
 	/* <dev> is needed to access GPIO. Used by the saa_readl macro. */
 	struct saa7134_dev *dev = ir->c->adapter->algo_data;
 	if (dev == NULL) {
-		dprintk("get_key_msi_tvanywhere_plus: "
-			"gir->c->adapter->algo_data is NULL!\n");
+		i2cdprintk("get_key_msi_tvanywhere_plus: "
+			   "ir->c->adapter->algo_data is NULL!\n");
 		return -EIO;
 	}
 



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

end of thread, other threads:[~2010-05-26 15:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-25  9:19 [patch v3 1/2] video/saa7134: change dprintk() to i2cdprintk() Dan Carpenter
2010-05-26 12:43 ` Jean Delvare
2010-05-26 14:58   ` [patch v4 " Dan Carpenter

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